Re: Issue when debugging STM32 board with zephyr openocd

Erwan Gouriou

Hi Felipe,

Thanks for this answer.
I did not build with specific optimization flag, I did not enable symbol generation neither.

Steps to reproduce are as follows:
$make BOARD=nucleo_f4... debug
>>b function
after few steps I end up in unexpected function

Using mainline openocd, with same .elf and same sequence, gdb runs as expected.


On 17 February 2017 at 16:45, Felipe Neves <ryukokki.felipe@...> wrote:
Hi Erwan,

Did you build the zephyr project with some optimization flags? such -Os?
Also, in menu config during kernel configuration phase, have you enabled the debug symbol generation?

Also, you need to tell your gdb instance to break in main, for exemple after start the openocd and gdb issue load command to halt microcontroller and flash the firmware
then before start the debug, set a break command on main function, then issue run command, It should work properly.

If you have further question I'll happy to help you :)



2017-02-17 12:48 GMT-02:00 Erwan Gouriou <erwan.gouriou@...>:

I've faced an issue when trying to debug using zephyr openocd ("make BOARD=... debug").
Problem happens in step by step debug where I suddenly jump in an unrelated function.

I don't face such behavior using mainline openocd.

Has someone already observed this behavior ?
I'll raise an issue but I'd like to know if this is specific to ARM or STM32 or..


Zephyr-users mailing list

Felipe S. Neves 
Embedded software & systems engineer
Skype: fneves1989

Join { to automatically receive all group messages.