From 010d6dece4f47baddd06dc3aabfa38ebe3f7cf0f Mon Sep 17 00:00:00 2001 From: David Garske Date: Tue, 26 May 2020 05:33:11 -0700 Subject: [PATCH] Fixes to config and documentation for STM32WB. --- config/examples/stm32wb-pka-1mb.config | 10 +++++++ config/examples/stm32wb-small.config | 6 ----- config/examples/stm32wb-tpm.config | 12 ++++----- config/examples/stm32wb.config | 14 +++++----- docs/Targets.md | 37 +++++++++++++++++++------- 5 files changed, 50 insertions(+), 29 deletions(-) create mode 100644 config/examples/stm32wb-pka-1mb.config delete mode 100644 config/examples/stm32wb-small.config diff --git a/config/examples/stm32wb-pka-1mb.config b/config/examples/stm32wb-pka-1mb.config new file mode 100644 index 00000000..fa7211c1 --- /dev/null +++ b/config/examples/stm32wb-pka-1mb.config @@ -0,0 +1,10 @@ +TARGET=stm32wb +SIGN=ECC256 +HASH=SHA256 +WOLFBOOT_SECTOR_SIZE=0x1000 +WOLFBOOT_PARTITION_SIZE=0x7B800 +WOLFBOOT_PARTITION_BOOT_ADDRESS=0x08008000 +WOLFBOOT_PARTITION_UPDATE_ADDRESS=0x08083800 +WOLFBOOT_PARTITION_SWAP_ADDRESS=0x080FF000 +NVM_FLASH_WRITEONCE=1 +PKA=1 \ No newline at end of file diff --git a/config/examples/stm32wb-small.config b/config/examples/stm32wb-small.config deleted file mode 100644 index 929b841d..00000000 --- a/config/examples/stm32wb-small.config +++ /dev/null @@ -1,6 +0,0 @@ -TARGET=stm32wb -SIGN=ECC256 -HASH?=SHA256 -WOLFBOOT_PARTITION_BOOT_ADDRESS=0xA000 -WOLFBOOT_PARTITION_SIZE=0x4000 -PKA=1 diff --git a/config/examples/stm32wb-tpm.config b/config/examples/stm32wb-tpm.config index 0e2db8a1..e4ce780a 100644 --- a/config/examples/stm32wb-tpm.config +++ b/config/examples/stm32wb-tpm.config @@ -1,11 +1,11 @@ TARGET=stm32wb SIGN=ECC256 -HASH?=SHA256 -WOLFBOOT_SECTOR_SIZE?=0x20000 -WOLFBOOT_PARTITION_SIZE?=0x60000 -WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x20000 -WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x00000 -WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x60000 +HASH=SHA256 +WOLFBOOT_SECTOR_SIZE=0x1000 +WOLFBOOT_PARTITION_SIZE=0x20000 +WOLFBOOT_PARTITION_BOOT_ADDRESS=0x08008000 +WOLFBOOT_PARTITION_UPDATE_ADDRESS=0x08028000 +WOLFBOOT_PARTITION_SWAP_ADDRESS=0x08048000 NVM_FLASH_WRITEONCE=1 PKA=0 WOLFTPM=1 diff --git a/config/examples/stm32wb.config b/config/examples/stm32wb.config index bca891d5..ebd71ca2 100644 --- a/config/examples/stm32wb.config +++ b/config/examples/stm32wb.config @@ -1,10 +1,10 @@ TARGET=stm32wb SIGN=ECC256 -HASH?=SHA256 -WOLFBOOT_SECTOR_SIZE?=0x20000 -WOLFBOOT_PARTITION_SIZE?=0x60000 -WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x20000 -WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x00000 -WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x60000 +HASH=SHA256 +WOLFBOOT_SECTOR_SIZE=0x1000 +WOLFBOOT_PARTITION_SIZE=0x20000 +WOLFBOOT_PARTITION_BOOT_ADDRESS=0x08008000 +WOLFBOOT_PARTITION_UPDATE_ADDRESS=0x08028000 +WOLFBOOT_PARTITION_SWAP_ADDRESS=0x08048000 NVM_FLASH_WRITEONCE=1 -PKA=1 +PKA=0 \ No newline at end of file diff --git a/docs/Targets.md b/docs/Targets.md index 4ae4e0b1..ad85ff59 100644 --- a/docs/Targets.md +++ b/docs/Targets.md @@ -105,7 +105,7 @@ Example partitioning on Nucleo-68 board: #define WOLFBOOT_PARTITION_SWAP_ADDRESS 0x48000 ``` -### Building +### STM32WB55 Building Use `make TARGET=stm32wb`. @@ -116,27 +116,44 @@ Compile with: `make TARGET=stm32wb NVM_FLASH_WRITEONCE=1` -### Loading the firmware +### STM32WB55 with OpenOCD `openocd --file ./config/openocd/openocd_stm32wbx.cfg` ``` telnet localhost 4444 -flash write_image unlock erase wolfboot.bin 0x08000000 -flash verify_bank 0 wolfboot.bin -flash write_image unlock erase test-app/image_v1_signed.bin 0x080008000 -flash verify_bank 0 test-app/image_v1_signed.bin 0x080008000 +reset halt +flash write_image unlock erase factory.bin 0x08000000 +flash verify_bank 0 factory.bin reset ``` -### Debugging +### STM32WB55 with ST-Link + +``` +git clone https://github.com/stlink-org/stlink.git +cd stlink +cmake . +make +sudo make install +``` + +``` +st-flash write factory.bin 0x08000000 + +# Start GDB server +st-util -p 3333 +``` + +### STM32WB55 Debugging Use `make DEBUG=1` and reload firmware. +wolfBoot has a .gdbinit to configure ``` -arm-none-eabi-gdb wolfboot.elf -ex "set remotetimeout 240" -ex "target extended-remote localhost:3333" -(gdb) add-symbol-file test-app/image.elf 0x8000 -(gdb) add-symbol-file wolfboot.elf 0x0 +arm-none-eabi-gdb +add-symbol-file test-app/image.elf 0x08008100 +mon reset init ```