Completed Windows/IAR example, removed extra files

iar
Daniele Lacamera 2020-03-31 11:54:58 +02:00
parent 7e6452467b
commit 8c6272df4a
29 changed files with 5568 additions and 4154 deletions

5
.gitignore vendored
View File

@ -84,3 +84,8 @@ config/*.ld
.vs
*.filters
*.user
# IAR files not under version control
IDE/IAR/settings
IDE/IAR/*.ewt

88
IDE/IAR/README.md 100644
View File

@ -0,0 +1,88 @@
# wolfBoot demo application for IAR EWARM
Instruction to compile and test under MS Windows.
## Target platform
This example application has been configured to work on STM32F4.
wolfBoot is stored and executed at the beginning of the flash (0x08000000), while the signed
application image starts at address 0x08020000.
## Workspace
The workspace [wolfboot-test-app.eww](./wolfboot-test-app.eww) contains two projects:
- wolfBoot
- wolfBoot-test-app
Each project will compile into a separate binary, the two binaries can be uploaded to the target using
ST-Link utilities (e.g. [STSW-LINK004](https://www.st.com/en/development-tools/stsw-link004.html)) as explained below.
## Instructions
### Creating the keys
This step is required to compile the bootloader.
Open a command line terminal in the [IAR](./) directory. Execute the following script:
```
generate_key.bat
```
The script will generate a keypair. The file `ecc256.der` in the root of the repository contains the private key that will be used
to sign valid firmware images. The file `src/ecc256_pub_key.c` now contains the public key that the bootloader embeds in its codebase
to use it later to verify the image.
### Compiling and linking the images
Now both projects (wolfboot and wolfboot-test-app) can be compiled and linked.
The two resulting images will be placed in the output directory `Debug/Exe`:
- wolfboot.bin
- wolfboot-test-app.bin
### Signing the firmware image
The test application (main firmware) must be now tagged with a version number and signed. This is done by the script `sign_test_app.bat`.
The script requires one numeric argument that is used as the version tag for the signed image. Running it with version "1":
```
sign_test_app.bat 1
```
Will create a new file named `wolfboot-test-app_v1_signed.bin`, which will be placed in the output directory `Debug/Exe`.
### Uploading the binary images to the target
Using the ST-LINK Utility, perform the following steps:
1. Erase the entire flash memory
![Erase flash](../../docs/png/windows_erase.png)
*Erase the entire flash memory before uploading the binary files*
2. Upload `wolfboot.bin` to addess 0x08000000
![Upload bootloader](../../docs/png/windows_upload_1.png)
3. Upload `wolfboot-test-app_v1_signed.bin` to address 0x08020000. Ensure that the flag "Skip Flash Erase" is active.
![Upload firmware](../../docs/png/windows_upload_2.png)
### Verify that the system is up and running
If you are using a STM32F407-discovery board, a red LED will turn on upon application boot.

View File

@ -0,0 +1,2 @@
keytools\keygen.exe --ecc256 ..\..\src\ecc256_pub_key.c
mv ecc256.der ..\..\

View File

@ -0,0 +1,3 @@
## Pre-compiled Key management tools for windows (64bit)
Full sources available in the [keytools](../../../tools/keytools) directory in this repository.

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -1,40 +0,0 @@
@REM This batch file has been generated by the IAR Embedded Workbench
@REM C-SPY Debugger, as an aid to preparing a command line for running
@REM the cspybat command line utility using the appropriate settings.
@REM
@REM Note that this file is generated every time a new debug session
@REM is initialized, so you may want to move or rename the file before
@REM making changes.
@REM
@REM You can launch cspybat by typing the name of this batch file followed
@REM by the name of the debug file (usually an ELF/DWARF or UBROF file).
@REM
@REM Read about available command line parameters in the C-SPY Debugging
@REM Guide. Hints about additional command line parameters that may be
@REM useful in specific cases:
@REM --download_only Downloads a code image without starting a debug
@REM session afterwards.
@REM --silent Omits the sign-on message.
@REM --timeout Limits the maximum allowed execution time.
@REM
@echo off
if not "%~1" == "" goto debugFile
@echo on
"C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.4\common\bin\cspybat" -f "C:\Users\dan\wolfboot\IDE\IAR\settings\wolfboot.Debug.general.xcl" --backend -f "C:\Users\dan\wolfboot\IDE\IAR\settings\wolfboot.Debug.driver.xcl"
@echo off
goto end
:debugFile
@echo on
"C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.4\common\bin\cspybat" -f "C:\Users\dan\wolfboot\IDE\IAR\settings\wolfboot.Debug.general.xcl" "--debug_file=%~1" --backend -f "C:\Users\dan\wolfboot\IDE\IAR\settings\wolfboot.Debug.driver.xcl"
@echo off
:end

View File

@ -1,31 +0,0 @@
param([String]$debugfile = "");
# This powershell file has been generated by the IAR Embedded Workbench
# C - SPY Debugger, as an aid to preparing a command line for running
# the cspybat command line utility using the appropriate settings.
#
# Note that this file is generated every time a new debug session
# is initialized, so you may want to move or rename the file before
# making changes.
#
# You can launch cspybat by typing Powershell.exe -File followed by the name of this batch file, followed
# by the name of the debug file (usually an ELF / DWARF or UBROF file).
#
# Read about available command line parameters in the C - SPY Debugging
# Guide. Hints about additional command line parameters that may be
# useful in specific cases :
# --download_only Downloads a code image without starting a debug
# session afterwards.
# --silent Omits the sign - on message.
# --timeout Limits the maximum allowed execution time.
#
if ($debugfile -eq "")
{
& "C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.4\common\bin\cspybat" -f "C:\Users\dan\wolfboot\IDE\IAR\settings\wolfboot.Debug.general.xcl" --backend -f "C:\Users\dan\wolfboot\IDE\IAR\settings\wolfboot.Debug.driver.xcl"
}
else
{
& "C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.4\common\bin\cspybat" -f "C:\Users\dan\wolfboot\IDE\IAR\settings\wolfboot.Debug.general.xcl" --debug_file=$debugfile --backend -f "C:\Users\dan\wolfboot\IDE\IAR\settings\wolfboot.Debug.driver.xcl"
}

View File

@ -1,19 +0,0 @@
"--endian=little"
"--cpu=Cortex-M4"
"--fpu=None"
"-p"
"C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.4\arm\CONFIG\debugger\ST\STM32F407VG.ddf"
"--semihosting=none"
"--device=STM32F407VG"
"--multicore_nr_of_cores=1"

View File

@ -1,13 +0,0 @@
"C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.4\arm\bin\armproc.dll"
"C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.4\arm\bin\armsim2.dll"
"C:\Users\dan\wolfboot\IDE\IAR\Debug\Exe\wolfboot.out"
--plugin="C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.4\arm\bin\armbat.dll"
--device_macro="C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.4\arm\config\debugger\ST\STM32F4xx.dmac"

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<crun>
<version>1</version>
<filter_entries>
<filter index="0" type="default">
<type>*</type>
<start_file>*</start_file>
<end_file>*</end_file>
<action_debugger>0</action_debugger>
<action_log>1</action_log>
</filter>
</filter_entries>
</crun>

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Project>
<WindowStorage />
</Project>

View File

@ -1,58 +0,0 @@
<?xml version="1.0"?>
<settings>
<Stack>
<FillEnabled>0</FillEnabled>
<OverflowWarningsEnabled>1</OverflowWarningsEnabled>
<WarningThreshold>90</WarningThreshold>
<SpWarningsEnabled>1</SpWarningsEnabled>
<WarnLogOnly>1</WarnLogOnly>
<UseTrigger>1</UseTrigger>
<TriggerName>main</TriggerName>
<LimitSize>0</LimitSize>
<ByteLimit>50</ByteLimit>
</Stack>
<Trace1>
<Enabled>0</Enabled>
<ShowSource>1</ShowSource>
</Trace1>
<InterruptLog>
<LogEnabled>0</LogEnabled>
<GraphEnabled>0</GraphEnabled>
<ShowTimeLog>1</ShowTimeLog>
<SumEnabled>0</SumEnabled>
<ShowTimeSum>1</ShowTimeSum>
<SumSortOrder>0</SumSortOrder>
</InterruptLog>
<DataLog>
<LogEnabled>0</LogEnabled>
<GraphEnabled>0</GraphEnabled>
<ShowTimeLog>1</ShowTimeLog>
<SumEnabled>0</SumEnabled>
<ShowTimeSum>1</ShowTimeSum>
</DataLog>
<DisassembleMode>
<mode>0</mode>
</DisassembleMode>
<Breakpoints2>
<Count>0</Count>
</Breakpoints2>
<Interrupts>
<Enabled>1</Enabled>
</Interrupts>
<MemConfig>
<Base>1</Base>
<Manual>0</Manual>
<Ddf>1</Ddf>
<TypeViol>0</TypeViol>
<Stop>1</Stop>
</MemConfig>
<Aliases>
<Count>0</Count>
<SuppressDialog>0</SuppressDialog>
</Aliases>
<Simulator>
<Freq>10000000</Freq>
<FreqHi>0</FreqHi>
<MultiCoreRunAll>1</MultiCoreRunAll>
</Simulator>
</settings>

View File

@ -0,0 +1,13 @@
echo off
if "%~1"=="" goto fail
keytools\sign.exe --ecc256 --sha256 Debug\Exe\wolfboot-test-app.bin ..\..\ecc256.der %1
goto out
:fail
echo please specify a version number.
:out

View File

@ -0,0 +1,62 @@
/*###ICF### Section handled by ICF editor, don't touch! ****/
/*-Editor annotation file-*/
/* IcfEditorFile="$TOOLKIT_DIR$\config\linker\ST\IcfEditor\stm32f40x_fsmc.xml" */
/*-Specials-*/
define symbol __ICFEDIT_intvec_start__ = 0x08020100;
/*-Memory Regions-*/
define symbol __ICFEDIT_region_FLASH_start__ = 0x08020100;
define symbol __ICFEDIT_region_FLASH_end__ = 0x0803FFFF;
define symbol __ICFEDIT_region_FSMC11_start__ = 0x0;
define symbol __ICFEDIT_region_FSMC11_end__ = 0x0;
define symbol __ICFEDIT_region_FSMC12_start__ = 0x0;
define symbol __ICFEDIT_region_FSMC12_end__ = 0x0;
define symbol __ICFEDIT_region_FSMC13_start__ = 0x0;
define symbol __ICFEDIT_region_FSMC13_end__ = 0x0;
define symbol __ICFEDIT_region_FSMC14_start__ = 0x0;
define symbol __ICFEDIT_region_FSMC14_end__ = 0x0;
define symbol __ICFEDIT_region_NAND1_start__ = 0x0;
define symbol __ICFEDIT_region_NAND1_end__ = 0x0;
define symbol __ICFEDIT_region_NAND2_start__ = 0x0;
define symbol __ICFEDIT_region_NAND2_end__ = 0x0;
define symbol __ICFEDIT_region_PCARD_start__ = 0x0;
define symbol __ICFEDIT_region_PCARD_end__ = 0x0;
define symbol __ICFEDIT_region_CCRAM_start__ = 0x10000000;
define symbol __ICFEDIT_region_CCRAM_end__ = 0x1000FFFF;
define symbol __ICFEDIT_region_SRAM1_start__ = 0x20000000;
define symbol __ICFEDIT_region_SRAM1_end__ = 0x2001BFFF;
define symbol __ICFEDIT_region_SRAM2_start__ = 0x2001C000;
define symbol __ICFEDIT_region_SRAM2_end__ = 0x2001FFFF;
define symbol __ICFEDIT_region_BKPR_start__ = 0x40024000;
define symbol __ICFEDIT_region_BKPR_end__ = 0x40024FFF;
/*-Sizes-*/
define symbol __ICFEDIT_size_cstack__ = 0x2000;
define symbol __ICFEDIT_size_heap__ = 0x2000;
/**** End of ICF editor section. ###ICF###*/
define memory mem with size = 4G;
define region FLASH_region = mem:[from __ICFEDIT_region_FLASH_start__ to __ICFEDIT_region_FLASH_end__ ];
define region FSMC_region = mem:[from __ICFEDIT_region_FSMC11_start__ to __ICFEDIT_region_FSMC11_end__]
| mem:[from __ICFEDIT_region_FSMC12_start__ to __ICFEDIT_region_FSMC12_end__]
| mem:[from __ICFEDIT_region_FSMC13_start__ to __ICFEDIT_region_FSMC13_end__]
| mem:[from __ICFEDIT_region_FSMC14_start__ to __ICFEDIT_region_FSMC14_end__];
define region NAND_region = mem:[from __ICFEDIT_region_NAND1_start__ to __ICFEDIT_region_NAND1_end__ ]
| mem:[from __ICFEDIT_region_NAND2_start__ to __ICFEDIT_region_NAND2_end__ ];
define region PCARD_region = mem:[from __ICFEDIT_region_PCARD_start__ to __ICFEDIT_region_PCARD_end__ ];
define region CCRAM_region = mem:[from __ICFEDIT_region_CCRAM_start__ to __ICFEDIT_region_CCRAM_end__ ];
define region SRAM_region = mem:[from __ICFEDIT_region_SRAM1_start__ to __ICFEDIT_region_SRAM1_end__ ]
| mem:[from __ICFEDIT_region_SRAM2_start__ to __ICFEDIT_region_SRAM2_end__ ];
define region BKPR_region = mem:[from __ICFEDIT_region_BKPR_start__ to __ICFEDIT_region_BKPR_end__ ];
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
initialize by copy { readwrite };
//initialize by copy with packing = none { section __DLIB_PERTHREAD }; // Required in a multi-threaded application
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
place in FLASH_region { readonly };
place in PCARD_region { readonly section application_specific_ro };
place in CCRAM_region { section .ccram };
place in SRAM_region { readwrite, block CSTACK, block HEAP };
place in BKPR_region { section .backup_sram };

View File

@ -3,5 +3,8 @@
<project>
<path>$WS_DIR$\wolfboot.ewp</path>
</project>
<project>
<path>$WS_DIR$\wolfboot-test-app.ewp</path>
</project>
<batchBuild />
</workspace>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,301 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<fileVersion>4</fileVersion>
<fileChecksum>2162361655</fileChecksum>
<configuration>
<name>Debug</name>
<outputs>
<file>$PROJ_DIR$\Debug\Obj\libwolfboot.o</file>
<file>$PROJ_DIR$\Debug\Obj\update_flash.o</file>
<file>$PROJ_DIR$\Debug\Obj\image.xcl</file>
<file>$PROJ_DIR$\..\..\src\image.c</file>
<file>$PROJ_DIR$\..\..\src\update_flash.c</file>
<file>$PROJ_DIR$\..\..\src\xmalloc_ecc.c</file>
<file>$PROJ_DIR$\Debug\Obj\image.o</file>
<file>$PROJ_DIR$\Debug\Obj\libwolfboot.xcl</file>
<file>$PROJ_DIR$\Debug\Obj\boot_arm.o</file>
<file>$PROJ_DIR$\Debug\Obj\loader.xcl</file>
<file>$PROJ_DIR$\Debug\Obj\update_flash.xcl</file>
<file>$PROJ_DIR$\Debug\Obj\xmalloc_ecc.xcl</file>
<file>$PROJ_DIR$\..\..\src\boot_arm.c</file>
<file>$PROJ_DIR$\Debug\Obj\string.o</file>
<file>$PROJ_DIR$\Debug\Obj\loader.o</file>
<file>$PROJ_DIR$\Debug\Obj\xmalloc_ecc.o</file>
<file>$PROJ_DIR$\Debug\Obj\string.xcl</file>
<file>$PROJ_DIR$\..\..\src\string.c</file>
<file>$PROJ_DIR$\Debug\Obj\boot_arm.xcl</file>
<file>$PROJ_DIR$\..\..\src\libwolfboot.c</file>
<file>$PROJ_DIR$\..\..\src\loader.c</file>
<file>$PROJ_DIR$\Debug\Obj\ecc256_pub_key.xcl</file>
<file>$PROJ_DIR$\Debug\Obj\ecc256_pub_key.o</file>
<file>$PROJ_DIR$\Debug\Obj\wolfboot.pbd</file>
<file>$PROJ_DIR$\..\..\hal\stm32f4.c</file>
<file>$PROJ_DIR$\..\..\lib\wolfssl\wolfcrypt\src\memory.c</file>
<file>$PROJ_DIR$\..\..\lib\wolfssl\wolfcrypt\src\ecc.c</file>
<file>$PROJ_DIR$\..\..\lib\wolfssl\wolfcrypt\src\sha.c</file>
<file>$PROJ_DIR$\..\..\lib\wolfssl\wolfcrypt\src\sp_int.c</file>
<file>$PROJ_DIR$\..\..\lib\wolfssl\wolfcrypt\src\wc_port.c</file>
<file>$PROJ_DIR$\..\..\lib\wolfssl\wolfcrypt\src\sha256.c</file>
<file>$PROJ_DIR$\..\..\lib\wolfssl\wolfcrypt\src\sp_cortexm.c</file>
<file>$PROJ_DIR$\..\..\lib\wolfssl\wolfcrypt\src\hash.c</file>
<file>$PROJ_DIR$\Debug\Exe\wolfboot.out</file>
<file>$PROJ_DIR$\Debug\Obj\sha256.o</file>
<file>$PROJ_DIR$\Debug\Obj\hash.o</file>
<file>$PROJ_DIR$\Debug\Obj\wc_port.o</file>
<file>$PROJ_DIR$\Debug\Obj\ecc.xcl</file>
<file>$PROJ_DIR$\Debug\Obj\hash.xcl</file>
<file>$PROJ_DIR$\Debug\Obj\sp_cortexm.o</file>
<file>$PROJ_DIR$\Debug\Obj\sp_int.o</file>
<file>$PROJ_DIR$\Debug\Obj\ecc.o</file>
<file>$PROJ_DIR$\Debug\Obj\memory.o</file>
<file>$PROJ_DIR$\Debug\Obj\sha.o</file>
<file>$PROJ_DIR$\Debug\Obj\sp_int.xcl</file>
<file>$PROJ_DIR$\Debug\Obj\sha256.xcl</file>
<file>$PROJ_DIR$\Debug\Obj\wc_port.xcl</file>
<file>$PROJ_DIR$\Debug\Obj\sp_cortexm.xcl</file>
<file>$PROJ_DIR$\Debug\Obj\stm32f4.xcl</file>
<file>$PROJ_DIR$\Debug\Obj\memory.xcl</file>
<file>$PROJ_DIR$\Debug\Obj\sha.xcl</file>
<file>$PROJ_DIR$\Debug\Obj\stm32f4.o</file>
<file>$PROJ_DIR$\keys\ecc256_pub_key.c</file>
</outputs>
<file>
<name>$PROJ_DIR$\..\..\src\image.c</name>
<outputs>
<tool>
<name>ICCARM</name>
<file> 6</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 2</file>
</tool>
</outputs>
</file>
<file>
<name>$PROJ_DIR$\..\..\src\update_flash.c</name>
<outputs>
<tool>
<name>ICCARM</name>
<file> 1</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 10</file>
</tool>
</outputs>
</file>
<file>
<name>$PROJ_DIR$\..\..\src\xmalloc_ecc.c</name>
<outputs>
<tool>
<name>ICCARM</name>
<file> 15</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 11</file>
</tool>
</outputs>
</file>
<file>
<name>$PROJ_DIR$\..\..\src\boot_arm.c</name>
<outputs>
<tool>
<name>ICCARM</name>
<file> 8</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 18</file>
</tool>
</outputs>
</file>
<file>
<name>$PROJ_DIR$\..\..\src\string.c</name>
<outputs>
<tool>
<name>ICCARM</name>
<file> 13</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 16</file>
</tool>
</outputs>
</file>
<file>
<name>$PROJ_DIR$\..\..\src\libwolfboot.c</name>
<outputs>
<tool>
<name>ICCARM</name>
<file> 0</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 7</file>
</tool>
</outputs>
</file>
<file>
<name>$PROJ_DIR$\..\..\src\loader.c</name>
<outputs>
<tool>
<name>ICCARM</name>
<file> 14</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 9</file>
</tool>
</outputs>
</file>
<file>
<name>$PROJ_DIR$\..\..\hal\stm32f4.c</name>
<outputs>
<tool>
<name>ICCARM</name>
<file> 51</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 48</file>
</tool>
</outputs>
</file>
<file>
<name>$PROJ_DIR$\..\..\lib\wolfssl\wolfcrypt\src\memory.c</name>
<outputs>
<tool>
<name>ICCARM</name>
<file> 42</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 49</file>
</tool>
</outputs>
</file>
<file>
<name>$PROJ_DIR$\..\..\lib\wolfssl\wolfcrypt\src\ecc.c</name>
<outputs>
<tool>
<name>ICCARM</name>
<file> 41</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 37</file>
</tool>
</outputs>
</file>
<file>
<name>$PROJ_DIR$\..\..\lib\wolfssl\wolfcrypt\src\sha.c</name>
<outputs>
<tool>
<name>ICCARM</name>
<file> 43</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 50</file>
</tool>
</outputs>
</file>
<file>
<name>$PROJ_DIR$\..\..\lib\wolfssl\wolfcrypt\src\sp_int.c</name>
<outputs>
<tool>
<name>ICCARM</name>
<file> 40</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 44</file>
</tool>
</outputs>
</file>
<file>
<name>$PROJ_DIR$\..\..\lib\wolfssl\wolfcrypt\src\wc_port.c</name>
<outputs>
<tool>
<name>ICCARM</name>
<file> 36</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 46</file>
</tool>
</outputs>
</file>
<file>
<name>$PROJ_DIR$\..\..\lib\wolfssl\wolfcrypt\src\sha256.c</name>
<outputs>
<tool>
<name>ICCARM</name>
<file> 34</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 45</file>
</tool>
</outputs>
</file>
<file>
<name>$PROJ_DIR$\..\..\lib\wolfssl\wolfcrypt\src\sp_cortexm.c</name>
<outputs>
<tool>
<name>ICCARM</name>
<file> 39</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 47</file>
</tool>
</outputs>
</file>
<file>
<name>$PROJ_DIR$\..\..\lib\wolfssl\wolfcrypt\src\hash.c</name>
<outputs>
<tool>
<name>ICCARM</name>
<file> 35</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 38</file>
</tool>
</outputs>
</file>
<file>
<name>[ROOT_NODE]</name>
<outputs>
<tool>
<name>ILINK</name>
<file> 33</file>
</tool>
</outputs>
</file>
<file>
<name>$PROJ_DIR$\keys\ecc256_pub_key.c</name>
<outputs>
<tool>
<name>ICCARM</name>
<file> 22</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 21</file>
</tool>
</outputs>
</file>
</configuration>
<configuration>
<name>Release</name>
<outputs />
<forcedrebuild>
<name>[MULTI_TOOL]</name>
<tool>ILINK</tool>
</forcedrebuild>
</configuration>
</project>

View File

@ -44,7 +44,7 @@
</option>
<option>
<name>MemFile</name>
<state></state>
<state>$TOOLKIT_DIR$\CONFIG\debugger\ST\STM32F407VG.ddf</state>
</option>
<option>
<name>RunToEnable</name>
@ -84,11 +84,11 @@
</option>
<option>
<name>OCDynDriverList</name>
<state>ARMSIM_ID</state>
<state>STLINK_ID</state>
</option>
<option>
<name>OCLastSavedByProductVersion</name>
<state></state>
<state>8.50.1.24770</state>
</option>
<option>
<name>UseFlashLoader</name>
@ -112,7 +112,7 @@
</option>
<option>
<name>FlashLoadersV3</name>
<state></state>
<state>$TOOLKIT_DIR$\config\flashloader\ST\FlashSTM32F4xxx.board</state>
</option>
<option>
<name>OCImagesSuppressCheck1</name>
@ -180,7 +180,7 @@
</option>
<option>
<name>OCMulticoreNrOfCores</name>
<state></state>
<state>1</state>
</option>
<option>
<name>OCMulticoreWorkspace</name>
@ -1029,7 +1029,7 @@
</option>
<option>
<name>CCCpuClockEdit</name>
<state></state>
<state>168.0</state>
</option>
<option>
<name>CCSwoClockAuto</name>

View File

@ -655,15 +655,15 @@
<option>
<name>OOCOutputFormat</name>
<version>3</version>
<state>0</state>
<state>3</state>
</option>
<option>
<name>OCOutputOverride</name>
<state>0</state>
<state>1</state>
</option>
<option>
<name>OOCOutputFile</name>
<state></state>
<state>wolfboot.bin</state>
</option>
<option>
<name>OOCCommandLineProducer</name>
@ -671,7 +671,7 @@
</option>
<option>
<name>OOCObjCopyEnable</name>
<state>0</state>
<state>1</state>
</option>
</data>
</settings>
@ -2160,12 +2160,6 @@
<name>$PROJ_DIR$\..\..\include\user_settings.h</name>
</file>
</group>
<group>
<name>keys</name>
<file>
<name>$PROJ_DIR$\keys\ecc256_pub_key.c</name>
</file>
</group>
<group>
<name>lib</name>
<group>
@ -2201,6 +2195,9 @@
<file>
<name>$PROJ_DIR$\..\..\src\boot_arm.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\src\ecc256_pub_key.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\src\image.c</name>
</file>

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@ -28,8 +28,8 @@
#define PLL_FULL_MASK (0x7F037FFF)
/* Assembly helpers */
#define DMB() __asm__ volatile ("dmb");
#define WFI() __asm__ volatile ("wfi");
#define DMB() asm volatile ("dmb");
#define WFI() asm volatile ("wfi");
/* Master clock setting */
void clock_config(void);

View File

@ -88,7 +88,7 @@ int pwm_init(uint32_t clock, uint32_t threshold)
lvl--;
APB1_CLOCK_RST |= TIM4_APB1_CLOCK_ER_VAL;
__asm__ volatile ("dmb");
asm volatile ("dmb");
APB1_CLOCK_RST &= ~TIM4_APB1_CLOCK_ER_VAL;
APB1_CLOCK_ER |= TIM4_APB1_CLOCK_ER_VAL;
@ -106,7 +106,7 @@ int pwm_init(uint32_t clock, uint32_t threshold)
TIM4_CCMR2 |= TIM_CCMR2_OC4M_PWM1;
TIM4_CCER |= TIM_CCER_CC4_ENABLE;
TIM4_CR1 |= TIM_CR1_CLOCK_ENABLE | TIM_CR1_ARPE;
__asm__ volatile ("dmb");
asm volatile ("dmb");
return 0;
}
@ -133,17 +133,17 @@ int timer_init(uint32_t clock, uint32_t prescaler, uint32_t interval_ms)
nvic_irq_enable(NVIC_TIM2_IRQN);
nvic_irq_setprio(NVIC_TIM2_IRQN, 0);
APB1_CLOCK_RST |= TIM2_APB1_CLOCK_ER_VAL;
__asm__ volatile ("dmb");
asm volatile ("dmb");
APB1_CLOCK_RST &= ~TIM2_APB1_CLOCK_ER_VAL;
APB1_CLOCK_ER |= TIM2_APB1_CLOCK_ER_VAL;
TIM2_CR1 = 0;
__asm__ volatile ("dmb");
asm volatile ("dmb");
TIM2_PSC = psc;
TIM2_ARR = val;
TIM2_CR1 |= TIM_CR1_CLOCK_ENABLE;
TIM2_DIER |= TIM_DIER_UIE;
__asm__ volatile ("dmb");
asm volatile ("dmb");
return 0;
}