zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.49k stars 6.42k forks source link

Add STM32 GDB Server to west debug #77848

Open glenn-andrews opened 2 weeks ago

glenn-andrews commented 2 weeks ago

Is your enhancement proposal related to a problem? Please describe. Currently ST products use OpenOCD or J-Link as runners for west debug. https://github.com/zephyrproject-rtos/zephyr/pull/75284 proposes setting the default west flash runner for STM32 parts to the STM32CubeProg utility. west debug does not allow use of the corresponding ST GDB server available in the STM32CubeCLT command line tools package.

I feel it would be an advantage for users to only have to download a single set of tools than have to have ST for flashing and OpenOCD/J-Link for debugging.

Describe the solution you'd like west debug to support the STM32CubeCLT GDB server

Describe alternatives you've considered Keeping with OpenOCD for debug - does not support latest STM32 parts

Additional context STM32 GDB server is available in the STM32CubeCLT package downloadable here: https://www.st.com/en/development-tools/stm32cubeclt.html

I'm not keen on requiring an ST account or valid email address to download it, but if we approve https://github.com/zephyrproject-rtos/zephyr/pull/75284 then you'll need one for the default flash runner.

JarmouniA commented 2 weeks ago

but does not allow use of the STM32 GDB server

@glenn-andrews I don't think this is accurate, the changes in #75284 won't affect west debug behavior which defaults to OpenOCD or JLink depending on which is included first in board.cmake.

JarmouniA commented 2 weeks ago

@glenn-andrews The title should be "Add ST-LINK GDB Server to west debug" since STM32CubeCLT is just a software bundle that contains many things.

JarmouniA commented 2 weeks ago

For more info about ST-LINK GDB server: https://www.st.com/resource/en/user_manual/um2576-stm32cubeide-stlink-gdb-server-stmicroelectronics.pdf

glenn-andrews commented 2 weeks ago

but does not allow use of the STM32 GDB server

@glenn-andrews I don't think this is accurate, the changes in #75284 won't affect west debug behavior which defaults to OpenOCD or JLink depending on which is included first in board.cmake.

You're correct, I meant to say that we can't use the corresponding STM32 GDB because it is not supported. I'll fix it when I'm home and not trying to edit it on the phone.

JarmouniA commented 2 weeks ago

75284 proposes changing the default STM32 west flash runner from OpenOCD to the STM32CubeProg utility

@glenn-andrews Actually OpenOCD wasn't default, the selection of the runner to be used with west flash was really arbitrary & depended on which runner is mentioned first in board.cmake of each board, as explained in the PR, it could be pyOCD, STM32CubeProg, OpenOCD or JLink....

glenn-andrews commented 2 weeks ago

75284 proposes changing the default STM32 west flash runner from OpenOCD to the STM32CubeProg utility

@glenn-andrews Actually OpenOCD wasn't default, the selection of the runner to be used with west flash was really arbitrary & depended on which runner is mentioned first in board.cmake of each board, as explained in the PR, it could be pyOCD, STM32CubeProg, OpenOCD or JLink....

Better?