I’m struggling to get up and running with my NUCLEO WB15CC. The WB15CC isn’t available in PlatformIO, but I believe the pinout is the same as the NUCLEO WB55RG, which is available. I’m getting an OpenOCD upload error which I will post below.
Could it be this issue? I can’t figure out how to access the board configuration .json file on Mac to check if it is the updated file described here or the old version. I did set up platformIO recently so would think it would be the most updated version.
Just trying to run the blinky example.
Thanks in advance!
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/nucleo_wb55rg_p.html
PLATFORM: ST STM32 (15.4.1+sha.76958b4) > P-Nucleo WB55RG
HARDWARE: STM32WB55RG 64MHz, 192KB RAM, 512KB Flash
DEBUG: Current (stlink) On-board (stlink) External (blackmagic, cmsis-dap, jlink)
PACKAGES:
- framework-arduinoststm32 @ 4.20200.220530 (2.2.0)
- framework-cmsis @ 2.50700.210515 (5.7.0)
- tool-dfuutil @ 1.11.0
- tool-openocd @ 2.1100.211028 (11.0)
- tool-stm32duino @ 1.0.1
- toolchain-gccarmnoneeabi @ 1.90201.191206 (9.2.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 12 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Checking size .pio/build/nucleo_wb55rg_p/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [ ] 0.5% (used 908 bytes from 196608 bytes)
Flash: [ ] 2.9% (used 15088 bytes from 524288 bytes)
Configuring upload protocol...
AVAILABLE: blackmagic, cmsis-dap, jlink, stlink
CURRENT: upload_protocol = stlink
Uploading .pio/build/nucleo_wb55rg_p/firmware.elf
xPack OpenOCD x86_64 Open On-Chip Debugger 0.11.0+dev (2021-10-17-00:18)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 1
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080044d8 msp: 0x20030000
** Programming Started **
Warn : Adding extra erase range, 0x08003c48 .. 0x08003fff
Error: block write failed
Error: error writing to flash at address 0x08000000 at offset 0x00000000
embedded:startup.tcl:1070: Error: ** Programming Failed **
in procedure 'program'
in procedure 'program_error' called at file "embedded:startup.tcl", line 1135
at file "embedded:startup.tcl", line 1070
*** [upload] Error 1
I just connected to CubeProg and did a mass flash erase that was successful. It recognizes my board without issue, same thing in STM32CubeIDE with no upload issues.
Read Protection and Write Protection are both disabled in the Option Bytes section.
You’re right, the upload was successful when using the mbed protocol.
The code still does not seem to be running. The pin names for WB15CC and WB55RG seem to be identical for both boards, ruling out pin mapping issues?
Here is my Arduino code I’m trying to run, just in case I’m missing something painfully obvious. Appreciate the help!
#include <Arduino.h>
#ifndef LED_BUILTIN
#define LED1 PB_5
#endif
void setup()
{
// initialize LED digital pin as an output.
pinMode(LED1, OUTPUT);
}
void loop()
{
// turn the LED on (HIGH is the voltage level)
digitalWrite(LED1, HIGH);
// wait for a second
delay(1000);
// turn the LED off by making the voltage LOW
digitalWrite(LED1, LOW);
// wait for a second
delay(1000);
}
There may be more differences in the WB15CC compared to WB55RG so that this modifciation is not enough. I’ll look into actually generating the right board JSON for it.
Hm, the Arudino STM32 core seems buggy with regards to WB15xx support. THere are compiler errors in the timer.c and analog.cpp files referencing interrupts and struct subfields that this series does not have. Furthermore it doesn’t have the right linkerscript for it. I’ll have to do some digging.
Currently I have a board/genericSTM32WB15CC.json file of
C:\Users\XXXX.platformio\packages\framework-arduinoststm32\cores\arduino\stm32/timer.h:51:19: error: ‘TIM1_UP_TIM16_IRQn’ undeclared (first use in this function); did you mean ‘TIM1_UP_IRQn’?
51 | #define TIM1_IRQn TIM1_UP_TIM16_IRQn
C:\Users\XXXX.platformio\packages\framework-arduinoststm32\libraries\SrcWrapper\src\stm32\analog.cpp:878:18: error: ‘struct ADC_InitTypeDef’ has no member named ‘NbrOfDiscConversion’; did you mean ‘NbrOfConversion’?
Finally Solved after figuring this problem 2 days. I decide to paste it here.
Building, uploading and debugging of a simple blink example was tested.
Here I got a board/genericSTM32WB15CC.json file nearly the same with maxgerhardt
But modified maximum_ram_size and maximum_size to match framework-arduinoststm32/boards.txt