Repository navigation
stm32u5: support 4 MB devices and TrustZone with DUALBANK_SWAP #1021
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| ARCH?=ARM | ||
| TZEN?=0 | ||
| TARGET?=stm32u5 | ||
| SIGN?=ECC256 | ||
| HASH?=SHA256 | ||
| DEBUG?=0 | ||
| VTOR?=1 | ||
| CORTEX_M0?=0 | ||
| CORTEX_M33?=1 | ||
| NO_ASM?=0 | ||
| NO_MPU=1 | ||
| EXT_FLASH?=0 | ||
| SPI_FLASH?=0 | ||
| ALLOW_DOWNGRADE?=0 | ||
| NVM_FLASH_WRITEONCE?=1 | ||
| WOLFBOOT_VERSION?=1 | ||
| V?=0 | ||
| SPMATH?=1 | ||
| RAM_CODE?=0 | ||
| DUALBANK_SWAP?=1 | ||
| # STM32U5A5/U5A9/U599/U5Fx/U5Gx: 4 MB flash, two 2 MB banks | ||
| STM32U5_FLASH_SIZE_MB?=4 | ||
| WOLFBOOT_PARTITION_SIZE?=0x100000 | ||
| WOLFBOOT_SECTOR_SIZE?=0x2000 | ||
| WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x08010000 | ||
| WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x08210000 | ||
| WOLFBOOT_PARTITION_SWAP_ADDRESS?=0xFFFFFFFF | ||
|
|
||
| # Use a larger image header size to enforce alignment requirements for the interrupt vector table | ||
| IMAGE_HEADER_SIZE?=1024 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # STM32U5A5/U5A9/U599/U5Fx/U5Gx (4 MB flash, two 2 MB banks) with TrustZone | ||
| # and hardware-assisted bank swap. Required option bytes: | ||
| # TZEN=1 | ||
| # SECWM1_PSTRT=0x0 SECWM1_PEND=0x1F | ||
| # SECWM2_PSTRT=0x0 SECWM2_PEND=0x1F | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This config requires pages 0 through 31 to be secure in both banks, but
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. On stm32u5 with |
||
| # SWAP_BANK=0 on the first boot | ||
| ARCH?=ARM | ||
| TZEN?=1 | ||
| TARGET?=stm32u5 | ||
| SIGN?=ECC256 | ||
| HASH?=SHA256 | ||
| DEBUG?=0 | ||
| VTOR?=1 | ||
| CORTEX_M0?=0 | ||
| CORTEX_M33?=1 | ||
| NO_ASM?=0 | ||
| NO_MPU=1 | ||
| EXT_FLASH?=0 | ||
| SPI_FLASH?=0 | ||
| ALLOW_DOWNGRADE?=0 | ||
| NVM_FLASH_WRITEONCE?=1 | ||
| WOLFBOOT_VERSION?=1 | ||
| V?=0 | ||
| SPMATH?=1 | ||
| RAM_CODE?=0 | ||
| DUALBANK_SWAP?=1 | ||
| STM32U5_FLASH_SIZE_MB?=4 | ||
| WOLFBOOT_PARTITION_SIZE?=0x100000 | ||
| WOLFBOOT_SECTOR_SIZE?=0x2000 | ||
| WOLFBOOT_KEYVAULT_ADDRESS?=0x0C038000 | ||
| WOLFBOOT_KEYVAULT_SIZE?=0 | ||
| WOLFBOOT_NSC_ADDRESS?=0x0C038000 | ||
| WOLFBOOT_NSC_SIZE?=0x8000 | ||
| WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x08040000 | ||
| WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x08240000 | ||
| WOLFBOOT_PARTITION_SWAP_ADDRESS?=0xFFFFFFFF | ||
| FLAGS_HOME=0 | ||
| DISABLE_BACKUP=0 | ||
|
|
||
| # Use a larger image header size to enforce alignment requirements for the interrupt vector table | ||
| IMAGE_HEADER_SIZE?=1024 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CMake reads
DUALBANK_SWAP=1from the new config, but the generated build omits the define and compilesupdate_flash.c. Can you selectupdate_flash_hwswap.c, pass the define to the HAL, and check that selection in the CMake CI matrix?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed it's a gap, but it isn't specific to U5: CMake never selects
update_flash_hwswap.cor passesDUALBANK_SWAPfor any target, H5 dual-bank included, and none of the dual-bank configs are in the CMake.configmatrix. I'd like to do that as a separate CMake PR that covers all the dual-bank targets, rather than special-case U5 here.