Open afinfante opened 2 years ago
I just checked that the same artifacts on another sd do work properly. Clearly it is due to the SD model itself, any ideas?
In driver/mci_media.c::sd_switch_func_high_speed
I have added a debug trace in order to see the current status & I see that the status with the OP's sd is 0, while in this successful case it is 16777216
AT91Bootstrap 4.0.1-dirty (2021-12-09 14:45:31)
EEPROM: Loading AT24xx information ...
EEPROM: BoardName | [Revid] | VendorName
#0 SAMA5D2-XULT [AC1] ATMEL-RFO
EEPROM: BoardDate | Year | Week
EEPROM: 2014 1
EEPROM: Board sn: 0xd300000 revision: 0x600000
SD/MMC: Image: Read file u-boot.bin to 0x26f00000
MMC: ADMA supported
SD: Card Capacity: High or Extended
sdcard identification success
SD: Specification Version 3.0X
Specification version reported
High speed device
Status: 16777216
SD/MMC: Done to load image
<debug_uart>
Hi @afinfante
I would need this card to test myself , to be able to reproduce your issue. I will see if I can find it for purchase in a shop. I would like to ask, your board is exactly sama5d2_xplained ? and you are trying on the SD slot which is connected to SDMMC1 ? or you are using a modified board. It;s interesting to see why on the first boot you have no problems, but on a second boot it fails. It is possible that the Card is being changed to a mode from which it does not recover on reset. the SD-card has no reset line, and unless there is a power cycle on the Card, it is not reset at all when you do software reset, and it's just reinitialized.
Is your card SDHC or SDXC ?
Hello @ehristev, thank you for getting back to me so quickly. It is SDHC. I leave you here the exact model: Kingston CANVAS Select Plus. That's what it says on the engraving of the SD. Reading the box for that model it seems to say that the 64GB - 1TB are SDXC and the 16GB - 32GB are SDHC. In this case I have a 32 GB sd card, so...
Hello again @ehristev and thank you in advance, I have left you the exact model and capacity in my previous comment. I bought it on amazon spain, but from what I've seen it is distributed normally in other countries.
That's it, it's exactly the same board. The plans are to make serveral modifications to it but for the moment it is as I received it.
but for the moment it's exactly as I received it. Answering to your next question, and following the above, that is, it is connected to the SDMMC1
.
The truth is that I've also found this behaviour quite curious, that's why I've decided to get in touch with you.
That's, there is no power cycle, just a reboot ordered by SW. However in this same scenario with the other model of Sandisk that I left in the first post everything works properly It should be the same if that was happening right?
Well let me say this, sandisk is part of the original Secure Digital that invented the SD protocol... while Kingston, well. There are many types of SDcards out there, and some of the vendors do not really respect the specs, or some vendors work fine even if the spec is 'bent' a little. I have some kingston cards but not exactly your model. I have some older one 8 GB capacity, which work as far as I know. I will try to order one card and try it.
Looking through your logs, it looks like the card refuses to switch to high speed mode. Could you enable the 'debug very loud' option in menuconfig , just go to debugging and choose the one with the most verbosity. Then try to run again and copy the logs for me. I need to see what kind of communication works with the card and which communication does not
Hello @ehristev, sorry for the delay. During today I will leave you the log you asked me for a few days ago to evaluate it.
Good afternoon @ehristev! The truth is that it is very interesting, thanks for the explanation. Here are the traces at the most verbose level for the case we talked about earlier. I got it from the reboot, which is when I was not able to load the U-Boot. It looks like we have a timeout?
�RomBOOTg... [ 58.543300] reboot: Restarting system
ba_offset = 0xc ...
Dump DDRAMC Registers:
@address: 0x0 0x4 0x8 0xc
0xf000c000: 0x10 0x300511 0xd0035d 0x44439436
0xf000c010: 0x3001d1b 0x74000 0x33338 0x10000
0xf000c020: 0x4 0x50008 0x0 0xc852
0xf000c030: 0x40 0x746404 0x0 0x0
0xf000c040: 0x0 0x0 0x0 0x0
0xf000c050: 0x0 0x0 0x0 0x2
0xf000c060: 0x0 0x0 0x0 0x0
0xf000c070: 0x0 0x0 0x0 0x0
0xf000c080: 0x0 0x0 0x0 0x0
0xf000c090: 0x0 0x0 0x0 0x0
0xf000c0a0: 0x0 0x0 0x0 0x0
0xf000c0b0: 0x0 0x0 0x1 0x0
0xf000c0c0: 0x0 0x0 0x0 0x0
0xf000c0d0: 0x0 0x0 0x0 0x0
0xf000c0e0: 0x0 0x0 0x0 0x4000
0xf000c0f0: 0x484d5044 0x44524320 0x0 0x20301
0xf000c100: 0x0 0x0 0x4040404 0x3030303
0xf000c110: 0x0 0x1 0x3b03c01 0x0
0xf000c120: 0x0 0x0 0xb00 0xb00
0xf000c130: 0xb00 0xb00 0xc00 0xc00
0xf000c140: 0xc00 0xc00 0xf 0xf
0xf000c150: 0xf 0xf 0xe 0x0
BKP: backup_mode_resume, resuming = 0
Backup mode enabled
AT91Bootstrap 4.0.1-dirty (2021-12-09 14:45:31)
All interrupts redirected to AIC
EEPROM: Loading AT24xx information ...
EEPROM: BoardName | [Revid] | VendorName
EEPROM Buff:
@address: 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xa 0xb 0xc 0xd 0xe 0xf
0x206670: 0x41 0x41 0x54 0x4d 0x45 0x4c 0x2d 0x52 0x46 0x4f 0xe 0x1 0x41 0x43 0x31 0x3e AATMEL-RFO..AC1>
0x206680: 0x0 0x0 0x53 0x41 0x4d 0x41 0x35 0x44 0x32 0x2d 0x58 0x55 0x4c 0x54 0x43 0xac ..SAMA5D2-XULTC.
#0 SAMA5D2-XULT [AC1] ATMEL-RFO
EEPROM: BoardDate | Year | Week
EEPROM: 2014 1
EEPROM: Board sn: 0xd300000 revision: 0x600000
SD/MMC: Image: Read file u-boot.bin to 0x26f00000
MMC: ADMA supported
mmc_verify_operating_condition
SDHC: Timeout waiting for command complete
SD: Card Capacity: High or Extended
sd card identified with CID = 0x27504853 0x44333247 0x60000009 0x60155ff
sdcard_identification success
SD: Specification Version 3.0X
*** FATFS: f_open, filename: [u-boot.bin]: error code 3
SD/MMC: Failed to load image
@ehristev is there a solution to this? Is there a list of approved SD cards that can be found on Amazon, or otherwise?
I am having a similar issue with a couple SD cards on the SAMA5d27-SOM1-EK1. I've downloaded multiple demos from linux4sam.org and the issue persists. I've also went back to look at different versions.
I thought I may have changed the boot fuses, so I bought a new SAMA5d27-SOM1-EK1 to make sure it was a virgin board.
RomBOOT
AT91Bootstrap 4.0.6 (2023-05-05 12:39:18)
SDHC: fix in place for SAMA5D2 SiP VDDSDMMC over-consumption errata
SD/MMC: Image: Read file u-boot.bin to 0x23f00000
MMC: ADMA supported
SDHC: Error: No Card Inserted
*** FATFS: f_open, filename: [u-boot.bin]: error
SD/MMC: Failed to load image
RomBOOT
AT91Bootstrap 3.10.2 (2021-01-15 07:29:56)
SDHC: fix in place for SAMA5D2 SoM VDDSDMMC over-consumption errata
SD/MMC: Image: Read file u-boot.bin to 0x23f00000
MMC: ADMA supported
SDHC: Error: No Card Inserted
*** FATFS: f_open, filename: [u-boot.bin]: error
SD/MMC: Failed to load image
Can you point me to a supported SD card?
the current code has some anomaly that I am investigating and wanted to report. The sd card used is a Kingston canvas select plus 32 GB. After the SW reboot (at the first start-up everything works properly) of the card the SSBL is unable to load the UBoot as it happens in issues such as 44, and 98.
I attach the log obtained as well as the patch applied on this version to obtain the traces as follows.
Thank you in advance for your help @ehristev
https://github.com/linux4sam/at91bootstrap/blob/646977aeace88b04041bf9e4c33d998a5a71ad3e/driver/mci_media.c#L459