2025-02-21 1:09 AM - edited 2025-03-03 12:22 AM
Hi, I am using STM32MP257F-DK microcontroller. I have never used a dual cortex before. All I want to do is to generate a simple STM32CubeIDE project which also has a .ioc file. I want to debug it via CubeIDE.
1) Do I need OpenAmp to successfully flash the code?
2) I have already set up the SDK, are there other settings I need to take care of?
When I try to flash my current project, It always stops at 78% like shown in the picture below.
2025-02-23 6:18 AM
I am a little confused - are you using STM32MP157F-DK or STM32MP257F-DK ? I could provide a sample code + all related setup, but first clear about correct hw. Thanks
2025-03-02 11:10 PM
Hi! Thank you for the reply and sorry for the delay, I was a bit busy with another project.
I am using STM32MP257F-DK, mentioned the wrong one in my post.
It will be really helpful to get the example code.
2025-03-03 5:55 AM - edited 2025-03-03 6:08 AM
Hello fa31,
Could you please check the GDB debugger on the debug Configurations
BTW : could you please share the log .
2025-03-03 6:08 AM - edited 2025-03-03 6:12 AM
My boot switch settings:
Boot 0 = ON
Boot 1 - 3 = OFF
Here are my debug settings:
Then clicking on the "Debug" button gives the following response:
And the following output log is printed to the console:
Open On-Chip Debugger 0.12.0+dev-00600-g090b431b1 (2024-09-13-19:12) [https://github.com/STMicroelectronics/OpenOCD]
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
srst_only srst_pulls_trst srst_gates_jtag srst_open_drain connect_deassert_srst
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : STLINK V3J15M6B5S1 (API v3) VID:PID 0483:3753
Info : Target voltage: 3.265782
Info : Unable to match requested speed 5000 kHz, using 3300 kHz
Info : Unable to match requested speed 5000 kHz, using 3300 kHz
Info : clock speed 3300 kHz
Info : stlink_dap_op_connect(connect)
Info : SWD DPIDR 0x6ba02477
Info : [STM32MP257FAKx.ap0] Examination succeed
Info : [STM32MP257FAKx.m33] Cortex-M33 r1p0 processor detected
Info : [STM32MP257FAKx.m33] target has 8 breakpoints, 4 watchpoints
Info : [STM32MP257FAKx.axi] Examination succeed
Info : gdb port disabled
Info : starting gdb server for STM32MP257FAKx.axi on 3334
Info : Listening on port 3334 for gdb connections
Info : gdb port disabled
Info : gdb port disabled
Info : gdb port disabled
Info : gdb port disabled
Info : starting gdb server for STM32MP257FAKx.m33 on 3333
Info : Listening on port 3333 for gdb connections
Info : gdb port disabled
Info : accepting 'gdb' connection on tcp/3333
Warn : [STM32MP257FAKx.m33] target was in unknown state when halt was requested
Info : [STM32MP257FAKx.m33] external reset detected
Error: timed out while waiting for target halted
Error executing event gdb-attach on target STM32MP257FAKx.m33:
Info : New GDB Connection: 1, Target STM32MP257FAKx.m33, state: reset
Warn : GDB connection 1 on target STM32MP257FAKx.m33 not halted
Info : accepting 'gdb' connection on tcp/3333
Error: timed out while waiting for target halted
Error executing event gdb-attach on target STM32MP257FAKx.m33:
Info : New GDB Connection: 2, Target STM32MP257FAKx.m33, state: reset
Warn : GDB connection 2 on target STM32MP257FAKx.m33 not halted
Error: [STM32MP257FAKx.m33] not halted (add breakpoint)
Error: [STM32MP257FAKx.m33] can't add breakpoint: target running
Error: [STM32MP257FAKx.m33] not halted (add breakpoint)
Error: [STM32MP257FAKx.m33] can't add breakpoint: target running
Info : Halt timed out, wake up GDB.
2025-03-07 6:01 AM - edited 2025-03-07 6:09 AM
Hei,
Maybe this is happening due to signing problems.
The example project, OpenAMP_TTY_echo, runs successfully. And it had the following post build command:
arm-none-eabi-objcopy -S ${BuildArtifactFileBaseName}.elf ${BuildArtifactFileBaseName}_stripped.elf; python ../../../../../../../../../Utilities/optee_os/scripts/sign_rproc_fw.py --in ${BuildArtifactFileBaseName}_stripped.elf --out ${BuildArtifactFileBaseName}_sign.bin --key ../../../../../../../../../Utilities/optee_os/keys/default.pem --plat-tlv BOOTADDR 0x80100000
The post build command setting is located here:
right click on the "OpenAMP_TTY_echo_CM33_NonSecure (in NonSecure)" project -> properties -> C/C++ Build -> Settings -> Build Steps -> Post-build steps
This confirms that the project needs to be signed. So I did the same to my project. It builds successfully and generates a signed binary which I can then run on the STM32MP257F-DK. But running the generated signed bin file gives the following error:
root@stm32mp2-e3-aa-a4:~# [ 1280.820447] remoteproc remoteproc0: powering up m33
[ 1280.825511] remoteproc remoteproc0: Booting fw image STM32MP257F-DK_CM33_sign.bin, size 25172
[ 1280.82E/TC:0 stm32_iac_itr:192 IAC exceptions [159:128]: 0x10000000
*E/TC:1 stm32_serc_handle_ilac:133 SERC exceptions [63:32]: 0x8000000
*E/TC:0 stm32_iac_itr:197 IAC exception ID: 156
*E/TC:1 stm32_serc_handle_ilac:139 SERC exception ID: 59
*E/TC:0 Panic at /usr/src/debug/optee-os-stm32mp/4.0.0-stm32mp-r1/core/drivers/firewall/stm32_iac.c:212 <stm32_iac_itr>
E/TC:0 TEE load address @ 0x82000000
E/TC:0 Call stack:
E/TC:0 0x82007ed8
E/TC:0 0x82041b44
E/TC:0 0x8202c2c0
E/TC:0 0x8203f678
E/TC:0 0x82013cf4
I/TC: Halting CPU 1
I need help to find the right way to sign the binaries, the correct keys to use and the correct entry point address and other needed settings.