RT685 SD card boot - loading image on SD card corrupts SD card FAT32 formatting

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RT685 SD card boot - loading image on SD card corrupts SD card FAT32 formatting

665 Views
dash
Contributor II

With support from NXP, I was able to obtain instructions to program an SD card for SD card boot mode and then boot from the SD card.

The issue is those steps corrupt the SD card's FAT32 formatting. I am not an expert on SD card FAT32 formatting but I found a utility that allows me to select a FAT32 sector size of 4KB.

4KB is relevant because the boot ROM was carefully designed to boot the image from SD card address 4K (0x1000) to leave space for a boot table.

Still, it seems, the steps to use blhost to write the image to 0x1000 on the SD card still results in the SD card no longer being recognized when I plug it back into my Windows 10 PC.

  1. Format the SD card for fat32, 4KB sectors
  2. Build a RAM application, I chose Hello World 
  3. Plug in SD card to RT685 EVK
  4. Set DIP switch to ISP mode (001), connect USB to J7 (power up reset)
  5. blhost -u 0x1fc9,0x0020 get-property 1
  6. blhost -u 0x1fc9,0x0020 -- fill-memory 0x1c000 4 0xd0080000
  7. blhost -u 0x1fc9,0x0020 -- configure-memory 0x120 0x1c000
  8. blhost -u 0x1fc9,0x0020 -t 100000 -- flash-erase-region 0x0 0x100000 0x120
    this step maybe should change the start address 0x1000 from 0x0, but SD boot does not work with that modification
  9. blhost -u 0x1fc9,0x0020 -- write-memory 0x1000 evkmimxrt685_hello_world.bin 0x120
  10. Change DIP switch to SD boot mode (110), connect USB to J5
  11. Start Teraterm or similar to COM port of the board
    be sure SDK_DEBUGCONSOLE=1 in MCUExpresso build settings for COM port terminal output
  12. Start JLink commander connect to MIMRT685, SWD, default speed
  13. At Jlink prompt type "w4 0x40130188 0x21" - program JLink OTP shadow register to select SD card vs eMMC
  14. Press reset button to see "Hello world" in the terminal output
  15. Unplugging, plugging USB J5 will lose the setting in step 13 unless the actual OTP bit is programmed (versus the shadow register)
  16. Once you have had enough fun with that, remove the SD card and plug into your PC. You will see it is no longer recognized as fat32 and Windows prompts you to reformat it.

I need a set of instructions that allows me to load an image, block that the area starting at 0x1000 for the size of the image, but still retain the ability to use the SD card with the SDK fatfs library functions.

Labels (1)
0 Kudos
2 Replies

599 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @dash ,

 Already answer you in your RT post:

https://community.nxp.com/t5/i-MX-RT/RT685-SD-card-boot-loading-image-on-SD-card-corrupts-SD-card/m-...

Any updated information, please give me reply in that post.

Best Regards,

Kerry

0 Kudos

645 Views
dash
Contributor II
0 Kudos