2024-07-30 04:31 AM
Hello,
I am trying to boot a Hi-Speed USB Device application using the STM32MP135F-DK by loading it from an SD card to DDR3, but it is not working. To investigate the issue, I am trying to boot CDC_Standalone that is included in STM32Cube_FW_MP13_V1.1.0 by loading it from an SD card to DDR3, but it is not going well too. I am following the procedure as below.
After following the procedure, the blue LED lights up momentarily and turns off immediately. After that, the light remains off. ROM code execution and FSBL execution seems to succeeded.
Reference: How to diagnose a boot failure
Even after adding code to CDC_Standalone to turn on the blue LED, the blue LED remains off, so it looks that CDC_Standalone is not booting at all.
--
I am investigating the issue and found some feature.
typedef struct _Device_cb
{
uint8_t (*Init)(struct _USBD_HandleTypeDef *pdev, uint8_t cfgidx);
uint8_t (*DeInit)(struct _USBD_HandleTypeDef *pdev, uint8_t cfgidx);
/* Control Endpoints*/
uint8_t (*Setup)(struct _USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req);
uint8_t (*EP0_TxSent)(struct _USBD_HandleTypeDef *pdev);
uint8_t (*EP0_RxReady)(struct _USBD_HandleTypeDef *pdev);
/* Class Specific Endpoints*/
uint8_t (*DataIn)(struct _USBD_HandleTypeDef *pdev, uint8_t epnum);
uint8_t (*DataOut)(struct _USBD_HandleTypeDef *pdev, uint8_t epnum);
uint8_t (*SOF)(struct _USBD_HandleTypeDef *pdev);
uint8_t (*IsoINIncomplete)(struct _USBD_HandleTypeDef *pdev, uint8_t epnum);
uint8_t (*IsoOUTIncomplete)(struct _USBD_HandleTypeDef *pdev, uint8_t epnum);
uint8_t *(*GetHSConfigDescriptor)(uint16_t *length);
uint8_t *(*GetFSConfigDescriptor)(uint16_t *length);
uint8_t *(*GetOtherSpeedConfigDescriptor)(uint16_t *length);
uint8_t *(*GetDeviceQualifierDescriptor)(uint16_t *length);
// uint32_t dummy[50]; // Cannot boot from SD card.
uint32_t dummy[51]; // Can boot from SD card.
} USBD_ClassTypeDef;
.data . : {
RW_DATA = .;
*(.data*)
__DATA_END__ = .;
} >RAM
.igot.plt : {
*(.igot.plt*)
/* Cannot boot from SD card */
/* . += 0xc8; */
/* Can boot from SD card */
. += 0xcc;
} >RAM
/*
* The .bss section gets initialised to 0 at runtime.
* Its base address must be 16-byte aligned.
*/
.bss : ALIGN(32) {
ZI_DATA = .;
*(SORT_BY_ALIGNMENT(.bss*))
*(COMMON)
. = ALIGN(32);
__BSS_END__ = .;
} >RAM
I could boot my Hi-Speed USB Device application by the same way, but I would like to know what is the correct way to boot CDC_Standalone from SD card.
--
I am attaching two map files for reference.
Best regards,
Solved! Go to Solution.
2024-07-31 04:55 AM
Hello,
I solved it myself.
I checked my SD_Ext_Loader and was old one in STM32Cube_FW_MP13_V1.0.0. I updated SD_Ext_Loader to the latest one in STM32Cube_FW_MP13_V1.1.0. As a result, CDC_Standalone and my USB Device application both boot from SD card without any padding.
Thank you,
2024-07-30 05:18 AM
Hello,
The following code is more simple changes of linker script that the CDC_Standalone application can boot from SD card. The application can boot even if the padding is before RW_DATA or after RW_DATA or before __DATA_END__.
.data . : {
RW_DATA = .;
*(.data*)
__DATA_END__ = .;
/* Dummy padding */
. += 0xcc;
} >RAM
Best regards,
2024-07-31 04:55 AM
Hello,
I solved it myself.
I checked my SD_Ext_Loader and was old one in STM32Cube_FW_MP13_V1.0.0. I updated SD_Ext_Loader to the latest one in STM32Cube_FW_MP13_V1.1.0. As a result, CDC_Standalone and my USB Device application both boot from SD card without any padding.
Thank you,