P2 SD BOOT TESTS

<comment doc link> <pub doc link>

Testing SD boot in the P2 ROM V32i


GOOD SD CARD - GOOD 32K BOOT FILE - 830ms


BAD SD CARD BOOT - 100ms

I've popped an old 256M card in and booted the P2 which of course fails SD boot. I've then been able to go into TAQOZ and confirm boot failure. The time from first boot activity to fail is about 100ms. ( I will do another post for a good card but no boot files as it will take longer to boot) (Also another one for pull-up only)

SD%20FAIL.png

Confirming SD detection and failure:

Cold start
----------------------------------------------------------------
 Parallax P2  .:.:--TAQOZ--:.:.  V1.0--142          180530-0135
----------------------------------------------------------------
TAQOZ# SD? . -1 ok
TAQOZ# !SD .L $0000_0000 ok
TAQOZ# 0 0 cmd . 1 ok

It responds to a CMD0 which says it is a real SD card.

Next I force a crc just for this command since it is still in SD mode and check CMD8.

TAQOZ# $87 $34 C!  ok
TAQOZ# $1AA 8 CMD .W $0005 ok

I repeatedly test but we need a response of 1 and this old card is not able to accommodate a $1AA capabilities.

SD%20INIT.png SD%20INIT%20STATES.png


PULL-UP on SD CS but no SD - 2ms

The case of a pull-up on SD CS but no SD isn't too bad. Most of the time seems to be taken up with the slow clocking before checking which I am fairly sure is not required of SDHC cards. However, it is only 2ms.

SD%20PULLUP%20ONLY.png

Confirming the pullup where SD? tests for a pullup and returns true/false where -1 is true. Then CMD0 with data of 0 (0 0 CMD) returns with 0 which could even be $FF if it were pulled up on the DO line but we are looking for a $01.

TAQOZ# SD? . -1 ok
TAQOZ# 0 0 CMD . 0 o
k

Confirming that slow clocking is NOT required I insert a card, check it for pull-up, and issue a raw CMD0 without anything else.

TAQOZ# SD? . -1 ok
TAQOZ# 0 0 CMD . 63 ok
TAQOZ# 0 0 CMD . 193 ok
TAQOZ# 0 0 CMD . 1 ok

The card responded after the 3rd try which is well within what we expect and allow for. Timing this without clocking:

TAQOZ# BEGIN SD? UNTIL 5 ms LAP BEGIN 0 0 CMD 1 = UNTIL LAP .LAP 8475 cycles = 105.937us  ok

Type a ^X to repeat the last line executed returns the exact same result:

TAQOZ# 8475 cycles = 105.937us  ok

So we could know within around 100us or so that it is a real SD card.


SD BOOT - NEW BLANK FAT32 - 193ms

Now here's another boot fail case I added, one where we insert a brand new FAT32 card that is blank. The SD booter still goes through the motions looking for a raw file before checking the root directory which is blank. Total time spent here is 193ms.

SD%20FAT32%20BLANK.png

Confirming it is blank and nothing, not even deleted entries in the root directory:

TAQOZ# SD?  ok
TAQOZ# DIR .SDSL08G 3230_3631 NO NAME    32k 7,576M
.SDSL08G 3230_3631 NO NAME    32k 7,576M
ok
TAQOZ#
 @ROOT FOPEN 0 $80 SD DUMP
00000: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00     '................'
00010: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00     '................'
00020: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00     '................'
00030: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00     '................'
00040: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00     '................'
00050: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00     '................'
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


NON-FAT32 SD BOOT FAIL - 320ms

I tried formatting an SD card to NTFS just to give the SD booter something tough to chew on. It seems NTFS is just unpleasant with a timeout of 320ms.

SD%20NTFS%20BOOT%20FAIL.png

TAQOZ# SD? . -1 ok
TAQOZ# !sd .L $C0FF_8000 ok
TAQOZ# MOUNT ...NCard 0000_0100  Y    u q  4k 0M ok
TAQOZ# DIR
...NCard 0000_0100  Y    u q  4k 0M
ok
TAQOZ#


FAT32 - MANY FILES BUT NO BOOT - 244ms

I noticed that this old 4G card had been formatted in a PC incorrectly. Always use a proper SD Formatter utility.

Nonetheless, after searching the root directory it timed out after 244ms.

SD%20FAT32K%20POOR%204K%20SECT%20-%20FILES%20BUT%20NO%20BOOT.png

TAQOZ# SD? . -1 ok
TAQOZ# !SD .L $C0FF_8000 ok
TAQOZ# MOUNT .SM00000 F184_E94B WIDGET     4k 3,758M ok
TAQOZ# DIR
.SM00000 F184_E94B WIDGET     4k 3,758M
WIDGET       $0000_42AC   2015.02.21.14.52   0
HOME    .HTM $0000_42C4   2015.02.17.15.19   68,037
P8CPU   .JPG $0000_434C   2015.02.17.15.18   67,271
IOTPINS .JPG $0000_43D4   2015.02.17.15.15   40,010
LOVE    .WAV $0000_4424   2015.02.16.18.06   14,630,692
MENU    .TXT $0007_3E8C   2014.01.20.22.59   1,556
EXTEND  .FTH $0000_B3EC   2015.02.16.15.31   99,338
P8      .H   $0000_B4B4   2015.02.13.23.44   1,401
EASYNET .FTH $0000_B4BC   2015.02.13.15.19   37,673
W5500   .FTH $0000_B50C   2015.02.13.01.50   14,872
EASYFILE.FTH $0000_B52C   2015.02.12.18.48   45,794
SDCARD  .FTH $0000_B58C   2015.02.12.18.22   16,343
IOT5500H.JPG $0000_B5AC   2014.11.20.14.07   28,237
DRAGON  .JPG $0000_B5E4   2014.11.20.10.31   376,830
AI o T 5. 5  $0250_42AC   1980.02.07.00.02   4,294,901,760
IOT5500 .JPG $0000_B8C4   2014.11.18.21.25   83,571
128K    .BIN $0000_B96C   2014.11.06.16.49   131,072
256K    .BIN $0000_BA6C   2014.10.28.07.59   262,144
W5200   .FTH $0000_BC6C   2014.09.28.23.19   19,889
SYSTEM  .ROM $0000_BC94   2015.02.25.15.05   65,536
WELCOME .TEL $0000_BD14   2014.06.19.18.36   212
WELCOME .FTP $0000_BD1C   2014.06.19.18.34   140
DEBUG   .ROM $0000_BD24   2014.06.19.18.31   65,536
POPCORN .WAV $0000_BDA4   2014.06.17.16.15   117,804
P8X32A  .PDF $0000_BE8C   2014.06.17.15.07   1,442,886
IMAGE3       $0000_C994   2014.06.15.23.54   80,286
FRED    .PNG $0000_CA34   2014.06.15.15.44   7,935
FSRSCH  .PNG $0000_CA44   2014.06.15.15.44   99,235
FSRPCB  .PNG $0000_CB0C   2014.06.15.15.44   64,764
IMAGE        $0000_CB8C   2014.06.15.15.44   16,204
HTTP404 .HTM $0000_CBAC   2014.06.15.15.44   564
IMAGE2       $0000_CBB4   2014.06.15.15.44   51,347
IMAGE1       $0000_CC1C   2014.06.15.15.44   12,500
LOGON   .HTM $0000_CC3C   2014.06.15.15.44   388
TACHYON .HTM $0000_CC44   2014.06.15.15.43   159,937
SITE0004.LOG $0000_CD84   2014.02.24.14.31   1,048,576
SITE0003.LOG $0000_D584   2014.02.24.14.31   1,048,576
SITE0002.LOG $0000_DD84   2014.02.24.14.31   1,048,576
SITE0001.LOG $0000_E584   2014.02.24.14.31   1,048,576
FAVICON .ICO $0000_ED84   2013.12.17.09.57   8,069
SYSLOG  .TXT $0000_ED94   2013.12.03.01.56   1,048,576
HCB4208 .JPG $0000_F594   2013.06.20.20.45   340,668
CHARLCD .JPG $0000_F834   2013.03.25.11.30   45,446
ECOLCD  .PDF $0000_F894   2012.05.24.21.20   342,919
LOVE    .MP3 $0000_FB34   2012.02.13.00.26   3,981,374
FIRMWARE.ROM $0001_199C   2015.02.25.16.32   65,536
EASYNET .AVI $0001_1A1C   2015.02.25.17.04   8,651,838
EASYNET2.OGV $0005_29C4   2015.02.23.12.48   69,830,407
Bm - 2 R. P  $0000_42AC   2107.15.31.31.63   4,294,967,295
. g o u. t  $0398_42AC   1980.03.18.00.03   6,357,093
GOUTPU~1     $0000_42AC   2015.02.26.14.59   0
EASYNET3.AVI $0004_666C   2015.02.25.15.10   25,601,912
ENU2   .TXT $0007_3E8C   2015.02.26.15.17   1,556
MENU1   .TXT $0000_B3C4   2015.02.26.10.57   19,948
TAQOZ#
 @BOOT FOPEN 0 $100 SD DUMP
00000: EB 58 90 6D  6B 66 73 2E  66 61 74 00  02 08 20 00     '.X.mkfs.fat... .'
00010: 02 00 00 00  00 F8 00 00  10 00 04 00  00 08 00 00     '................'
00020: 00 70 75 00  4E 1D 00 00  00 00 00 00  02 00 00 00     '.pu.N...........'
00030: 01 00 06 00  00 00 00 00  00 00 00 00  00 00 00 00     '................'
00040: 80 01 29 4B  E9 84 F1 57  49 44 47 45  54 20 20 20     '..)K...WIDGET   '
00050: 20 20 46 41  54 33 32 20  20 20 0E 1F  BE 77 7C AC     '  FAT32   ...w|.'
00060: 22 C0 74 0B  56 B4 0E BB  07 00 CD 10  5E EB F0 32     '".t.V.......^..2'
00070: E4 CD 16 CD  19 EB FE 54  68 69 73 20  69 73 20 6E     '.......This is n'
00080: 6F 74 20 61  20 62 6F 6F  74 61 62 6C  65 20 64 69     'ot a bootable di'
00090: 73 6B 2E 20  20 50 6C 65  61 73 65 20  69 6E 73 65     'sk.  Please inse'
000A0: 72 74 20 61  20 62 6F 6F  74 61 62 6C  65 20 66 6C     'rt a bootable fl'
000B0: 6F 70 70 79  20 61 6E 64  0D 0A 70 72  65 73 73 20     'oppy and..press '
000C0: 61 6E 79 20  6B 65 79 20  74 6F 20 74  72 79 20 61     'any key to try a'
000D0: 67 61 69 6E  20 2E 2E 2E  20 0D 0A 00  00 00 00 00     'gain ... .......'
000E0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00     '................'
000F0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00     '................' ok