I am currently doing my first steps on linux to build RIOTos and flash it to a Nucleo STM32WL55JC. If I do the same thing (hello world) with a Nucleo-L476 everything works fine, however if i try it with the Nucleo-WL55JC i receive the following message:
Flashing Target
Open On-Chip Debugger 0.11.0+dev-00748-ga70bab9e5 (2022-06-28-14:36)
Licensed under GNU GPL v2
For bug reports, read …
hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : DEPRECATED target event trace-config; use TPIU events {pre,post}-{enable,disable}
/home/thomas/myRIOT/boards/common/stm32/dist/stm32wl.cfg:4: Error: can’t read “_TARGETNAME”: no such variable
in procedure ‘script’
at file “embedded:startup.tcl”, line 26
at file “/home/thomas/myRIOT/boards/common/stm32/dist/stm32wl.cfg”, line 4
make: *** [/home/thomas/myRIOT/examples/hello-world-wl/…/…/Makefile.include:837: flash] Error 1
if i try to flash the .bin with the stlink-flash i receive the following message:
st-flash write hello-world.bin 0x8000000
st-flash 1.6.0
2022-06-28T15:42:25 WARN usb.c: Couldn’t find any ST-Link/V2 devices
As far as I know the Nucleo-WL55 uses a STLink-V3 is this the cause of my problem?
How to fix this?
lsusb responses with
…
Bus 003 Device 005: ID 0483:374e STMicroelectronics STLINK-V3
Regards Thomas
I’m encountering the same issue doing a board bring-up test A/B with the blinky example between RIOT and Zephyr. I did some digging online. I found recommendations for modifying the TCL of OpenOCD. I’m sure this is solvable, but not in the scope of my current investigation. I gave up for now but may revisit it after I explore other systems.
We solved it - you simply need to use the following command:
make BOARD=nucleo-wl55jc PROGRAMMER=cpy2remed flash
https://doc.riot-os.org/group__boards__nucleo-wl55jc.html
I can’t reproduce the issue with latest master:
~/RIOTstuff/riot-stm32wl55/RIOT/examples/basic/hello-world$ BOARD=nucleo-wl55jc make flash term -j12
Building application "hello-world" for "nucleo-wl55jc" with CPU "stm32".
"make" -C /home/cbuec/RIOTstuff/riot-stm32wl55/RIOT/pkg/cmsis/
...
"make" -C /home/cbuec/RIOTstuff/riot-stm32wl55/RIOT/cpu/stm32/vectors
text data bss dec hex filename
12276 112 2300 14688 3960 /home/cbuec/RIOTstuff/riot-stm32wl55/RIOT/examples/basic/hello-world/bin/nucleo-wl55jc/hello-world.elf
/home/cbuec/RIOTstuff/riot-stm32wl55/RIOT/dist/tools/openocd/openocd.sh flash /home/cbuec/RIOTstuff/riot-stm32wl55/RIOT/examples/basic/hello-world/bin/nucleo-wl55jc/hello-world.elf
### Flashing Target ###
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
srst_only separate srst_nogate srst_open_drain connect_assert_srst
Info : clock speed 500 kHz
Info : STLINK V3J7M3 (API v3) VID:PID 0483:374E
Info : Target voltage: 3.265914
Info : stm32wlx.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for stm32wlx.cpu on 0
Info : Listening on port 44809 for gdb connections
TargetName Type Endian TapName State
-- ------------------ ---------- ------ ------------------ ------------
0* stm32wlx.cpu hla_target little stm32wlx.cpu reset
Info : Unable to match requested speed 500 kHz, using 200 kHz
Info : Unable to match requested speed 500 kHz, using 200 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000758 msp: 0x20000200
Info : device idcode = 0x10036497 (STM32WLEx - Rev 'unknown' : 0x1003)
Info : flash size = 256kbytes
Info : flash mode : single-bank
Info : Padding image section 1 at 0x08003064 with 4 bytes (bank write end alignment)
Warn : Adding extra erase range, 0x08003068 .. 0x080037ff
auto erase enabled
wrote 12392 bytes from file /home/cbuec/RIOTstuff/riot-stm32wl55/RIOT/examples/basic/hello-world/bin/nucleo-wl55jc/hello-world.elf in 1.263333s (9.579 KiB/s)
verified 12388 bytes in 0.649925s (18.614 KiB/s)
Info : Unable to match requested speed 500 kHz, using 200 kHz
Info : Unable to match requested speed 500 kHz, using 200 kHz
shutdown command invoked
Done flashing
/home/cbuec/RIOTstuff/riot-stm32wl55/RIOT/dist/tools/pyterm/pyterm -p "/dev/ttyACM0" -b "115200" -ln "/tmp/pyterm-cbuec" -rn "2025-03-03_23.42.25-hello-world-nucleo-wl55jc"
2025-03-03 23:42:27,296 # Connect to serial port /dev/ttyACM0
Welcome to pyterm!
Type '/exit' to exit.
2025-03-03 23:42:45,015 # main(): This is RIOT! (Version: 2024.04-devel-2140-gcdcab)
2025-03-03 23:42:45,016 # Hello World!
2025-03-03 23:42:45,020 # You are running RIOT on a(n) nucleo-wl55jc board.
2025-03-03 23:42:45,024 # This board features a(n) stm32 CPU.
$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 0483:374e STMicroelectronics STLINK-V3
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
This is with a very old and the latest firmware versions:
Version: V3J7M3
Build: Oct 22 2020 11:30:46
Version: V3J15M7
Build: Jun 14 2024 10:32:08
My system is Ubuntu 22.04 in WSL2 and the ST-Link is forwarded through usbipd.