Shop OBEX P1 Docs P2 Docs Learn Events
P2 SD BOOT ROM v2 (for P2 respin Feb 2019) +exFAT trial - Page 4 — Parallax Forums

P2 SD BOOT ROM v2 (for P2 respin Feb 2019) +exFAT trial

12467

Comments

  • Cluso99Cluso99 Posts: 18,069
    pnut v32j is what I am running and I think it's the latest.

    And thanks for those test results. I seem to have a bug when it fails.
  • cheezuscheezus Posts: 298
    edited 2019-02-17 04:10
    I seem to have failing results on all my cards. I'm probably just doing something wrong.
    I finally got it working with on my 4gb SanDisk uSDHC -4
    -edit-
    This is tested working on all my cards-
    *ADATA 16g uSDHC -10*
    *SANDISK 4gb uSDHC -4*
    *RiDATA uSD 2gb*
    P2-EVAL ROM_Booter_v32i_SD_002d
    check init?
    check cmd0?
    check cmd8?
    i) block mode
    check cmd16?
    check mbr?
    read sector
    i) ptn type 0000000C
    read sector
    read sector
    read sector
    check dir?
    read sector
    check file?
    read sector
    running :)
    SD-DO tristate
    running :)
    0000000A
    
    

    At first all of my cards failed, giving the error -
    P2-EVAL ROM_Booter_v32i_SD_002d
    check init?
    check cmd0?
    check cmd8?
    i) block mode
    check cmd16?
    check mbr?
    read sector
    i) ptn type 0000000C
    read sector
    read sector
    read sector
    check dir?
    read sector
    check ser?
    
    

    And the last failure I had, before I got it working: -edit; this seems to happen when the card has already been mounted.

    I'm not sure how to reproduced this error right now..
    
    P2-EVAL ROM_Booter_v32i_SD_002d
    check init?
    check cmd0?
    3333005A
    77770000
    SD boot failed
    SD-DO tristate
    check cmd0?
    check cmd8?
    33330062
    000000FF
    SD boot failed
    SD-DO tristate
    check ser?
    
    

    I'm not sure if my failing results are significant or not. I thought I'd post them here, just in case they're helpful. I'll check the rest of my cards and edit this post with results.
  • Cluso99Cluso99 Posts: 18,069
    edited 2019-02-17 04:54
    Thanks for posting.

    The 2GB card is probably failing due to FAT16 format.

    There is a problem with error handling once a problem is found. I am working on this. I have a more detailed debug that I’ll post when i get home.

    I am also trying to find how exFAT locates the DIR table and how that defines the start sector and length of the file.
  • Cluso99 wrote: »
    Thanks for posting.

    The 2GB card is probably failing due to FAT16 format.

    There is a problem with error handling once a problem is found. I am working on this. I have a more detailed debug that I’ll post when i get home.

    I am also trying to find how exFAT locates the DIR table and how that defines the start sector and length of the file.

    I would think that if you were trying to make it work in any way with exFAT then this would not be practical for a P2 system since WE would still need to be able to write to files as well as reading. This is why I have FAT32 FORMAT utilities for this purpose. I also happened to fix a few of my cards that had bad boot blocks, I simply issued the !MBR part that is used in FORMAT and rescued all my data! I see if I can test this all out tomorrow when I pick up some 64gb Kingston microSD cards from MSY for $14 and I'm tempted to try the Sandisk Ultra 200GB ones they sell for $58.
  • Cluso99Cluso99 Posts: 18,069
    Sandisk Ultra 200GB ones they sell for $58

    They are way toooo small. Why not try the 2TB ones on eBay. I'm sure you can find them for ~$10 ;)

    exFAT: I was interested to see if I could just find a file and load it (only if I have space/time). But I agree FAT32 is the important one. Probably be ~10 years until we can get cheapish 2TB uSD.
  • cgraceycgracey Posts: 14,134
    cheezus wrote: »
    I'm getting ready to run these tests but I wanted to make sure I'm using the right version on PNUT. I have PNut_v32j.exe is this the latest version?

    Yes, but only if you have an FPGA board to run it on.
  • Cluso99Cluso99 Posts: 18,069
    I have been running v32j on P2D2 and P2-EVAL fine
  • Cluso99Cluso99 Posts: 18,069
    Here is the latest SD code with more debugging enabled
  • samuellsamuell Posts: 554
    edited 2019-02-17 13:46
    Hi,

    I'm having trouble running this. If I run the booter spin file via spin2ide, having the boot file already on the SD card, I can only see blank spaces filling the upper half of the terminal window. PNut doesn't load any terminal after compiling. How can I see those results? Is there any switch configuration to be used?

    Kind regards, Samuel Lourenço
  • Cluso99Cluso99 Posts: 18,069
    edited 2019-02-17 14:53
    Use pnut to compile and download the file to the P2-EVAL board. The quickly open PST (parallax serial terminal) to see the results. Dont forget the switch setting as described a few posts back.
    I dont use spin2 as i use proptool to edit and it doesnt color etc if its a spin2 extension.
  • samuell wrote: »
    I'm having trouble running this. If I run the booter spin file via spin2ide, having the boot file already on the SD card, I can only see blank spaces filling the upper half of the terminal window. PNut doesn't load any terminal after compiling. How can I see those results? Is there any switch configuration to be used?

    Kind regards, Samuel Lourenço

    fastspin (the compiler for spin2gui) and PNut produce the same binary for ROM_Booter_v32i_SD-002f.spin, so I'm not sure why there'd be a problem running. Maybe the baud rate or clock rate isn't matching up? It looks like the test program outputs at 115200 baud, so in spin2gui you'll have to change the loadp2 command line (under the Commands > Configure Commands menu setting) to use 115200 baud instead of 230400 baud.
  • samuellsamuell Posts: 554
    edited 2019-02-18 04:15
    Hi,

    I'm using a SanDisk Ultra 16GB Class 10 SD card. By compiling and running "ROM_Booter_v32i_SD-002d.spin" using spin2gui, I get the following output:
    [ Entering terminal mode.  Press ESC to exit. ]
    P2-EVAL ROM_Booter_v32i_SD_002d
    check init?
    check cmd0?
    check cmd8?
    i) block mode
    check cmd16?
    check mbr?
    read sector
    i) ptn type 0000000C
    read sector
    read sector
    read sector
    check dir?
    read sector
    check file?
    read sector
    running :)
    SD-DO tristate
    running :)
    0000000A
    

    So, it seems to run fine. I hope this helps!

    Kind regards, Samuel Lourenço
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2019-02-18 05:26
    @samuell and others

    If in doubt about what the P2 is seeing and if there are any problems on the SD card then just escape into TAQOZ the high-level debugger either from reset with [>] [SPACE] [ESC] or ESC <ENTER> from the LMM low-level debugger.
    Then at the TAQOZ prompt type MOUNT<cr> then DIR<cr>.

    After this you can optionally check the FAT32 boot sector with a one-liner
    (this actually fetches the partition starting sector in the MBR and then opens the Volume Boot Record as a file which is partly dumped from 0 offset for $80 bytes)
    0 FOPEN $1C6 SD@ FOPEN 0 $80 SD DUMP
    

    You can also issue SD commands and examine the results interactively. TAQOZ is the hardware debugging tool built into the ROM. If you want to avoid unnecessary pain just use it. Otherwise do it the slow painful way instead.

    Here's what it looks like:
    TAQOZ# MOUNT .SDSL08G 50AD_0021 P2 CARD    64k 7,576M ok
    TAQOZ# DIR 
    .SDSL08G 50AD_0021 P2 CARD    64k 7,576M
    ROOTDIR      $0000_2706   1980.00.00.00.00   0
    ASCIIART.TXT $0000_2886   2017.11.23.15.05   55,148
    BIRD    .BMP $0000_2906   2018.12.03.06.54   308,346
    BUZZ    .BMP $0000_2B86   2018.11.11.01.53   308,346
    DRAGON  .BMP $0000_2E06   2018.10.23.01.21   308,346
    EYEGOD  .BMP $0000_3086   2018.10.28.04.17   308,346
    FACE    .BMP $0000_3306   2018.10.28.04.03   308,346
    FIRE    .BMP $0000_3586   2018.11.02.23.51   308,346
    FISH2   .VT  $0000_3806   2017.11.23.15.08   211,945
    ILIAD   .TXT $0000_3A06   2017.11.23.12.55   1,201,891
    KJV     .TXT $0000_4386   2017.08.28.12.28   5,504,282
    LEXICON .TXT $0000_6D86   2017.11.23.13.48   988,130
    LMMS    .BMP $0000_7586   2018.10.23.01.01   308,280
    LOVE    .WAV $0000_7806   2015.02.16.08.06   14,630,692
    MCQUEEN .BMP $0000_E806   2018.10.28.04.19   308,346
    MIDENG  .TXT $0000_EA86   2017.11.23.14.11   1,248,077
    P2D2A   .BMP $0000_F486   2018.12.06.14.26   308,346
    POPCORN .WAV $0000_F706   2012.11.07.13.26   3,242,394
    PRIDE   .TXT $0001_1006   2017.11.23.12.54   726,223
    ROUGES  .TXT $0001_1606   2017.11.23.13.51   219,885
    SPIDEY  .BMP $0001_1806   2018.10.28.04.24   308,346
    SPIDEY  .LZM $0001_1A86   2019.02.14.14.23   102,984
    SUNSET  .BMP $0001_1B86   2018.10.28.04.13   308,346
    TIGER   .BMP $0001_1E06   2018.12.06.14.23   308,346
    VULGAR  .TXT $0001_2086   2017.11.23.13.56   511,916
    WARPEACE.LZM $0001_2486   2019.02.14.14.22   921,939
    WARPEACE.TXT $0001_2C06   2015.08.30.07.27   3,226,652
    WARWORLD.TXT $0001_4506   2017.11.23.13.42   365,413
    WEBSTERS.TXT $0001_4806   2017.11.23.12.59   28,956,348
    P2      .LZ4 $0002_2506   2019.02.16.07.43   16,945
    P2      .ROM $0002_2586   2019.02.15.08.21   65,536
    _BOOT_P2.B2  $0002_2606   2019.02.14.14.16   65,536
    _BOOT_P2.BIN $0002_2686   2018.12.27.06.48   131,072
    RECLAIM .FTH $0002_2786   2019.02.17.09.49   1,275
     ok
    TAQOZ# 0 FOPEN $1C6 SD@ FOPEN 0 $80 SD DUMP 
    00000: EB 5B 90 54  41 51 4F 5A  20 50 32 00  02 80 20 00     '.[.TAQOZ P2... .'
    00010: 02 00 00 00  00 F8 00 00  3F 00 FF 00  00 20 00 00     '........?.... ..'
    00020: 00 C0 EC 00  F3 03 00 00  00 00 00 00  02 00 00 00     '................'
    00030: 01 00 06 00  00 00 00 00  00 00 00 00  00 00 00 00     '................'
    00040: 80 01 29 21  00 AD 50 50  32 20 43 41  52 44 20 20     '..)!..PP2 CARD  '
    00050: 20 20 46 41  54 33 32 20  20 20 00 00  00 00 20 20     '  FAT32   ....  '
    00060: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00     '................'
    00070: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00     '................' ok
    TAQOZ#
    
  • Here's results 3 cards I've just tested.
    Sandisk Ultra 16GB - Windows 7 reports as SDHC FAT32
    Team 128GB - Windows 7 reports as SDXC exFAT
    Samsung 64GB - Windows 7 reports as SDXC exFAT

    --

    Sandisk Ultra 16GB - Windows 7 reports as SDHC FAT32
    P2-EVAL ROM_Booter_v32i_SD_002f
    INIT:
    (CMD: 00 00000000 95)
    (CMD: 08 000001AA 87)
    SD boot failed
    33330008
    check ser?
    SD-DO tristate
    

  • Cluso99Cluso99 Posts: 18,069
    Not sue why that card failed cmd 8.
    At the dentist so later tonight ill add a bit more debugging as i want to know why it failed.
  • I found a second identical card that behaved the same. These are $8.94 at officeworks if you want to grab one to test locally

    I might pick up a larger version in the same series and see what it does
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2019-02-18 06:49
    @Tubular - maybe you can load the latest version of TAQOZ for ROM and try formatting those cards for me to see how they go? Just load this P2.ROM attached, rename to _P2_BOOT.BIX, let it boot up the P2, swap cards and it will automount, then you can .DISK and DIR to check if you like and then type "0 FORMAT" to select auto cluster size which in the case of the larger cards will be 64KB clusters.

    Alternatively I tried using loadp2 to directly load P2.ROM and that works too.

    Wait there - I need to post the P2-EVAL version, there's only a clock config change - I will post again.
    ROM
    64K
  • cgraceycgracey Posts: 14,134
    Peter, have you got your ROM code done? We are over time with ON Semi now. We should have half a day to make FPGA images and test the ROM.
  • I grabbed a 32 GB in the same series that was only $1 more, will check what it does/says

    Then try Peter's code and see what it reports
  • TubularTubular Posts: 4,656
    edited 2019-02-18 07:09
    Ok the 32GB Sandisk Ultra also fails the same way.
    
    P2-EVAL ROM_Booter_v32i_SD_002f
    INIT:
    (CMD: 00 00000000 95)
    (CMD: 08 000001AA 87)
    SD boot failed
    33330008
    check ser?
    SD-DO tristate
    
    

    So because this is fresh and doesn't have other files on it, I'll load Taqoz later and try what Peter says
  • Here's the P2ES.ROM, you can use loadp2 or put it onto a card for booting.

    @Chip - busy getting my decompress working and squeezing - will get back shortly

  • Cluso99Cluso99 Posts: 18,069
    @tubular,
    Can you try the older ROM_Booter_v32i_SD-002d.spin here please? In case I introduced a timeout bug :(
    forums.parallax.com/discussion/comment/1464749/#Comment_1464749
  • Cluso99Cluso99 Posts: 18,069
    cheezus wrote: »
    I'm getting ready to run these tests but I wanted to make sure I'm using the right version on PNUT. I have PNut_v32j.exe is this the latest version?

    yes
  • Cluso99Cluso99 Posts: 18,069
    Here is my SanDisk Ultra 16GB FAT32 - loads _BOOT_P2.BIZ & flashes leds
  • My P2-ES seems to be allergic to some uSD cards.
    The two cards I have (Team 8GB and Sandisk 32GB) don't even get out the starting blocks.
    Both cards prevent Pnut from identifying (Ctrl-G) the Prop2, so forget about loading test code.
    Scope shows all voltage rails to be Ok, no spikes.

    Two other cards that work in Tubular's P2-ES work fine though, so uSD card circuit is fine.


  • I tried the prev version v32_SD-002f with same results Cluso

    I can't get a boot file to work on these. Tomorrow I'll buy some more cards and dig deeper

  • Ok, had some success at last with the new 32 Gb Sandisk Ultra bringing up new Taqoz.

    This is one of the maligned red and grey Sandisk Ultra SDHC cards.

    I'm going to stop at this point tonight and see what else I can make work in the morning. I think there was a combo of things I was doing wrong but I want to re-trace carefully.
  • ozpropdev wrote: »
    My P2-ES seems to be allergic to some uSD cards.
    The two cards I have (Team 8GB and Sandisk 32GB) don't even get out the starting blocks.
    Both cards prevent Pnut from identifying (Ctrl-G) the Prop2, so forget about loading test code.
    Scope shows all voltage rails to be Ok, no spikes.

    Two other cards that work in Tubular's P2-ES work fine though, so uSD card circuit is fine.

    Sorry if I'm checking the obvious, but could it be the DipSwitch settings ?
  • I had the same when I tried booting from SDs, some worked some I could not get working no matter what. Of those later ones there was one that could no longer be used after all the reformatting I tried (they were older Kingston SD cards ranging from 1 - 32GB and at least 5 years old, so no harm done)
    Buying a 32GB sandisk (non-ultra ones) solved all issues for me.

    unfortunately I'm not @home (3 more weeks to go :( ) so I can not try out
  • Ok so the thing I have found that makes a big difference is removing and replacing the uSD card in its socket, before hitting reset. When I do this it seems to always (almost always?) boot the new Taqoz image correctly from my now FAT32 formatted 64GB Samsung SDXC. This happens when switches are in (On)-Off-Off-Off or (On)-Off-Off-On [P59 pulldown enabled] switch modes

    When I don't to the uSD card removal thing, perhaps it boots successfully 2 out of 100 times. I've only seen it happen twice, but it happening verifies the rest of the chain - formatting FAT32 in taqoz, loading the _BOOT_P2.BIX image on etc, worked. Once that was extablished further experimentation showed up the card removal effectiveness

    Hopefully others can replicate the above. Tomorrow I'll see if I can scope some waveforms and better see whats going on

    Thanks again for all your work on all this Peter and Ray. When it does work, its a truly beautiful thing.
Sign In or Register to comment.