elmot / clion-embedded-arm

OpenOCD + STM32CubeMX support for CLion
https://blog.jetbrains.com/clion/2017/12/clion-for-embedded-development-part-ii
Other
170 stars 29 forks source link

Feature Request: Pass gdb user arguments #92

Closed kiciek closed 5 years ago

kiciek commented 6 years ago

I couldn't find a way to pass gdb arguments like pointing init scripts "---command=semihost.gdb" or any other way to tell gdb to run "monitor arm semihosting enable" at start. I cannot write arguments in Settings->OprnOCD Support->GDB Location and I see no field for them.

elmot commented 6 years ago

Unfortunately there is no such a place for the moment. As a workaround, try to use your own OpenOCD board file and add arm semihosting enable there

elmot commented 6 years ago

First of all, the feature is really nice, and I am missing it also.

At the same time it looks like CLion issue rather than my plugin issue, and I am not going to compete with them. There is an issue already https://youtrack.jetbrains.com/issue/CPP-7322

If somebody needs the feature, please try a workaround with CMake variable CMAKE_C_FLAGS_DEBUG similar as shown here

nicknolt commented 6 years ago

Hi, i'm interested to have an example of cfg file modified. By example in the nucleo f4 cfg file where to add the semihosting command? :

source [find interface/stlink-v2-1.cfg]
transport select hla_swd
source [find target/stm32f4x.cfg]
reset_config srst_only

Thank you!

elmot commented 5 years ago

My working example for F3-Discovery

# This is an STM32F3 discovery board with a single STM32F303VCT6 chip.
# http://www.st.com/internet/evalboard/product/254044.jsp

source [find interface/stlink.cfg]

transport select hla_swd

source [find target/stm32f3x.cfg]

reset_config srst_only
init
arm semihosting enable

Now semihosting output is visible in openocd window

nicknolt commented 5 years ago

Thanks! I will try this workaround tuesday.

elmot commented 5 years ago

Duplicate of https://youtrack.jetbrains.com/issue/CPP-9541