Hello,
We have an AM5728 based device that is working as intended. Usually it boots from internal eMMC. A recovery method allows booting from an SD card, which can completely reprogram the eMMC. This, too, is working as intended. Our device boots from one SD card slot and a second SD card slot can be used for just data.
However, we have found if a user formats a SD card for data using windows, our device will hang during boot before displaying any characters on the serial console port. In other words, the device apparently hangs before MLO starts. If we remove the SD card with the power still connected, the device then boots normally. We determined the problem is the bootstrap code in the master boot record on the SD card. (The first 440 bytes in the first sector) This happens only using the SD card slot we enabled for booting. If we put the same SD card in the "data" slot, the device boots correctly. Note this problem can be reproduced with an empty formatted card - no files were copied to the card.
Windows apparently puts assembly code in the master boot record, probably to boot from an internal hard drive if the SD card is accidentally left in the system. Apparently when our device tries to boot, it tries to execute the foreign code. This apparently crashes the arm processor, which then reboots. This apparent boot, read from SD card, crash loop continues until the SD card is removed.
We used the SD card formatter (from www.sdcard.org) and our device boots fine with that card. The code in the master boot record is all zeros. Either the device detects all zeros or that arm instruction does nothing.
We can format an SD card with windows and edit the master boot record code to be all zeros and our unit boots correctly, which confirms the problem is that boot code.
We've tested with multiple SD cards, but mostly 16GB. The SD card is formatted as FAT32 and the one partition is not marked bootable. On our SD card used for recovery, the first partition is also FAT32 but it's marked bootable. There are two linux partitions on the the recovery card.
From what we've read in the AM572x technical reference manual, the code that detects and attempts to boot from the SD card is in ROM and can't be changed. Is this correct? Is there any way to prevent the boot process from reading & executing the code in the master boot record on a data SD card? Our goal is a data only SD card doesn't interfere with booting.
Any help will be appreciated.
Thanks,
Scott