Shop OBEX P1 Docs P2 Docs Learn Events
How to test the SD card interface? — Parallax Forums

How to test the SD card interface?

ManAtWorkManAtWork Posts: 2,080
edited 2021-08-03 15:17 in Propeller 2

I have to admit that I have never used an SD card together with the P2.

How can I perform a quick test if the hardware works? In the "BOOT PROCESS" section of the Silicon Docs it is described how to connect an SD card. But I've found no information about how to write a file to the card so that the P2 boots from it. Or is this neccessary at all?

I've found there are some comands in TAQOZ to read and write from/to an SD card. But I have almost zero experience with it. Reading from the card should be enough to test if the hardware pins are properly connected. Do I have to test the boot process? I mean, could there be a screnario where the read/write works but booting fails (incorrect pullup/pulldown). AFAIK, the pullup on P60 which is required to detect the SD card is built into it. So it could only fail if the SD card itself is defective which I don't have to test during production-test, right?

Comments

  • dMajodMajo Posts: 855
    edited 2021-08-03 15:43

    IIRC:
    .CID gives the card ID (brand/model)
    .DISK gives complete card info

    to boot rename your bin image to _BOOT_P2.BIX and place it in the root

  • MaciekMaciek Posts: 668
    edited 2021-08-03 18:08

    Dumb, but the easiest - put a TAQOZ RLOADED image on the SD card and fire up the board with it inserted. If it boots...bingo. You'll see it in the terminal.
    For a couple of boards it is ok but to testy a hundred of them this way is a no go. Too tedious.

  • ManAtWorkManAtWork Posts: 2,080
    edited 2021-08-03 16:12

    Where can I get that image? I've searched a lot and found a lot of threads but no link for download.
    BTW the link "software" on the Parallax P2 documentation page is broken.

    @dMajo: .CID and .DISK don't work, at least not in the ROM version. But DIR does.

    to boot rename your bin image to _BOOT_P2.BIX and place it in the root

    Errrr, to get a bin image it is neccessary to merge the bootloader at $0000 and the main program at $1000 into one file, I think. How can I do that?

    Edit: I've found this. The ZIP contains a _BOOT_P2.BIX

  • evanhevanh Posts: 15,192

    No extra code is needed. Just rename your regular binary program and place it on the SD card (with FAT32 filesystem).

    Make sure there hasn't been any long filenames, even deleted files, on the SD card. These can confuse the boot process.

  • MaciekMaciek Posts: 668
    edited 2021-08-03 19:31

    @evanh said:
    No extra code is needed. Just rename your regular binary program and place it on the SD card (with FAT32 filesystem).

    Make sure there hasn't been any long filenames, even deleted files, on the SD card. These can confuse the boot process.

    Do I read you correctly ? Are you saying any working binary program ?

    On the second thought, why not :). Yes, that's the simplest way. Not even the TAQOZ is needed. Funny, I never tried this. Just didn't have the need.

  • yes

  • Cluso99Cluso99 Posts: 18,069

    Yes any valid P2 binary should work. Just rename it and copy to a FAT32 formatted SD card in the root directory.

  • ersmithersmith Posts: 5,918
    edited 2021-08-04 00:29

    By the way, FlexProp 5.5.2 (and later) includes a simple command shell for the P2. It's in samples/shell, and may be used to list the contents of an SD card and copy files between the host PC and the card (in both directions). It can also delete files and do a few other basic file management operations. The "Special > Command shell for P2" menu option runs it, or it can be built and run as usual (source code is samples/shell/shell.c).

  • Also TAQOZ should be able to access the SD card (never tried it though)

  • @rosco_pc said:
    Also TAQOZ should be able to access the SD card (never tried it though)

    I did, it works.

  • @dMajo said:
    to boot rename your bin image to _BOOT_P2.BIX and place it in the root

    @evanh said:
    No extra code is needed. Just rename your regular binary program and place it on the SD card (with FAT32 filesystem).

    Make sure there hasn't been any long filenames, even deleted files, on the SD card. These can confuse the boot process.

    Wow, it works! Another amazing feature of the P2. :)
    That raises the question why this isn't mentioned in the docs. There is a detailed explanation of the serial boot process which is only relevant to compiler developers a which joe random user (IMHO) doesn't understand. But a simple thing like booting from SD card is not mentioned with a single word.

  • Cluso99Cluso99 Posts: 18,069
    edited 2021-08-04 12:37

    I did a write up (posted as threads in the forum) for Ken and Chip but I don’t think they got around to including it in the docs :(

    There’s also a serial/monitor/debugger as well as TAQOZ in the ROM.

    BTW the monitor can locate, load and run any named 8.3 binary file in the root directory on a FAT32 formatted SD card. The SD routines and the monitor routines can be called from user programs although the spin2 debug now overwrites the ROM code (it’s copied into the top 16KB of hub).

    Sorry I cannot find it with search and I’m on my iPad so don’t have the links here. I’ll try to post the links tomorrow.

  • I've added a comment to the google doc.

  • evanhevanh Posts: 15,192

    @ManAtWork said:
    That raises the question why this isn't mentioned in the docs. There is a detailed explanation of the serial boot process which is only relevant to compiler developers a which joe random user (IMHO) doesn't understand. But a simple thing like booting from SD card is not mentioned with a single word.

    It gets a couple of words :P The table immediately under the heading BOOT PROCESS (needs more editing)

Sign In or Register to comment.