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


Debug works, Run does not


My project compiles perfectly, and can be debugged without any problem. But when I press “Run”, it doesn’t. It did before, but now it doesn’t run anymore and it already kept me busy since 2 days now. Grrr.....

I can see that the pc jumps to a wrong position (pc: 0x20000046, instead of pc: 0x08000668 as you can see higher.) Does anyone have a clue?

Console runs upto here, and then just nothing happens anymore:


Info : Target voltage: 3.206287
Info : STM32F405RGTx.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
adapter speed: 1800 kHz
STM32F405RGTx.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000668 msp: 0x20020000
configuring PLL

    • Programming Started **

auto erase enabled
Info : device id = 0x10076413
Info : flash size = 1024kbytes
STM32F405RGTx.cpu: target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x20000046 msp: 0x20020000
wrote 16384 bytes from file Debug/Formanta5.elf in 1.137999s (14.060 KiB/s)

    • Programming Finished **
    • Verify Started **

STM32F405RGTx.cpu: target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x2000002e msp: 0x20020000
verified 2454 bytes in 0.375114s (6.389 KiB/s)

    • Verified OK **
    • Resetting Target **

Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
adapter speed: 1800 kHz
shutdown command invoked

I forgot to mention this:
I’m working SW4STM32 v1.13.1 under Linux, and I’m programming in assembler.


Got it!

The processor was not refusing to startup, it actually did run!

I didn’t “startup” the SPI2 (audio output) by giving it a first value (SPI2->DR = 0x00). So the program got stuck waiting forever for the interrupt caused by completion of the data send operation. And there’s no way to detect that when in Run mode, as there’s no “pause” to go check what’s happening. I had to do some “led debugging”: changing a led value, and then moving this step by step further into the code. Until the led change didn’t happen anymore, meaning that the program got stuck just before.

No idea why it did startup in Debug mode however... Very strange!

I’m getting more and more the idea that STM32 is absolutely not suited for assembler programming...


 

Newest Forum Posts

  1. Монтаж камина с грилем в Москве - установка и барбекю by KpddomErorb, 2025-05-10 18:28
  2. SPI on Nucleo_STMH533RE by royjamil, 2025-05-04 20:13
  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. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  8. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  9. Build a project in "release" mode by tang, 2025-02-20 10:36
  10. Build a project in "release" mode by info@creosrl.it, 2025-02-19 17:35

Last-Modified Blogs