Skip to content

Commit 605cae1

Browse files
committed
Update docs for new linker symbol and make_keys_xxx.bat
1 parent d4111ec commit 605cae1

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

Docs/README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ At minimum we need to tell the linker where your application's new start offset
6464
It defines some symbols that we may need, minimally it is `STM32_SECURE_PATCHING_BOOTLOADER_SLOT0_START`. Then your application's interrupt vector table has to be offset from this by the minimum size of your vector table (to account for the image header), also defined as `VECTOR_SIZE` in the linker configuration file.
6565

6666
```
67-
/* For this example end of RAM on STM32L073 is 0x20005000 = 20 KB*/
67+
/* For this example end of RAM on STM32L073 is STM32_SECURE_PATCHING_BOOTLOADER_RAM_TOP = 0x20005000 = 20 KB*/
6868
6969
INCLUDE stm32-secure-patching-bootloader-linker-gcc_NUCLEO-L073RZ_v1.3.0.ld
7070
7171
APPLI_region_intvec_start__ = STM32_SECURE_PATCHING_BOOTLOADER_SLOT0_START + VECTOR_SIZE;
7272
APPLI_region_ROM_start = STM32_SECURE_PATCHING_BOOTLOADER_SLOT0_START + VECTOR_SIZE + VECTOR_SIZE;
7373
APPLI_region_ROM_length = STM32_SECURE_PATCHING_BOOTLOADER_SLOT0_END - APPLI_region_ROM_start + 1;
7474
APPLI_region_RAM_start = STM32_SECURE_PATCHING_BOOTLOADER_RAM_START;
75-
APPLI_region_RAM_length = 0x20005000 - APPLI_region_RAM_start;
75+
APPLI_region_RAM_length = STM32_SECURE_PATCHING_BOOTLOADER_RAM_TOP - APPLI_region_RAM_start;
7676
7777
MEMORY
7878
{
@@ -105,14 +105,14 @@ A multi-target generic linker script that works with most STM32 targets is provi
105105
For a TouchGFx multi-segment application (assets on external QSPI or OSPI flash), use this template:
106106

107107
```
108-
/* For this example end of RAM on STM32L4R9I is 0x200A0000 = 640 KB*/
108+
/* For this example end of RAM on STM32L4R9I is STM32_SECURE_PATCHING_BOOTLOADER_RAM_TOP = 0x200A0000 = 640 KB*/
109109
INCLUDE stm32-secure-patching-bootloader-linker-gcc_DISCO-L4R9I_v1.3.0.ld
110110
111111
APPLI_region_intvec_start__ = STM32_SECURE_PATCHING_BOOTLOADER_SLOT0_START + VECTOR_SIZE;
112112
APPLI_region_ROM_start = STM32_SECURE_PATCHING_BOOTLOADER_SLOT0_START + VECTOR_SIZE + VECTOR_SIZE;
113113
APPLI_region_ROM_length = STM32_SECURE_PATCHING_BOOTLOADER_SLOT0_END - APPLI_region_ROM_start + 1;
114114
APPLI_region_RAM_start = STM32_SECURE_PATCHING_BOOTLOADER_RAM_START;
115-
APPLI_region_RAM_length = 0x200A0000 - APPLI_region_RAM_start;
115+
APPLI_region_RAM_length = STM32_SECURE_PATCHING_BOOTLOADER_RAM_TOP - APPLI_region_RAM_start;
116116
117117
MEMORY
118118
{
@@ -172,18 +172,19 @@ void SystemInit(void)
172172
Use the make_keys.bat script under Scripts to call a Python tool to generate the AES encryption key (firmware confidentiality) and the ECDSA public verification and private signing keys (firmware authenticity). Example on Windows systems to place keys in a Keys directory:
173173

174174
```
175-
c:\stm32-secure-patching-bootloader-demoapp\Bootloader\Scripts>make_keys.bat ..\..\App\Project\DemoApp\DISCO-F769I\STM32CubeIDE\Keys
175+
c:\stm32-secure-patching-bootloader-demoapp\Bootloader\Scripts>make_keys_v7m.bat ..\..\App\Project\DemoApp\DISCO-F769I\STM32CubeIDE\Keys
176176
177177
make_keys.bat : Generate new secure keys for stm32-secure-patching-bootloader
178178
Making ..\..\App\Project\DemoApp\DISCO-F769I\STM32CubeIDE\Keys/Cipher_Key_AES_CBC.bin
179179
Making ..\..\App\Project\DemoApp\DISCO-F769I\STM32CubeIDE\Keys/Signing_PrivKey_ECC.txt
180+
Making ..\..\App\Project\DemoApp\DISCO-F769I\STM32CubeIDE\Keys/machine.txt
180181
```
181182

182183
Run `make_keys <path to directory to contain key files>`
183184

184185
If you're not using Windows, then all you need to do is look inside make_keys.bat and run the Python scripts directly. The Keys directory is referenced by the postbuild.sh post-build command line in the IDE. This directory can be anywhere and called anything by adjusting the post-build command line.
185186

186-
Ensure there is a file called `machine.txt` in the `Keys` dir. Add one line to it: `V7M` for all targets unless you're using a cortex-M0, then add `V6M` instead. `make_keys.bat` may have already created this file.
187+
Ensure there is a file called `machine.txt` in the `Keys` dir. Add one line to it: `V7M` for all targets unless you're using a cortex-M0, then add `V6M` instead. `make_keys_xxx.bat` will have already created this file.
187188

188189
**Important Note**
189190

Linker/README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ RAM size is incorporated into the constants.
1313
/* Entry Point */
1414
ENTRY(Reset_Handler)
1515
16+
INCLUDE stm32-secure-patching-bootloader-linker-gcc_<version>_<target>.ld
17+
1618
/* Highest address of the user mode stack */
17-
_estack = 0x20005000; /* end of RAM specific to the device. */
19+
_estack = STM32_SECURE_PATCHING_BOOTLOADER_RAM_TOP; /* end of RAM specific to the device. */
1820
1921
/* Generate a link error if heap and stack don't fit into RAM
2022
* These do not reserve memory for these areas but rather just
@@ -23,22 +25,19 @@ _estack = 0x20005000; /* end of RAM specific to the device. */
2325
_Min_Heap_Size = 0x200; /* required amount of heap */
2426
_Min_Stack_Size = 0x400; /* required amount of stack */
2527
26-
INCLUDE stm32-secure-patching-bootloader-linker-gcc_<version>_<target>.ld
27-
2828
/* Specific ROM/RAM UserApp definition */
2929
APPLI_region_intvec_start__ = STM32_SECURE_PATCHING_BOOTLOADER_SLOT0_START + 0x200; /* Cortex-M7: 0x400, others: 0x200 */
3030
APPLI_region_ROM_start = STM32_SECURE_PATCHING_BOOTLOADER_SLOT0_START + VECTOR_SIZE + 0x200; /* Cortex-M7: 0x400, others: 0x200 */
3131
APPLI_region_ROM_length = STM32_SECURE_PATCHING_BOOTLOADER_SLOT0_END - APPLI_region_ROM_start + 1;
3232
APPLI_region_RAM_start = STM32_SECURE_PATCHING_BOOTLOADER_RAM_START;
33-
APPLI_region_RAM_length = 0x20005000 - APPLI_region_RAM_start;
33+
APPLI_region_RAM_length = STM32_SECURE_PATCHING_BOOTLOADER_RAM_TOP - APPLI_region_RAM_start;
3434
3535
/* Specify the memory areas */
3636
MEMORY
3737
{
3838
ISR_VECTOR (rx) : ORIGIN = APPLI_region_intvec_start__, LENGTH = VECTOR_SIZE
3939
APPLI_region_ROM : ORIGIN = APPLI_region_ROM_start, LENGTH = APPLI_region_ROM_length
4040
APPLI_region_RAM : ORIGIN = APPLI_region_RAM_start, LENGTH = APPLI_region_RAM_length
41-
QSPI (rx) : ORIGIN = APPLI_region_MULTISEG_start__, LENGTH = 64M
4241
}
4342
4443
/* Include the SECTIONS (not target-specific) */

0 commit comments

Comments
 (0)