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


Fail Debug with STM32479I-EVAL

Hi,

I’m trying to start with STM32479I-Eval Board (STM32F479NIH6U micro).

I have installed in my Windows 10:

  • STSW-LINK009 -> ST-LINK, ST-LINK/V2, ST-LINK/V2-1 USB driver signed for Windows10
  • STSW-LINK007 -> ST-LINK, ST-LINK/V2, ST-LINK/V2-1 firmware upgrade (and Update ST-LINK/V2, ST-LINK/V2-1 devices)
  • STSW-LINK004 -> STM32 ST-LINK utility

  • STM32CubeMX

  • System Workbench for STM32 (and Check for Updates)



With STM32 ST-LINK utility I can connect, erase and program STM32479I-Eval Board, but when i try to use System Workbench for STM32 I can’t debug the code.

I tried to create a New Project for STM32479I-Eval Board; this time, the Build Process ends without errors but when I launch the Ac6 STM32 Debugging I got the following:


Open On-Chip Debugger 0.10.0-dev-00274-g2ee83e0-dirty (2017-01-26-11:59)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
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
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
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Info : STLINK v2 JTAG v28 API v2 M v18 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 3.251715
Info : STM32F479.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting ‘gdb’ connection on tcp/3333
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
STM32F479.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 00000000 pc: 0x0f00f1b8 msp: 0x8000f8d0
configuring PLL
Info : device id = 0x10006434
Info : flash size = 2048kbytes
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
STM32F479.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 00000000 pc: 0x0f00f1b8 msp: 0x8000f8d0
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
STM32F479.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 00000000 pc: 0x0f00f1b8 msp: 0x8000f8d0
configuring PLL
Error: timed out while waiting for target halted
STM32F479.cpu: target state: halted
target halted due to debug-request, current mode: Handler HardFault
xPSR: 0x01000003 pc: 0xd0f74546 msp: 0x8000f8b0
Error: error waiting for target flash write algorithm
Error: error writing to flash at address 0x08000000 at offset 0x00000000

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
STM32F479.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 00000000 pc: 0x0f00f1b8 msp: 0x8000f8d0




If I create a Custom Board with the STM32F479NIHx micro and the STLinkV2-1 the result is the same (just in case STM32479I-Eval Board have any bug)

I have other Customs Boards, one of them based in a STM32F103RC micro


Open On-Chip Debugger 0.10.0-dev-00274-g2ee83e0-dirty (2017-01-26-11:59)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 1000 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 1000 kHz, using 950 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : clock speed 950 kHz
Info : STLINK v2 JTAG v28 API v2 SWIM v7 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 3.233751
Info : STM32F103RGTx.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting ‘gdb’ connection on tcp/3333
STM32F103RGTx.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000360 msp: 0x20018000
Info : device id = 0x10006430
Info : flash size = 512kbytes
Info : device id = 0x10006430
Info : flash size = 512kbytes
STM32F103RGTx.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000360 msp: 0x20018000
STM32F103RGTx.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000360 msp: 0x20018000
STM32F103RGTx.cpu: target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x2000003a msp: 0x20018000
STM32F103RGTx.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000360 msp: 0x20018000



and the other based in a STM32L471RE micro. When using this two Boards I don´t have any problem: I connect a STLink/V2 JTAG and I can Debug the code.


Open On-Chip Debugger 0.10.0-dev-00274-g2ee83e0-dirty (2017-01-26-11:59)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
padded zone erase set to 1
adapter_nsrst_delay: 100
srst_only separate srst_nogate srst_open_drain connect_assert_srst
adapter speed: 1800 kHz
srst_only separate srst_nogate srst_open_drain connect_assert_srst
Info : clock speed 1800 kHz
Info : STLINK v2 JTAG v28 API v2 SWIM v7 VID 0x0483 PID 0x3748
Info : using stlink api v2
Info : Target voltage: 2.948256
Info : STM32L471RETx.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting ‘gdb’ connection on tcp/3333
adapter speed: 240 kHz
STM32L471RETx.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080052d0 msp: 0x20018000
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
adapter speed: 4000 kHz
Info : Device id = 0x10076415
Info : STM32L4xx flash size is 512kb, base address is 0x8000000
adapter speed: 240 kHz
STM32L471RETx.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080052d0 msp: 0x20018000
adapter speed: 240 kHz
STM32L471RETx.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080052d0 msp: 0x20018000
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
adapter speed: 4000 kHz
STM32L471RETx.cpu: target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x21000000 pc: 0x20000068 msp: 0x20018000
adapter speed: 240 kHz
STM32L471RETx.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080006e0 msp: 0x20018000



Also, I have a STM32L476 Discovery Board and i can Debug but there are an error in OpenOCD Log


Open On-Chip Debugger 0.10.0-dev-00274-g2ee83e0-dirty (2017-01-26-11:59)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
padded zone erase set to 1
adapter_nsrst_delay: 100
srst_only separate srst_nogate srst_open_drain connect_assert_srst
adapter speed: 1800 kHz
Info : clock speed 1800 kHz
Info : STLINK v2 JTAG v28 API v2 M v18 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 54.519401
Info : STM32L476.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting ‘gdb’ connection on tcp/3333
adapter speed: 240 kHz
STM32L476.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080009e8 msp: 0x20018000
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
adapter speed: 4000 kHz
Info : Device id = 0x10076415
Info : STM32L4xx flash size is 1024kb, base address is 0x8000000
adapter speed: 240 kHz
STM32L476.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080009e8 msp: 0x20018000
adapter speed: 240 kHz
STM32L476.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080009e8 msp: 0x20018000
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
adapter speed: 4000 kHz
STM32L476.cpu: target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x21000000 pc: 0x20000068 msp: 0x20018000
adapter speed: 240 kHz
STM32L476.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080009e8 msp: 0x20018000




Could there be a problem with STLinkV2-1 or SWD interface with STM32F479NIH???
I use STLinkV2 with the other custom boards in JTAG interface. And the STM32L476 Discovery Board have ST/LinkV2-1 in SWD interface



Any idea how to fix this?


Thanks in advance,

Sergio



EDITED: Added More Info