Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


Breakpoint triggers on bad line number

Hello,
quite often happens that debugger breaks at wrong line number (as can be seen in attachment). Very often this bug occurs when I remove a few lines of code above breakpoints. Is this caused by wrong configuration of IDE or is this a bug and are there any plans to fix this?

I am running Neon.3 Release (4.6.3) with latest SWSTM32 plugin on Win 10 x64.

Thank you!

Hi,

You need to rebuild and restart your debug session if you remove lines of code.
(Because your binary file is no longer aligned with your sources)

Regards,
Elliot

Sure, I can agree with that.
But consider this scenario:
1. remove lines of code above or even containing breakpoint
2. build project and upload it to the MCU
3. breakpoint behaves ‘unexpectedly’
When removing lines with breakpoints it also sometimes happen that the breakpoint is not removed and instead of that it is moved on a ‘random’ line.

The second scenario is posted in attachments. I have closed and reopened Eclipse, run clean & build with no difference. Interesting is also this:

info breakpoints
Num Type Disp Enb Address What

1 breakpoint keep y 0x08002258 in flyhero
MPU6050
Data_Read_Callback() at C:/Users/michp/git/flyhero/IMU (in development)/src/MPU6050.cpp:83 2 breakpoint keep y 0x080029b8 in flyhero
MPU6050
Start_Read_Raw() at C:/Users/michp/git/flyhero/IMU (in development)/src/MPU6050.cpp:445 3 breakpoint keep y 0x08002168 in flyhero
MPU6050
Data_Ready() at C:/Users/michp/git/flyhero/IMU (in development)/src/MPU6050.cpp:63

breakpoint already hit 1 time

Saying that line 63 is in Data_Ready() function. But viewing source file using GDB:

list 60
55 if (ddatai.state != DATA_START_READ) {
56 printf(“error\n”);
57 }
58 if (ddatai.delta > 40 && ddatai.delta > max)
59 max = ddatai.delta;
60 //printf(“%d %d\n”, i, ddatai.delta);
61 }
62
63 printf(“a”);
64 }

Is there anything else I can run to solve this?


Are you sure you are using the debug configuration? If you are using the release configuration with optimizations turned on you can’t debug in C/C++ source level any more.

Sure I am using debug configuration and compiling with these settings:

-mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -std=c++11 -DSTM32F446RETx -DNUCLEO_F446RE -DSTM32F4 -DSTM32 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F446xx -I”C:\Users\michp\git\flyhero\nucleo-f446re_hal_lib” -I”C:\Users\michp\git\flyhero\IMU (in development)/inc” -I”C:\Users\michp\git\flyhero\nucleo-f446re_hal_lib\CMSIS\core” -I”C:\Users\michp\git\flyhero\The_Eye\inc” -I”C:\Users\michp\git\flyhero\LEDs\inc” -I”C:\Users\michp\git\flyhero\nucleo-f446re_hal_lib\CMSIS\device” -I”C:\Users\michp\git\flyhero\nucleo-f446re_hal_lib\HAL_Driver\Inc\Legacy” -I”C:\Users\michp\git\flyhero\nucleo-f446re_hal_lib\HAL_Driver\Inc” -I”C:\Users\michp\git\flyhero\nucleo-f446re_hal_lib\Utilities\STM32F4xx-Nucleo” -O0 -g3 -Wall -fmessage-length=0 -ffunction-sections -c -fno-exceptions -fno-rtti


 

Newest Forum Posts

  1. reservation car service Seattle by Jamesprede, 2025-05-01 10:06
  2. Last day: drone bonus by Danielrug, 2025-04-19 16:55
  3. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  4. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  5. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  6. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  7. Insightful Perspectives on This Subject by davidsycle, 2025-03-04 05:45
  8. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  9. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  10. Build a project in "release" mode by tang, 2025-02-20 10:36

Last-Modified Blogs