2025-05-17 11:34 AM
Hello,
I am trying to use the DDR test suite from Cube IDE with a custom board based on the STM32MP257FAI3 with 32Gb of LPDDR4 (MT53E1G32D2FW-046 WT:B). The board doesn't have engineering boot available, but it does have USB/UART boot, so I have been attempting to use SYSRAM Loading in the DDR Test Suite. However I have been getting "This Port Com Is Not Responding" errors when trying to connect.
The steps I have taken are as follows:
1. Clone DDRFW-UTIL and edit `DDR_Tool/STM32MP257F-EV1/Inc/stm32mp_util_conf.h` to change the UART and PMIC settings:
/* UART related configuration */
#define UTIL_UART_INSTANCE UTIL_UART9
#define UTIL_UART_TX_PIN UTIL_PIN13
#define UTIL_UART_TX_GPIO_PORT UTIL_GPIOD
#define UTIL_UART_TX_AF GPIO_AF6_UART9
#define UTIL_UART_RX_PIN UTIL_PIN14
#define UTIL_UART_RX_GPIO_PORT UTIL_GPIOB
#define UTIL_UART_RX_AF GPIO_AF6_UART9
#define UTIL_UART_BAUDRATE 115200
#define UTIL_UART_WORDLENGTH UART_WORDLENGTH_8B
#define UTIL_UART_STOPBITS UART_STOPBITS_1
#define UTIL_UART_PARITY UART_PARITY_NONE
#define UTIL_UART_HWFLOWCTL UART_HWCONTROL_NONE
/* PMIC related configuration */
#define UTIL_USE_PMIC 1
#define UTIL_PMIC_I2C_PORT UTIL_I2C3
#define UTIL_PMIC_I2C_SCL_PIN UTIL_PIN12
#define UTIL_PMIC_I2C_SCL_GPIO_PORT UTIL_GPIOC
#define UTIL_PMIC_I2C_SCL_AF GPIO_AF9_I2C3
#define UTIL_PMIC_I2C_SDA_PIN UTIL_PIN0
#define UTIL_PMIC_I2C_SDA_GPIO_PORT UTIL_GPIOG
#define UTIL_PMIC_I2C_SDA_AF GPIO_AF9_I2C3
#define UTIL_PMIC_INT_PIN UTIL_PIN6
#define UTIL_PMIC_INT_GPIO_PORT UTIL_GPIOI
I then also change `Drivers/BSP/STM32MP257F-EV1/stm32mp257f_eval_pmic.c` and `.h` to use the correct power settings for LPDDR4. Finally I change `DDR_Tool/STM32MP257F-EV1/STM32MP257F-EV1_DDR_UTILITIES_A35/.cproject` to set STM32MP_LPDDR4_TYPE=1 and STM32MP_DDR4_TYPE=0.
2. Compile the project which outputs 3 files with the .stm32 extension:
18:11:07 **** Incremental Build of configuration EV1 for project STM32MP257F-EV1_DDR_UTILITIES_A35 ****
make -j16 all
aarch64-none-elf-gcc -o "STM32MP257F-EV1_DDR_UTILITIES_A35.elf" @"objects.list" -mcpu=cortex-a35 -mtune=cortex-a35 -g3 -O0 -mstrict-align -Wl,--gc-sections -static -lc -lnosys -T"../LinkerScriptaa64_sysram_a35_phy_fw_sram1.ld" -L../../../ -Wl,-Map="STM32MP257F-EV1_DDR_UTILITIES_A35.map"
Finished building target: STM32MP257F-EV1_DDR_UTILITIES_A35.elf
aarch64-none-elf-size STM32MP257F-EV1_DDR_UTILITIES_A35.elf
aarch64-none-elf-objdump -h -S STM32MP257F-EV1_DDR_UTILITIES_A35.elf > "STM32MP257F-EV1_DDR_UTILITIES_A35.list"
aarch64-none-elf-objcopy -O binary STM32MP257F-EV1_DDR_UTILITIES_A35.elf "STM32MP257F-EV1_DDR_UTILITIES_A35.bin"
text data bss dec hex filename
186411 40364 5512 232287 38b5f STM32MP257F-EV1_DDR_UTILITIES_A35.elf
Finished building: default.size.stdout
Finished building: STM32MP257F-EV1_DDR_UTILITIES_A35.bin
Finished building: STM32MP257F-EV1_DDR_UTILITIES_A35.list
../../../../Scripts/imageheader/postbuild_STM32MP2.sh "C:\ST\gcc-arm-9.2-2019.12-mingw-w64-i686-aarch64-none-elf\bin" "STM32MP257F-EV1_DDR_UTILITIES_A35" -c "8-A" -v "2.2"
header_version = 2.2
cpu_name = 8-A
Postbuild with windows executable
Sat May 17 18:11:12 2025
Input file : STM32MP257F-EV1_DDR_UTILITIES_A35_pb_el3lnch.bin
Output file : STM32MP257F-EV1_DDR_UTILITIES_A35.stm32
| Magic number | @0x00 0 | sz 4 | 53 54 4D 32
| Image Signature | @0x04 4 | sz 64 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...
| Image Checksum | @0x44 68 | sz 4 | 72 73 3A 01
| Header version | @0x48 72 | sz 4 | 00 02 02 00
| Image Length | @0x4c 76 | sz 4 | B8 B0 03 00
| Image Entry Point | @0x50 80 | sz 4 | 00 30 00 0E
| Reserved1 | @0x54 84 | sz 4 | 00 00 00 00
| Load address | @0x58 88 | sz 4 | 00 00 00 00
| Reserved2 | @0x5c 92 | sz 4 | 00 00 00 00
| Version Number | @0x60 96 | sz 4 | 00 00 00 00
| Extension flags | @0x64 100 | sz 4 | 00 00 00 80
| Post headers length | @0x68 104 | sz 4 | 80 01 00 00
| Binary type | @0x6c 108 | sz 4 | 00 00 00 00
| PAD | @0x70 112 | sz 16 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
| Extension header type | @0x80 128 | sz 4 | 53 54 FF FF
| Extension header length | @0x84 132 | sz 4 | 80 01 00 00
| Extension PAD | @0x88 136 | sz 376 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...
Image Type : ST Microelectronics STM32 V2.2
Image Size : 241848 bytes
Image Load : 0x00000000
Entry Point : 0x0E003000
Checksum : 0x013A7372
Ext flag : 0x80000000
Binary Type : 0x00000000
Version : 0x00000000
STM32MP257F-EV1_DDR_UTILITIES_A35.stm32 generated
Sat May 17 18:11:12 2025
Input file : STM32MP257F-EV1_DDR_UTILITIES_A35.bin
Output file : STM32MP257F-EV1_DDR_UTILITIES_A35_nopad_no_el3lnch.stm32
| Magic number | @0x00 0 | sz 4 | 53 54 4D 32
| Image Signature | @0x04 4 | sz 64 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...
| Image Checksum | @0x44 68 | sz 4 | 25 D4 2E 01
| Header version | @0x48 72 | sz 4 | 00 02 02 00
| Image Length | @0x4c 76 | sz 4 | B8 76 03 00
| Image Entry Point | @0x50 80 | sz 4 | 00 30 00 0E
| Reserved1 | @0x54 84 | sz 4 | 00 00 00 00
| Load address | @0x58 88 | sz 4 | 00 26 00 0E
| Reserved2 | @0x5c 92 | sz 4 | 00 00 00 00
| Version Number | @0x60 96 | sz 4 | 00 00 00 00
| Extension flags | @0x64 100 | sz 4 | 00 00 00 80
| Post headers length | @0x68 104 | sz 4 | 80 01 00 00
| Binary type | @0x6c 108 | sz 4 | 00 00 00 00
| PAD | @0x70 112 | sz 16 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
| Extension header type | @0x80 128 | sz 4 | 53 54 FF FF
| Extension header length | @0x84 132 | sz 4 | 80 01 00 00
| Extension PAD | @0x88 136 | sz 376 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...
Image Type : ST Microelectronics STM32 V2.2
Image Size : 227000 bytes
Image Load : 0x0E002600
Entry Point : 0x0E003000
Checksum : 0x012ED425
Ext flag : 0x80000000
Binary Type : 0x00000000
Version : 0x00000000
STM32MP257F-EV1_DDR_UTILITIES_A35_nopad_no_el3lnch.stm32 generated
Sat May 17 18:11:12 2025
Input file : STM32MP257F-EV1_DDR_UTILITIES_A35_pb_no_el3lnch.bin
Output file : STM32MP257F-EV1_DDR_UTILITIES_A35_no_el3lnch.stm32
| Magic number | @0x00 0 | sz 4 | 53 54 4D 32
| Image Signature | @0x04 4 | sz 64 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...
| Image Checksum | @0x44 68 | sz 4 | 25 D4 2E 01
| Header version | @0x48 72 | sz 4 | 00 02 02 00
| Image Length | @0x4c 76 | sz 4 | B8 B0 03 00
| Image Entry Point | @0x50 80 | sz 4 | 00 30 00 0E
| Reserved1 | @0x54 84 | sz 4 | 00 00 00 00
| Load address | @0x58 88 | sz 4 | 00 00 00 00
| Reserved2 | @0x5c 92 | sz 4 | 00 00 00 00
| Version Number | @0x60 96 | sz 4 | 00 00 00 00
| Extension flags | @0x64 100 | sz 4 | 00 00 00 80
| Post headers length | @0x68 104 | sz 4 | 80 01 00 00
| Binary type | @0x6c 108 | sz 4 | 00 00 00 00
| PAD | @0x70 112 | sz 16 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
| Extension header type | @0x80 128 | sz 4 | 53 54 FF FF
| Extension header length | @0x84 132 | sz 4 | 80 01 00 00
| Extension PAD | @0x88 136 | sz 376 | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...
Image Type : ST Microelectronics STM32 V2.2
Image Size : 241848 bytes
Image Load : 0x00000000
Entry Point : 0x0E003000
Checksum : 0x012ED425
Ext flag : 0x80000000
Binary Type : 0x00000000
Version : 0x00000000
STM32MP257F-EV1_DDR_UTILITIES_A35_no_el3lnch.stm32 generated
STM32MP257F-EV1_DDR_UTILITIES_A35.elf stm32 image header and EL3 launcher added. Output file: STM32MP257F-EV1_DDR_UTILITIES_A35.stm32
STM32MP257F-EV1_DDR_UTILITIES_A35.elf stm32 image header added. Output file: STM32MP257F-EV1_DDR_UTILITIES_A35_no_el3lnch.stm32
3. Create a Cube IDE project for the board with all the correct options set for peripherals and clocks.
4. Go to Tools > DDR Test Suite and configure the options for USB upload, and with one of the .stm32 files generated in step 2.
5. At this point I set the board so all the boot pins are low and reset it. Device manager shows both the STLINK V3MINIE's UART connection (COM4) and the USB connection to the STM32MP2:
6. I then press connect and a progress bar appears. Once the progress bar gets to 100% it disapears and an error message pops up:
Any idea how to fix this? It seems similar to this other post about SYSRAM loading on an STM32MP157F-DK2.
I have also tried using UART rather than USB and that has exactly the same error.
Thanks a lot!
PS: If anyone comes across an error with something about "Sector[0]" after uploading, then its possible the DDRFW-UTIL postprocessing script broke due to spaces in the toolchain path. In my case the toolchain was in "C:\Program Files\".
2025-05-17 11:46 AM
I just tried the "STM32MP257F-EV1_DDR_UTILITIES_A35_nopad_no_el3lnch.stm32" file and this time it finished uploading, then briefly flashed something in the Target Information window, then gave a new error message:
Same results with USB and UART...