-
Notifications
You must be signed in to change notification settings - Fork 849
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8488 from dgarske/stm32h7s
Support for STM32H7S (tested on NUCLEO-H7S3L8)
- Loading branch information
Showing
10 changed files
with
259 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -460,6 +460,7 @@ STM32H723xx | |
STM32H725xx | ||
STM32H743xx | ||
STM32H753xx | ||
STM32H7S3xx | ||
STM32L475xx | ||
STM32L4A6xx | ||
STM32L552xx | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,30 +15,34 @@ You need both the STM32 IDE and the STM32 initialization code generator (STM32Cu | |
* STM32CubeIDE: Integrated Development Environment for STM32 [https://www.st.com/en/development-tools/stm32cubeide.html](https://www.st.com/en/development-tools/stm32cubeide.html) | ||
* STM32CubeMX: STM32Cube initialization code generator [https://www.st.com/en/development-tools/stm32cubemx.html](https://www.st.com/en/development-tools/stm32cubemx.html) | ||
|
||
## STM32 Cube Pack | ||
## STM32 Cube Pack Install | ||
|
||
### STM32 Cube Pack Installation | ||
The STM32 Cube packs are integrated into the STM32CubeIDE and STM32CubeMX tools. You will find packs for wolfSSL, wolfSSH, wolfTPM and wolfMQTT. | ||
|
||
If you need to manually install a Cube Pack you can do the following: | ||
|
||
1. Download [wolfSSL Cube Pack](https://www.wolfssl.com/files/ide/I-CUBE-wolfSSL.pack) | ||
2. Run the “STM32CubeMX” tool. | ||
3. Under “Manage software installations” pane on the right, click “INSTALL/REMOVE” button. This can be also found by clicking "Help" -> "Managed embedded software packages" | ||
4. From Local and choose “I-CUBE-wolfSSL.pack”. | ||
2. Run the "STM32CubeMX" tool. | ||
3. Under "Manage software installations" pane on the right, click "INSTALL/REMOVE" button. This can be also found by clicking "Help" -> "Managed embedded software packages" | ||
4. From Local and choose "I-CUBE-wolfSSL.pack". | ||
5. Accept the GPLv2 license. Contact wolfSSL at [email protected] for a commercial license and support/maintenance. | ||
|
||
### STM32 Cube Pack Usage | ||
|
||
1. Create or open a Cube Project based on your hardware. See the sections below for creating a project and finding the example projects. | ||
2. Under “Software Packs” choose “Select Components”. | ||
2. Under "Software Packs" choose "Select Components". | ||
3. Find and check all components for the wolfSSL.wolfSSL packs (wolfSSL / Core, wolfCrypt / Core and wolfCrypt / Test). Close | ||
4. Under the “Software Packs” section click on “wolfSSL.wolfSSL” and configure the parameters. | ||
5. For Cortex-M recommend “Math Configuration” -> “Single Precision Cortex-M Math” for the fastest option. If seeing `error: r7 cannot be used in 'asm` add `-fomit-frame-pointer` to the CFLAGS. This only happens in debug builds, because r7 is used for debug. | ||
4. Under the "Software Packs" section click on "wolfSSL.wolfSSL" and configure the parameters. | ||
5. For Cortex-M recommend "Math Configuration" -> "Single Precision Cortex-M Math" for the fastest option. | ||
- If seeing `error: r7 cannot be used in 'asm` add `-fomit-frame-pointer` to the CFLAGS. This only happens in debug builds, because `r7` is used for debug. | ||
6. Hit the "Generate Code" button | ||
7. Open the project in STM32CubeIDE | ||
8. The Benchmark example uses float. To enable go to "Project Properties" -> "C/C++ Build" -> "Settings" -> "Tool Settings" -> "MCU Settings" -> Check "Use float with printf". | ||
9. To enable printf make the `main.c` changes below in the [STM32 Printf](#stm32-printf) section. | ||
|
||
|
||
**Note:** The STM32MP13 will likely require you to use DDR RAM, as well as enabling MMU and caches for optimum performance. Please see the `STM32MP13.md` file in `wolfcrypt/src/port/st` for more information on how to do this. | ||
**Notes:** | ||
* The STM32MP13 will likely require you to use DDR RAM, as well as enabling MMU and caches for optimum performance. Please see the `STM32MP13.md` file in `wolfcrypt/src/port/st` for more information on how to do this. | ||
* The STM32H7S only has 64KB of onboard flash. Customers typically use an external SPI NOR flash with XIP. The `Template_XIP_Boot` project is flashed to onboard and it starts up the SPI Flash with XIP and loads the application. To use this you need to make sure the option byte `XSPI2_HSLB` is set to enable XSPIM_P2 high speed support, otherwise the MX_EXTMEM_MANAGER_Init() will timeout and fail. | ||
|
||
### Creating your own STM32CubeMX configuration | ||
|
||
|
@@ -89,6 +93,7 @@ The section for "Hardware platform" may need to be adjusted depending on your pr | |
* To enable STM32L4 support define `WOLFSSL_STM32L4`. | ||
* To enable STM32L5 support define `WOLFSSL_STM32L5`. | ||
* To enable STM32H7 support define `WOLFSSL_STM32H7`. | ||
* To enable STM32H7S support define `WOLFSSL_STM32H7S`. | ||
* To enable STM32WB support define `WOLFSSL_STM32WB`. | ||
* To enable STM32WL support define `WOLFSSL_STM32WL`. | ||
* To enable STM32U5 support define `WOLFSSL_STM32U5`. | ||
|
@@ -110,6 +115,10 @@ To enable the latest Cube HAL support please define `STM32_HAL_V2`. | |
|
||
If you'd like to use the older Standard Peripheral library undefine `WOLFSSL_STM32_CUBEMX`. | ||
|
||
## Workarounds | ||
|
||
### STM32F7 AES GCM with pack v1.17.0 or older | ||
|
||
With STM32 Cube HAL v2 some AES GCM hardware has a limitation for the AAD header, which must be a multiple of 4 bytes. If your HAL does not support `CRYP_HEADERWIDTHUNIT_BYTE` then consider adding `STM32_AESGCM_PARTIAL` if you are getting AES GCM authentication failures. This bug existed in v1.16.0 or later. | ||
|
||
The STM32F7 v1.17.0 pack has a bug in the AES GCM code for handling of additional authentication data when not a multiple of 4 bytes. To patch see `stm32f7xx_hal_cryp.c` -> `CRYP_GCMCCM_SetHeaderPhase`: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.