@@ -21,6 +21,7 @@ This README describes configuration of supported targets.
2121* [ STM32L4] ( #stm32l4 )
2222* [ STM32L5] ( #stm32l5 )
2323* [ STM32G0] ( #stm32g0 )
24+ * [ STM32C0] ( #stm32c0 )
2425* [ STM32H7] ( #stm32h7 )
2526* [ STM32U5] ( #stm32u5 )
2627* [ STM32WB55] ( #stm32wb55 )
@@ -424,6 +425,82 @@ add-symbol-file test-app/image.elf 0x08008100
424425mon reset init
425426```
426427
428+ ## STM32C0
429+
430+ Supports STM32C0x0/STM32C0x1.
431+
432+ Example and instructions are for the STM Nucleo-C031C6 dev board using the
433+ STM32Cube
434+
435+ Example 32KB partitioning on STM32-G070:
436+
437+ - Sector size: 2KB
438+ - Wolfboot partition size: 14KB
439+ - Application partition size: 8 KB
440+ - Swap size 2KB
441+
442+ ``` C
443+ #define WOLFBOOT_SECTOR_SIZE 0x800 /* 2 KB */
444+ #define WOLFBOOT_PARTITION_BOOT_ADDRESS 0x08004000 /* offset 16kB to 24kB */
445+ #define WOLFBOOT_PARTITION_SIZE 0x2000 /* 8 KB */
446+ #define WOLFBOOT_PARTITION_UPDATE_ADDRESS 0x08006000 /* offset 24kB to 32kB */
447+ #define WOLFBOOT_PARTITION_SWAP_ADDRESS 0x08003800 /* offset 14kB to 16kB */
448+ ```
449+
450+ ### Building STM32C0
451+ xxx
452+ Reference configuration (see [ /config/examples/stm32g0.config] ( /config/examples/stm32g0.config ) ).
453+ You can copy this to wolfBoot root as ` .config ` : ` cp ./config/examples/stm32g0.config .config ` .
454+ To build you can use ` make ` .
455+
456+ The TARGET for this is ` stm32g0 ` : ` make TARGET=stm32g0 ` .
457+ The option ` CORTEX_M0 ` is automatically selected for this target.
458+ The option ` NVM_FLASH_WRITEONCE=1 ` is mandatory on this target, since the IAP driver does not support
459+ multiple writes after each erase operation.
460+
461+ This target also supports secure memory protection on the bootloader region
462+ using the ` FLASH_CR:SEC_PROT ` and ` FLASH_SECT:SEC_SIZE ` registers. This is the
463+ number of 2KB pages to block access to from the 0x8000000 base address.
464+
465+ ```
466+ STM32_Programmer_CLI -c port=swd mode=hotplug -ob SEC_SIZE=0x10
467+ ```
468+
469+ For RAMFUNCTION support (required for SEC_PROT) make sure ` RAM_CODE=1 ` .
470+
471+ ### STM32C0 Programming
472+ xxx
473+ Compile requirements: ` make TARGET=stm32g0 NVM_FLASH_WRITEONCE=1 `
474+
475+ The output is a single ` factory.bin ` that includes ` wolfboot.bin ` and ` test-app/image_v1_signed.bin ` combined together.
476+ This should be programmed to the flash start address ` 0x08000000 ` .
477+
478+ Flash using the STM32CubeProgrammer CLI:
479+
480+ ```
481+ STM32_Programmer_CLI -c port=swd -d factory.bin 0x08000000
482+ ```
483+
484+ ### STM32C0 Debugging
485+ xxx
486+ Use ` make DEBUG=1 ` and program firmware again.
487+
488+ Start GDB server on port 3333:
489+
490+ ```
491+ ST-LINK_gdbserver -d -e -r 1 -p 3333
492+ OR
493+ st-util -p 3333
494+ ```
495+
496+ wolfBoot has a .gdbinit to configure GDB
497+
498+ ```
499+ arm-none-eabi-gdb
500+ add-symbol-file test-app/image.elf 0x08008100
501+ mon reset init
502+ ```
503+
427504
428505## STM32WB55
429506
0 commit comments