MecrispCube.bin
or better the MecrispCubeFS.bin
) to the USB mass storage NODE_WB55RG
/dev/ttyACM0
)
and set the speed to 115200 baud.
I set the putty terminal configuration to
Mecrisp-Stellaris RA 2.5.4 by Matthias Koch. Mecrisp-Cube 1.5.0 for STM32WB Nucleo, 63/128 KiB RAM/FLASH dictionary (C) 2022 peter@spyr.ch * Firmware Package STM32Cube FW_WB V1.14.1, USB-CDC, BLE Stack 5.3 (C) 2022 STMicroelectronics * CMSIS-RTOS V2 FreeRTOS wrapper, FreeRTOS Kernel V10.3.1 (C) 2020 Amazon.com * FatFs for internal flash and microSD - Generic FAT fs module R0.12c (C) 2017 ChaN * tiny vi - part of BusyBox (C) 2000, 2001 Sterling Huxley include 0:/etc/rc.local 23 5 / .[CR] 4 ok. : hello ." World" ;[CR] ok. hello[CR] World ok. 27k 13.5u f* fm.[CR] 364m ok.
psi@homer:~> git clone https://github.com/spyren/Mecrisp-Cube Klone nach 'Mecrisp-Cube' ... remote: Enumerating objects: 106, done. remote: Counting objects: 100% (106/106), done. remote: Compressing objects: 100% (71/71), done. remote: Total 106 (delta 33), reused 106 (delta 33), pack-reused 0 Empfange Objekte: 100% (106/106), 938.96 KiB | 2.39 MiB/s, Fertig. Löse Unterschiede auf: 100% (33/33), Fertig.Import the project into the IDE:
File -> Import -> General -> Existing Projects into Workspace -> Select root directory Copy project into workspace Browse to Mecrisp-Cube directoryGenerate code from the STM32CubeMX
MecrispCube.ioc
file:
Project -> Generate CodeRestore changed source files
$ git status {list of changed files} $ git restore {files to restore}Or stash the changes away
$ git stash $ git stash dropSelect the Build Configuration (Debug if you want to debug the project) and Build the project:
Project -> Build Configurations -> Set Active -> Debug/Reelease Project -> Build Project
$ telnet localhost 4444 Trying ::1... telnet: connect to address ::1: Connection refused Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. Open On-Chip Debugger > reset init Unable to match requested speed 500 kHz, using 480 kHz Unable to match requested speed 500 kHz, using 480 kHz target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x08003aae msp: 0x20000430 > flash erase_sector 0 0 192 erased sectors 0 through 192 on flash bank 0 in 4.583453s > flash write_image mecrisp-stellaris-stm32wb55.hex device idcode = 0x20016495 (STM32WB5x - Rev: 2.1) flash size = 1024kbytes flash mode : single-bank Padding 4 bytes to keep 8-byte write size block write succeeded wrote 15404 bytes from file mecrisp-stellaris-stm32wb55.hex in 0.329747s (45.620 KiB/s) > shutdown shutdown command invoked Connection closed by foreign host.
$ alias cubepgmcli='/opt/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32_Programmer_CLI' $ cubepgmcli -c port=USB1 -e [0 191] $ cubepgmcli -c port=USB1 -d Release/MecrispCube.bin 0x8000000 $ cubepgmcli -c port=USB1 -ob displBTW you can flash the Nucleo Board in the same way.
Projects/STM32WB_Copro_Wireless_Binaries
. At time of writing the FUS is Version 1.2.0, the stack v1.14.1. The STM32CubeProgrammer is v2.11.0.
Nucleo board: Using USB_USER interface and the built-in bootloader (activate with jumper between CN7.5 and CN7.7)
$ alias cubepgmcli='/opt/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin/STM32_Programmer_CLI' $ cd STM32Cube_FW_WB_V1.14.1/Projects/STM32WB_Copro_Wireless_Binaries/STM32WB5x $ cubepgmcli -c port=USB1 -fwdelete $ cubepgmcli -c port=USB1 -fwupgrade stm32wb5x_FUS_fw.bin 0x080EC000 firstinstall=0 $ cubepgmcli -c port=USB1 -fwupgrade stm32wb5x_FUS_fw_for_fus_0_5_3.bin 0x080EC000 firstinstall=0 $ cubepgmcli -c port=USB1 -fwupgrade stm32wb5x_BLE_Stack_full_fw.bin 0x080CB000 firstinstall=1Using ST-LINK (here to show the option bytes,
SBRV : 0x33800
means start address 4 * SBRV + 0x08000000 = 0x080CB000, 3D000 means there is no stack):
psi@homer:~/Dropbox/wbForth/CubeWB> cubepgmcli -c port=SWD -ob displ ------------------------------------------------------------------- STM32CubeProgrammer v2.10.0 ------------------------------------------------------------------- Log output file: ob.log ST-LINK SN : 0030003E3137510539383538 ST-LINK FW : V3J10M3B5S1 Board : STLINK-V3SET Voltage : 3.27V SWD freq : 24000 KHz Connect mode: Under Reset Reset mode : Hardware reset Device ID : 0x495 Revision ID : Rev Y Device name : STM32WB5x Flash size : 1 MBytes Device type : MCU Device CPU : Cortex-M4 BL Version : 0xd5 Debug in Low Power mode enabled UPLOADING OPTION BYTES DATA ... Bank : 0x00 Address : 0x58004020 Size : 96 Bytes Bank : 0x01 Address : 0x58004080 Size : 8 Bytes OPTION BYTES BANK: 0 Read Out Protection: RDP : 0xAA (Level 0, no protection) BOR Level: BOR_LEV : 0x4 (BOR Level 4 reset level threshold is around 2.8 V) User Configuration: nBOOT0 : 0x1 (nBOOT0=1 Boot from main Flash) nBOOT1 : 0x1 (Boot from code area if BOOT0=0 otherwise system Flash) nSWBOOT0 : 0x0 (BOOT0 taken from the option bit nBOOT0) SRAM2RST : 0x0 (SRAM2 erased when a system reset occurs) SRAM2PE : 0x1 (SRAM2 parity check disable) nRST_STOP : 0x1 (No reset generated when entering the Stop mode) nRST_STDBY : 0x1 (No reset generated when entering the Standby mode) nRSTSHDW : 0x1 (No reset generated when entering the Shutdown mode) WWDGSW : 0x1 (Software window watchdog) IWGDSTDBY : 0x1 (Independent watchdog counter running in Standby mode) IWDGSTOP : 0x1 (Independent watchdog counter running in Stop mode) IWDGSW : 0x1 (Software independent watchdog) IPCCDBA : 0x0 (0x0) Security Configuration Option bytes - 1: ESE : 0x1 (Security enabled) PCROP Protection: PCROP1A_STRT : 0x1FF (0x80FF800) PCROP1A_END : 0x0 (0x8000800) PCROP_RDP : 0x0 (PCROP zone is kept when RDP is decreased) PCROP1B_STRT : 0x1FF (0x80FF800) PCROP1B_END : 0x0 (0x8000800) Write Protection: WRP1A_STRT : 0xFF (0x80FF000) WRP1A_END : 0x0 (0x8000000) WRP1B_STRT : 0xFF (0x80FF000) WRP1B_END : 0x0 (0x8000000) OPTION BYTES BANK: 1 Security Configuration Option bytes - 2: SFSA : 0xC7 (0x80C7000) FSD : 0x0 (System and Flash secure) DDS : 0x1 (CPU2 debug access disabled) C2OPT : 0x1 (SBRV will address Flash) NBRSD : 0x0 (SRAM2b is secure) SNBRSA : 0xF (0x2003BC00) BRSD : 0x0 (SRAM2a is secure) SBRSA : 0xA (0x20032800) SBRV : 0x31C00 (0x20000000)Alternate way to erase the flash memory (change the Memory Read Protection from Level 1 to level 0):
$ cubepgmcli -c port=swd -ob rdp=0xbb $ cubepgmcli -c port=swd -rdu
I | Attachment | History | Action | Size | Date | Who | Comment |
---|---|---|---|---|---|---|---|
jpg | feather-adaptor.jpg | r1 | manage | 477.1 K | 2021-05-22 - 08:15 | PeterSchmid | |
jpg | firefly-pins.jpg | r1 | manage | 125.9 K | 2022-08-22 - 08:34 | PeterSchmid | |
jpg | nucleo-header-logo.jpg | r1 | manage | 39.1 K | 2020-05-17 - 20:16 | PeterSchmid | |
png | nucleo_wb55rg_arduino_left.png | r1 | manage | 521.0 K | 2020-04-30 - 08:44 | PeterSchmid | |
png | nucleo_wb55rg_arduino_right.png | r1 | manage | 528.2 K | 2020-04-30 - 08:44 | PeterSchmid | |
png | nucleo_wb55rg_morpho_left.png | r1 | manage | 608.4 K | 2020-04-30 - 08:44 | PeterSchmid | |
png | nucleo_wb55rg_morpho_right2.png | r1 | manage | 554.6 K | 2020-04-30 - 08:44 | PeterSchmid |