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


Debugging with printf, openocd and semihosting on Workbench for STM32

Hello. I’m a newbie. I have linux machine, stm32f4 discovery board, eclipse with fresh installed workbench, clean project with default configQuestion and some duck tape.

What should I do to make ocd printing printf() data in IDE console? Like this:

http://gnuarmeclipse.github.io/assets/images/2013/12/OpenOCDclientConsole.pngQuestion
http://gnuarmeclipse.github.io/assets/images/2013/12/OpenOCDTraceConsole.pngQuestion

I tried thisQuestion richardtomkins solution, but it looks like blackbox and conflicts with default libs.

Tunisia
When using -specs=rdimon ... make sure to not use -specs=nosys.specs

Without “-specs=nosys.specs” same conflicts:

/../src/syscalls.c:80: multiple definition of `_kill’
/usr/lib/eclipse/plugins/fr.ac6.mcu.externaltools.arm-none.linux64_1.3.0.201507241112/tools/compiler/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/armv7e-m/fpu/librdimon_nano.a(rdimon-_kill.o):_kill.c:(.text._kill+0x0): first defined here

same error for _exit, _close and other


Tunisia

remove your syscalls.c from your project ;)

Edit: syscalls.c is needed when you are not using nor nosys.specs neither rdimon.specs

syscal removed, stdio.h included, project builds perfectly but printf() does nothing.

Here is program (running in Debug mode through Step Into steps):

  1. include “stm32f4xx.h”
  2. include “stdio.h”


int main(void)
{
printf(“hello world!”);

while (1) {

}
}

Here is opeocd log:

Open On-Chip Debugger 0.9.0-dev-dirty (2015-11-13-11:40)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.htmlQuestion
Info : auto-selecting first available session transport “hla_swd”. To override use ‘transport select ‘.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
srst_only separate srst_nogate srst_open_drain connect_assert_srst
srst_only separate srst_nogate srst_open_drain connect_assert_srst
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Info : STLINK v2 JTAG v14 API v2 SWIM v0 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 2.926655
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting ‘gdb’ connection on tcp/3333
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080005bc msp: 0x20020000
configuring PLL
Info : device id = 0x10016413
Info : flash size = 1024kbytes
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080005bc msp: 0x20020000
semihosting is enabled
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080005bc msp: 0x20020000, semihosting
configuring PLL
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x20000042 msp: 0x20020000, semihosting
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0800057c msp: 0x20020000, semihosting
Info : halted: PC: 0x08000506
Info : halted: PC: 0x08000818
Info : halted: PC: 0x0800050a
Info : halted: PC: 0x0800050a
Info : halted: PC: 0x0800050a
Info : halted: PC: 0x0800050a


PS. So strange choice for this forum engine. meh.


Tunisia

You need to call “initialise_monitor_handles();” in the beginning of your main ;)
just like richardtomkins solution :-)


 

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