2021-04-19 06:01 AM
Hi,
I am trying to debug in engineering mode with the STM32MP157A-DK1 through a external ST-Link V3 but i am not being able to get it to work. I attacht the error gotten, as well as pictures of the connection and the debug configuration in Cube IDE. The image thas shows the debug configuration has the OpenOCD option configured, however i have also tried the GDB option but the board is not even found in this case. Thank you in advance.
Solved! Go to Solution.
2021-04-20 12:22 AM
I'm afraid that not so simple, you can't work without a running Linux on the platform.
There is some mandatory learning curve related to Linux system. Overall, MPUs are more complex to use than STM32 MCUs.
anyway, you could start with with a device tree update form DK2 using CubeIDE (new STM32 project from board DK1), then add the peripherals you need for Cortex-M4 side (as many init are done by Linux, you need to give it the information in the DT).
Then compile/update TF-A/uBoot(FIP)/Kernel device tree by following https://wiki.st.com/stm32mpu/wiki/How_to_compile_the_device_tree_with_the_Developer_Package
Flash the SD-Card with new files as you do for getting started (using CubeProgrammer with USB) .
Then you could use CubeIDE to create/update/debug the M4 FW
Once working, the M4 FW should be placed in the SD-card in a linux folder (e.g. using scp from Linux PC to DK2 Linux connected in 'Ethernet over USB')
Then M4 FW could be started, see https://wiki.st.com/stm32mpu/wiki/Linux_remoteproc_framework_overview#Remote_processor_boot_through_sysfs
Regards.
2021-04-19 06:22 AM
Hi,
I think there is few misunderstandings.
There is an embedded STLINK (STLINK-V2) on STM32MP157A-DK1, to debug using this one, simply connect the PC on USB CN11. No need of an external STLINK-V3.
If you are willing to use a different probe (e.g. external STLINK-V3), you should solder wires on TP2, TP3, TP4...., see schematic page 3. Connection of external probe is more easy on EVAL board (e.g. STM32MP157F-EV1).
Note that embedded STLINK-V2 also provide UART4 console as USB Virtual Comm Port (VCP). This require additional wiring in case external STLINK-V3 is used (not available on external STLINK-V2).
Note: The unpopulated CN12 you are trying to use is the SWD port of the embedded STLINK-V2 itself, used only during board production to flash the initial STLINK FW, then this port is disabled and useless (if needed, STLINK FW update is done thru CubeProgrammer).
Regards.
2021-04-19 10:20 PM
Thank you very much!! i hadnt seen these errors. Great help!
2021-04-19 10:56 PM
Hi again,
I have connected the STLINKV3 through TP2, TP3, TP5 and TP9. The first time the device has been identifed, although the debug has failed to start. After that the error is always the same and i can get it to work. I attach you an image of the error. I have checked the connection and it seems to be ok.
Apart from this, one of the things that i want to test here is to load code to the M4 in engineering mode and see if this code can run once i deattach the debugger, like a normal M4 core, without having flashed linux on the sd. In order to use this core like a traditional M4. Could you help me with this? Thanks again
2021-04-19 11:17 PM
Note that CubeProgrammer with STM32MP15x cannot work with STLINK, but only connect using USB to load the platform flash.
STLINK is only used for debug purposes with e.g. debug Cortex-M4 FW with CubeIDE.
Engineering mode is only used to test and debug (e.g. the Cortex-M4 code), but the platform does not boot from any Flash in that mode.
Cortex-M4 FW is always loaded/started from uBoot or Linux, it cannot be used ad a standalone MCU.
I encourage you read the wiki:
https://wiki.st.com/stm32mpu/wiki/Getting_started
https://wiki.st.com/stm32mpu/wiki/Boot_chain_overview#STM32MP15_boot_chain
https://wiki.st.com/stm32mpu/wiki/STM32CubeProgrammer
Regards.
2021-04-19 11:58 PM
Thank you really much! Really i have tested the STLINK in CUBEIDE and i was having that problem too. The first time it connected but after that the device is not found..i attached the picture with the programmer just in case if it was more clear there, i did not realise that it could not work with the STM32MP15x.
Regarding to the engineering mode, i was afraid of that...The thing is that we have to develop a product now and dont have too much time in order to learn about Linux, device trees, configuration...so the idea was to use the M4 standalone and in a future update migrate part of the code to the A7 once we learn a bit more about all this system
2021-04-20 12:22 AM
I'm afraid that not so simple, you can't work without a running Linux on the platform.
There is some mandatory learning curve related to Linux system. Overall, MPUs are more complex to use than STM32 MCUs.
anyway, you could start with with a device tree update form DK2 using CubeIDE (new STM32 project from board DK1), then add the peripherals you need for Cortex-M4 side (as many init are done by Linux, you need to give it the information in the DT).
Then compile/update TF-A/uBoot(FIP)/Kernel device tree by following https://wiki.st.com/stm32mpu/wiki/How_to_compile_the_device_tree_with_the_Developer_Package
Flash the SD-Card with new files as you do for getting started (using CubeProgrammer with USB) .
Then you could use CubeIDE to create/update/debug the M4 FW
Once working, the M4 FW should be placed in the SD-card in a linux folder (e.g. using scp from Linux PC to DK2 Linux connected in 'Ethernet over USB')
Then M4 FW could be started, see https://wiki.st.com/stm32mpu/wiki/Linux_remoteproc_framework_overview#Remote_processor_boot_through_sysfs
Regards.
2021-04-20 12:57 AM
Understood! We are really really thankful!!
2021-04-21 01:25 AM
To help community to find solutions, please click on "Select as Best" if my reply solved your issue or answered your question.