Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/test-configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,12 @@ jobs:
arch: arm
config-file: ./config/examples/stm32c0-lms-8-10-1.config

stm32f1_test:
uses: ./.github/workflows/test-build.yml
with:
arch: arm
config-file: ./config/examples/stm32f1.config

stm32f4_small_blocks_uart_update_test:
uses: ./.github/workflows/test-build.yml
with:
Expand Down
6 changes: 6 additions & 0 deletions arch.mk
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ ifeq ($(ARCH),ARM)
ARCH_FLASH_OFFSET=0x08000000
endif

ifeq ($(TARGET),stm32f1)
CORTEX_M3=1
NO_ARM_ASM=1
ARCH_FLASH_OFFSET=0x08000000
endif

ifeq ($(TARGET),stm32f4)
ARCH_FLASH_OFFSET=0x08000000
SPI_TARGET=stm32
Expand Down
17 changes: 17 additions & 0 deletions config/examples/stm32f1.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
ARCH?=ARM
TARGET?=stm32f1
SIGN?=ED25519
HASH?=SHA256
VTOR?=0
SPMATH?=1
DISABLE_BACKUP=0
NVM_FLASH_WRITEONCE=1
# 12 KB bootloader partition
# 2 * 25 KB application partitions
# 2 KB swap partition
# 64 KB total
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x08003000
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x08009400
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x0800F800
WOLFBOOT_PARTITION_SIZE?=0x6400
WOLFBOOT_SECTOR_SIZE?=0x400
31 changes: 31 additions & 0 deletions docs/Targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ This README describes configuration of supported targets.
* [Renesas RZN2L](#renesas-rzn2l)
* [SiFive HiFive1 RISC-V](#sifive-hifive1-risc-v)
* [STM32C0](#stm32c0)
* [STM32F1](#stm32f1)
* [STM32F4](#stm32f4)
* [STM32F7](#stm32f7)
* [STM32G0](#stm32g0)
Expand Down Expand Up @@ -103,6 +104,36 @@ b main
c
```

## STM32F1

Similar layout as the STM32F4, but for a much smaller 64KB flash.

WolfBoot occupy 12KB, followed by 2x25 KB firmware partitions, and a 2KB swap:

```
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x08003000
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x08009400
WOLFBOOT_PARTITION_SWAP_ADDRESS?=0x0800F800
```

This is with the sample config in [config/examples/stm32f1.config](config/examples/stm32f1.config).

Note that with this partition layout, WolfBoot cannot be compiled with debug support.

The test application for STM32F1 is designed so that if it boots a version 1 software, it will trigger an update
If the running software version is 2, all is good.
In both cases, PC13 is cleared (lights up the green LED on a Blue Pill board).

### STM32F1 Programming

All STM32F1 devices come with a builtin bootloader that can be used to program the device.
It allows firmware upload on USART0 (pin A9 and A10 on the Blue Pill) using a usb-serial converter.
The bootloader is entered by pulling the BOOT0 pin high.
Once the builtin bootloader is active, the STM32F1 can be programmed with `stm32flash`:

```
stm32flash -w factory.bin -b 115200 -g 0 /dev/ttyUSB0
```

## STM32L4
Example 1MB partitioning on STM32L4
Expand Down
Loading
Loading