Skip to content

Commit 5779baa

Browse files
dgarskedanielinux
authored andcommitted
Various items for STM32WB55
1 parent 485253f commit 5779baa

6 files changed

Lines changed: 52 additions & 4 deletions

File tree

arch.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ ifeq ($(ARCH),ARM)
4343
SPI_TARGET=stm32
4444
endif
4545

46+
ifeq ($(TARGET),stm32wb)
47+
ARCH_FLASH_OFFSET=0x08000000
48+
SPI_TARGET=stm32
49+
endif
50+
4651
## Cortex-M CPU
4752
ifeq ($(CORTEX_M0),1)
4853
CFLAGS+=-mcpu=cortex-m0

config/examples/stm32wb.config

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
TARGET=stm32wb
2+
SIGN=ECC256
3+
WOLFBOOT_SECTOR_SIZE?=0x1000
4+
WOLFBOOT_PARTITION_SIZE?=0x20000
5+
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x8000
6+
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x28000
7+
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x48000
8+
NVM_FLASH_WRITEONCE=1
9+
PKA=0
10+
WOLFTPM=1
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
source [find interface/stlink.cfg]
2+
source [find target/stm32wbx.cfg]
3+
$_TARGETNAME configure -event reset-init {
4+
mmw 0xe0042004 0x7 0x0
5+
}
6+
init
7+
reset
8+
halt

docs/Targets.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ Compile with:
8888

8989
`make TARGET=stm32g0 NVM_FLASH_WRITEONCE=1`
9090

91+
9192
## STM32WB55
9293

9394
Example partitioning on Nucleo-68 board:
@@ -115,6 +116,30 @@ Compile with:
115116

116117
`make TARGET=stm32wb NVM_FLASH_WRITEONCE=1`
117118

119+
### Loading the firmware
120+
121+
`openocd --file ./config/openocd/openocd_stm32wbx.cfg`
122+
123+
```
124+
telnet localhost 4444
125+
flash write_image unlock erase wolfboot.bin 0x08000000
126+
flash verify_bank 0 wolfboot.bin
127+
flash write_image unlock erase test-app/image_v1_signed.bin 0x080008000
128+
flash verify_bank 0 test-app/image_v1_signed.bin 0x080008000
129+
reset
130+
```
131+
132+
### Debugging
133+
134+
Use `make DEBUG=1` and reload firmware.
135+
136+
```
137+
arm-none-eabi-gdb wolfboot.elf -ex "set remotetimeout 240" -ex "target extended-remote localhost:3333"
138+
(gdb) add-symbol-file test-app/image.elf 0x8000
139+
(gdb) add-symbol-file wolfboot.elf 0x0
140+
```
141+
142+
118143
## SiFive HiFive1 RISC-V
119144

120145
### Features
@@ -367,9 +392,8 @@ telnet localhost 4444
367392
flash write_image unlock erase wolfboot.bin 0x08000000
368393
flash verify_bank 0 wolfboot.bin
369394
flash write_image unlock erase test-app/image_v1_signed.bin 0x08020000
370-
flash verify_bank 0 test-app/image_v1_signed.bin 0x20000
395+
flash verify_bank 0 test-app/image_v1_signed.bin 0x08020000
371396
reset
372-
resume 0x08000000
373397
```
374398

375399
To sign the same application image as new version (2), use the python script `sign.py` provided:

hal/spi/spi_drv_stm32.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@
4444
#define GPIOC_BASE (0x48000800)
4545
#define GPIOD_BASE (0x48000C00)
4646

47+
/* STM32WB55 NUCLEO: CN9: D13=SCK, D12=MISO, D11=MOSI, FLASHCS=D10, TPMCS=D9 */
4748
#define SPI_CS_GPIO GPIOA_BASE
4849
#define SPI_CS_FLASH 4 /* Flash CS connected to GPIOA4 */
49-
#define SPI_CS_TPM 0 /* TPM CS connected to GPIOA0 */
50+
#define SPI_CS_TPM 9 /* TPM CS connected to GPIOA9 */
5051
#define SPI1_PIN_AF 5 /* Alternate function for SPI pins */
5152
#define SPI1_CLOCK_PIN 5 /* SPI_SCK: PA5 */
5253
#define SPI1_MISO_PIN 6 /* SPI_MISO PA6 */

0 commit comments

Comments
 (0)