mirror of https://github.com/wolfSSL/wolfBoot.git
Add TSIP
parent
81fb762fa7
commit
030073d990
|
|
@ -1,5 +1,7 @@
|
|||
## wolfBoot for Renesas RX72N
|
||||
|
||||
#define BSP_CFG_USTACK_BYTES (0x2000)
|
||||
|
||||
```
|
||||
MCU: Renesas RX72N
|
||||
Board: RX72N/Envision Kit
|
||||
|
|
@ -7,16 +9,25 @@ IDE: e2Studio
|
|||
Compiler: CCRX
|
||||
FIT Module: r_flash_rx
|
||||
|
||||
Optional:
|
||||
Flash Wirter: Renesas Flash Programmer v3
|
||||
|
||||
e2Studio Project:
|
||||
wolfBoot IDE/Renesas/e2studio_CCRX/wolfBoot
|
||||
Sample app IDE/Renesas/e2studio_CCRX/app_RenesasRX01
|
||||
|
||||
Key tool:
|
||||
Key generation tools/keytools/keygen
|
||||
Signature tools/keytools/sign
|
||||
Other Tools:
|
||||
- Key tool
|
||||
Key generation tools/keytools/keygen
|
||||
Signature tools/keytools/sign
|
||||
Included in wolfBoot with source code
|
||||
|
||||
- Flash Wirter
|
||||
Renesas Flash Programmer v3
|
||||
Download from Renesas site
|
||||
|
||||
- Binary tool:
|
||||
rx-elf-objcopy.exe
|
||||
Included in GCC for Renesas RX
|
||||
|
||||
|
||||
Flash Allocation:
|
||||
+---------------------------+------------------------+-----+
|
||||
|
|
@ -49,13 +60,14 @@ board for the debugger and flash programmer.
|
|||
### 1) Key generation
|
||||
|
||||
```
|
||||
$ cd <wolfBoot>
|
||||
$ export PATH:$PATH:<wolfBoot>/tools/keytools
|
||||
$ keygen --ed255519 -g ./pri-ed25519.der
|
||||
$ keygen --ecc256 -g ./pri-ecc256.der
|
||||
```
|
||||
|
||||
It generates a pair of private and public key with -g option. The private
|
||||
key is stored in the specified file. The public key is stored in a key store
|
||||
as a C source code soo that it can be compiled and linked with wolfBoot.
|
||||
It generates a pair of private and public key with -g option. The private key is stored
|
||||
in the specified file. The public key is stored in a key store as a C source code
|
||||
in "src/keystore.c" soo that it can be compiled and linked with wolfBoot.
|
||||
If you have an existing key pair, you can use -i option to import the pablic
|
||||
key to the store.
|
||||
|
||||
|
|
@ -111,7 +123,8 @@ Include Paths
|
|||
"C:..\..\..\..\..\wolfBoot\wolfboot\include"
|
||||
|
||||
Pre-Include
|
||||
../../../../../include/user_settings.h
|
||||
../../include/user_settings.h
|
||||
../../include/terget.h
|
||||
|
||||
Code Origin and entry point (PResetPRG) is "0xffc10100" (See Section Viewer of Linker Section).
|
||||
```
|
||||
|
|
@ -135,15 +148,14 @@ contain generated signature and other control fields. Output file name is made u
|
|||
the input file name and version like app_RenesasRx01_v1.0_signed.bin.
|
||||
|
||||
```
|
||||
$ sign --ed25519 app_RenesasRx01.bin ../../../../../pri-ed25519.der 1.0
|
||||
ed25519.der 1.0
|
||||
$ sign --ecc256 app_RenesasRx01.bin ../../../../../pri-ecc256.der 1.0 ecc256.der 1.0
|
||||
wolfBoot KeyTools (Compiled C version)
|
||||
wolfBoot version 10B0000
|
||||
Update type: Firmware
|
||||
Input image: app_RenesasRx.bin
|
||||
Selected cipher: ED25519
|
||||
Selected cipher: ECC256
|
||||
Selected hash : SHA256
|
||||
Public key: ed25519.der
|
||||
Public key: ecc256.der
|
||||
Output image: app_RenesasRx_v1.0_signed.bin
|
||||
Target partition id : 1
|
||||
Calculating SHA256 digest...
|
||||
|
|
@ -210,7 +222,7 @@ You can download it by the flash programmer.
|
|||
|
||||
|
||||
```
|
||||
$ sign --ed25519 app_RenesasRx01.bin ../../../../../pri-ed25519.der 2.0
|
||||
$ sign --ecc256 app_RenesasRx01.bin ../../../../../pri-ecc256.der 2.0
|
||||
rx-elf-objcopy.exe -I binary -O srec --change-addresses=0xffdf0000 app_RenesasRx01_v2.0_signed.bin app_RenesasRx01_v2.0_signed.hex
|
||||
```
|
||||
|
||||
|
|
@ -235,7 +247,7 @@ wolfBoot_update_trigger() whcih changes the partition status and triggers
|
|||
updating the firmware.
|
||||
|
||||
Since this is just a trigger, the application can continue the process.
|
||||
In the demo application it outputs a message "Update Triggered" and enters
|
||||
In the demo application it outputs a message "Firmware Update is triggered" and enters
|
||||
a infinit loop of nop.
|
||||
|
||||
Now you can re-boot it by start wolfBoot by e2Studion debugger. The boot
|
||||
|
|
@ -255,3 +267,7 @@ Hit any key to update the firmware.
|
|||
|
||||
Not the application behavior is almost identical but the Version is "2" this time.
|
||||
|
||||
|
||||
|
||||
## Creating an application project from scratch
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,189 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||
<cconfiguration id="com.renesas.cdt.managedbuild.renesas.ccrx.hardwaredebug.configuration.2080551843">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.renesas.cdt.managedbuild.renesas.ccrx.hardwaredebug.configuration.2080551843" moduleId="org.eclipse.cdt.core.settings" name="HardwareDebug">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.renesas.cdt.managedbuild.renesas.core.RenesasCompilerAssemblerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="com.renesas.cdt.managedbuild.core.buildRunnerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="com.renesas.cdt.managedbuild.core.toolchainInfo">
|
||||
<option id="toolchain.id" value="Renesas_RXC"/>
|
||||
<option id="toolchain.version" value="v3.04.00"/>
|
||||
<option id="toolchain.enable" value="true"/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="com.renesas.cdt.managedbuild.core.boardInfo">
|
||||
<option id="board.id" value="EnvisionKitRX72N"/>
|
||||
<option id="board.name" value="EnvisionKitRX72N"/>
|
||||
<option id="board.device" value="R5F572NNHxFB"/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactExtension="abs" artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" description="Debug on hardware" id="com.renesas.cdt.managedbuild.renesas.ccrx.hardwaredebug.configuration.2080551843" name="HardwareDebug" parent="com.renesas.cdt.managedbuild.renesas.ccrx.hardwaredebug.configuration">
|
||||
<folderInfo id="com.renesas.cdt.managedbuild.renesas.ccrx.hardwaredebug.configuration.2080551843." name="/" resourcePath="">
|
||||
<toolChain id="com.renesas.cdt.managedbuild.renesas.ccrx.hardwaredebug.toolChain.164292875" name="Renesas CCRX Toolchain" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.hardwaredebug.toolChain">
|
||||
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.PE" id="com.renesas.cdt.managedbuild.renesas.ccrx.base.targetPlatform.844357704" osList="win32" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.targetPlatform"/>
|
||||
<builder buildPath="${workspace_loc:/app_RenesasRX01}/HardwareDebug" id="com.renesas.cdt.managedbuild.renesas.ccrx.base.builder.1284874934" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CCRX Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.builder"/>
|
||||
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.dsp.1266792918" name="DSP Assembler" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.dsp">
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.dsp.option.noDebugInfo.1415450496" name="デバッグ情報を出力する (-no_debug_info)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.dsp.option.noDebugInfo" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.dsp.option.endian.530759574" name="出力するデータ値のエンディアン (-littleEndianData)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.dsp.option.endian" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.dsp.option.endian.big" valueType="enumerated"/>
|
||||
</tool>
|
||||
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.common.1247054741" name="Common" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.common">
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.isa.1577719632" name="命令セット・アーキテクチャ (-isa)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.isa" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.isa.rxv3" valueType="enumerated"/>
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.rxArchitecture.1069022681" name="RX Architecture" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.rxArchitecture" useByScannerDiscovery="false" value="rxv3" valueType="string"/>
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.floatIns.460218324" name="浮動小数点演算命令を使用する (-fpu/-nofpu)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.floatIns" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.floatIns.yes" valueType="enumerated"/>
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.hasFpu.1296526477" name="Has FPU" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.hasFpu" useByScannerDiscovery="false" value="TRUE" valueType="string"/>
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.doublePrecisionFPU.311154493" name="倍精度浮動小数点処理命令を使用する (-dpfpu/-nodpfpu)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.doublePrecisionFPU" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceName.329143673" name="Device Name" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceName" useByScannerDiscovery="false" value="R5F572NNHxFB" valueType="string"/>
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceHistory.1509491138" name="Device history" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceHistory" useByScannerDiscovery="false" value="non_init;R5F572NNHxFB" valueType="string"/>
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.isaHistory.1262303676" name="ISA history" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.isaHistory" useByScannerDiscovery="false" value="non_init;com.renesas.cdt.managedbuild.renesas.ccrx.common.option.isa.rxv3" valueType="string"/>
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceCommand.1366931582" name="Device Command" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceCommand" useByScannerDiscovery="false" value="R5F572NN" valueType="string"/>
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.checkRtos.689815177" name="Check RTOS" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.checkRtos" useByScannerDiscovery="false" value="unusedRtos" valueType="string"/>
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.hasDsp.263028732" name="Has DSP" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.hasDsp" useByScannerDiscovery="false" value="false" valueType="string"/>
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceFamily.1599885717" name="Device Family" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.deviceFamily" useByScannerDiscovery="false" value="RX72N" valueType="string"/>
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.hasTFU.892967172" name="Has TFU" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.common.option.hasTFU" useByScannerDiscovery="false" value="true" valueType="string"/>
|
||||
</tool>
|
||||
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.compiler.1305201235" name="Compiler" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.compiler">
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.fpu.126437015" name="浮動小数点演算命令を使用する (-fpu/-nofpu)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.fpu" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.fpu.yes" valueType="enumerated"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.include.2039443943" name="インクルード・ファイルを検索するフォルダ (-include)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.include" useByScannerDiscovery="false" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value="../../include"/>
|
||||
<listOptionValue builtIn="false" value="../../../../../include"/>
|
||||
<listOptionValue builtIn="false" value="../../../../../lib/wolfssl"/>
|
||||
<listOptionValue builtIn="false" value="${TCINSTALL}/include"/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/general}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_pincfg}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_bsp}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_config}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_flash_rx}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_flash_rx/src}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_flash_rx/src/flash_type_1}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_flash_rx/src/flash_type_3}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_flash_rx/src/flash_type_4}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_flash_rx/src/targets}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_sci_rx}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_sci_rx/src}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_byteq}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_byteq/src}""/>
|
||||
</option>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.userBefore.593899317" name="追加するオプション(すべての指定オプションの前に追加)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.userBefore" useByScannerDiscovery="false" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value=""/>
|
||||
</option>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.userAfter.931903567" name="追加するオプション(すべての指定オプションの後ろに追加)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.userAfter" useByScannerDiscovery="false" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value=""/>
|
||||
</option>
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.langFileC.1716403307" name="Cソース (-lang)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.langFileC" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.langFileC.c99" valueType="enumerated"/>
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.inputCharCode.1023095191" name="プログラムの文字コード (-euc/-sjis/-latin1/-utf8/-big5/-gb2312)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.inputCharCode" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.inputCharCode.utf8" valueType="enumerated"/>
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.outcode.2063458115" name="出力する文字コード (-outcode)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.outcode" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.outcode.utf8" valueType="enumerated"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.preInclude.1864441952" name="コンパイル単位の先頭にインクルードするファイル (-preinclude)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.preInclude" useByScannerDiscovery="false" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="../../include/user_settings.h"/>
|
||||
<listOptionValue builtIn="false" value="../../include/target.h"/>
|
||||
</option>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="true" id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.define.1700820161" name="プリプロセッサ・マクロの定義 (-define)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.define" useByScannerDiscovery="false" valueType="definedSymbols"/>
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.optimize.467816924" name="最適化レベル (-optimize)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.optimize" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.optimize.level0" valueType="enumerated"/>
|
||||
<inputType id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.gcc.inputType.234428537" name="Compiler Input C" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.gcc.inputType"/>
|
||||
<inputType id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.gpp.inputType.1840988365" name="Compiler Input CPP" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.gpp.inputType"/>
|
||||
</tool>
|
||||
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.assembler.335600569" name="Assembler" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.assembler">
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.option.userBefore.2134128567" name="追加するオプション(すべての指定オプションの前に追加)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.option.userBefore" useByScannerDiscovery="false" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value=""/>
|
||||
</option>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.option.userAfter.1346757140" name="追加するオプション(すべての指定オプションの後ろに追加) " superClass="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.option.userAfter" useByScannerDiscovery="false" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value=""/>
|
||||
</option>
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.option.characterCode.1220602780" name="プログラムの文字コード (-euc/-sjis/-latin1/-utf8/-big5/-gb2312)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.option.characterCode" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.option.characterCode.utf8" valueType="enumerated"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.option.include.1349197240" name="インクルード・ファイルを検索するフォルダ (-include)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.option.include" useByScannerDiscovery="false" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/general}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_pincfg}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_bsp}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_config}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_flash_rx}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_flash_rx/src}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_flash_rx/src/flash_type_1}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_flash_rx/src/flash_type_3}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_flash_rx/src/flash_type_4}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_flash_rx/src/targets}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_sci_rx}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_sci_rx/src}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_byteq}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_byteq/src}""/>
|
||||
</option>
|
||||
<inputType id="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.inputType.28002024" name="Assembler InputType" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.inputType"/>
|
||||
</tool>
|
||||
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.linker.1214052278" name="Linker" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.linker">
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.rom.1533597821" name="ROMからRAMへマップするセクション (-rom)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.rom" useByScannerDiscovery="false" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="D=R"/>
|
||||
<listOptionValue builtIn="false" value="D_1=R_1"/>
|
||||
<listOptionValue builtIn="false" value="D_2=R_2"/>
|
||||
<listOptionValue builtIn="false" value="D_8=R_8"/>
|
||||
<listOptionValue builtIn="false" value="PFRAM=RPFRAM"/>
|
||||
</option>
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.linkerSection.1211806072" name="セクション (-start)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.linkerSection" useByScannerDiscovery="false" value="SU,SI,B_1,R_1,B_2,R_2,B,R,B_8,R_8,RPFRAM,RPFRAM2/04,PResetPRG,C_1,C_2,C,C_8,C$*,D*,W*,L,P,PFRAM,PFRAM2/0FFC10200,EXCEPTVECT/0FFFFFF80,RESETVECT/0FFFFFFFC" valueType="string"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.userBefore.1217567016" name="追加するオプション(すべての指定オプションの前に追加)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.userBefore" useByScannerDiscovery="false" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value=""/>
|
||||
</option>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.userAfter.1134350809" name="追加するオプション(すべての指定オプションの後ろに追加)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.userAfter" useByScannerDiscovery="false" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value=""/>
|
||||
</option>
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.vect.1931487935" name="可変ベクタテーブルのアドレス未設定ベクタ番号に指定するアドレス (-vect)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.vect" useByScannerDiscovery="false" value="_undefined_interrupt_source_isr" valueType="string"/>
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.checkSection.140974100" name="セクションの割り付けアドレスをチェックする (-cpu)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.checkSection" useByScannerDiscovery="false" value="true" valueType="boolean"/>
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.memoryType.1210271160" name="アドレス範囲指定方法 (-cpu(アドレス範囲指定方法))" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.memoryType" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.memoryType.autoSpecify" valueType="enumerated"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.noneLinkageOrderList.2135498774" name="(リンク順序のリスト) (-input/-library/-binary)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.noneLinkageOrderList" useByScannerDiscovery="false" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="".\app_RenesasRX01.lib""/>
|
||||
</option>
|
||||
</tool>
|
||||
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.librarian.1663136357" name="Library Generator" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.librarian">
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.fpu.794310030" name="浮動小数点演算命令を使用する (-fpu/-nofpu)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.fpu" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.fpu.yes" valueType="enumerated"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.userBefore.346661763" name="追加するオプション(すべての指定オプションの前に追加)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.userBefore" useByScannerDiscovery="false" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value=""/>
|
||||
</option>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.userAfter.176086953" name="追加するオプション(すべての指定オプションの後ろに追加)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.userAfter" useByScannerDiscovery="false" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value=""/>
|
||||
</option>
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.lang.1980410131" name="C言語標準ライブラリ関数の構成 (-lang)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.lang" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.lang.c99" valueType="enumerated"/>
|
||||
</tool>
|
||||
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.converter.1261529969" name="Converter" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.converter">
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.converter.option.userBefore.1841151594" name="追加するオプション(すべての指定オプションの前に追加)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.converter.option.userBefore" useByScannerDiscovery="false" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value=""/>
|
||||
</option>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.converter.option.userAfter.1101204273" name="追加するオプション(すべての指定オプションの後ろに追加)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.converter.option.userAfter" useByScannerDiscovery="false" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value=""/>
|
||||
</option>
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.converter.option.typeOfOutputFile.991923524" name="出力ファイル形式 (-form)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.converter.option.typeOfOutputFile" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.converter.option.typeOFOutputFile.none" valueType="enumerated"/>
|
||||
</tool>
|
||||
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.rtosConfig.901290638" name="RTOS Configurator" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.rtosConfig"/>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="src"/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<project id="app_RenesasRX01.com.renesas.cdt.managedbuild.renesas.ccrx.projectType.1255548274" name="実行可能" projectType="com.renesas.cdt.managedbuild.renesas.ccrx.projectType"/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="scannerConfiguration">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.language.mapping">
|
||||
<project-mappings>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cHeader" language="com.renesas.cdt.managedbuild.renesas.core.extendc"/>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cSource" language="com.renesas.cdt.managedbuild.renesas.core.extendc"/>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxHeader" language="com.renesas.cdt.managedbuild.renesas.core.extendcpp"/>
|
||||
<content-type-mapping configuration="" content-type="org.eclipse.cdt.core.cxxSource" language="com.renesas.cdt.managedbuild.renesas.core.extendcpp"/>
|
||||
</project-mappings>
|
||||
</storageModule>
|
||||
<storageModule moduleId="refreshScope" versionNumber="2">
|
||||
<configuration configurationName="HardwareDebug">
|
||||
<resource resourceType="PROJECT" workspacePath="/app_RenesasRX01"/>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
|
||||
</cproject>
|
||||
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
static void printPart(uint8_t *part)
|
||||
{
|
||||
#ifdef WOLFBOOT_PARTION_VERBOS
|
||||
#ifdef WOLFBOOT_DEBUG_PARTION
|
||||
uint32_t *v;
|
||||
int i;
|
||||
#endif
|
||||
|
|
@ -47,23 +47,13 @@ static void printPart(uint8_t *part)
|
|||
magic = part + WOLFBOOT_PARTITION_SIZE - sizeof(uint32_t);
|
||||
printf("Tail Mgc: %c%c%c%c\n", magic[0], magic[1], magic[2], magic[3]);
|
||||
|
||||
#ifdef PARTIION_VERBOS
|
||||
#ifdef WOLFBOOT_DEBUG_PARTION
|
||||
v = (uint32_t *)part;
|
||||
for(i = 0; i < 0x100/4; i++) {
|
||||
if(i % 4 == 0)
|
||||
print("\n%08x: ", (uint32_t)v+i*4);
|
||||
print("%08x ", v[i]);
|
||||
}
|
||||
|
||||
print("\n\nImage:");
|
||||
|
||||
for( ; i < 0x100/4 + 16; i++) {
|
||||
if(i % 4 == 0)
|
||||
print("\n%08x: ", (uint32_t)v+i*4);
|
||||
print("%08x ", v[i]);
|
||||
}
|
||||
|
||||
print("\n\n");
|
||||
#endif
|
||||
|
||||
}
|
||||
|
|
@ -74,7 +64,7 @@ static void printPartitions(void)
|
|||
printf("\n=== Boot Partition[%08x] ===\n", WOLFBOOT_PARTITION_BOOT_ADDRESS);
|
||||
printPart((uint8_t*)WOLFBOOT_PARTITION_BOOT_ADDRESS);
|
||||
printf("\n=== Update Partition[%08x] ===\n", WOLFBOOT_PARTITION_UPDATE_ADDRESS);
|
||||
printPart((uint8_t*)WOLFBOOT_PARTITION_UPDATE_ADDRESS);
|
||||
//printPart((uint8_t*)WOLFBOOT_PARTITION_UPDATE_ADDRESS);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,86 @@
|
|||
/* target.h
|
||||
*
|
||||
* User configurable build-time options for bootloader and application offsets
|
||||
*
|
||||
* target.h is automatically generated using the template in target.h.in by running
|
||||
* "make config".
|
||||
*
|
||||
* Copyright (C) 2021 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfBoot.
|
||||
*
|
||||
* wolfBoot is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* wolfBoot is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
||||
*/
|
||||
|
||||
#ifndef H_TARGETS_TARGET_
|
||||
#define H_TARGETS_TARGET_
|
||||
|
||||
#ifndef WOLFBOOT_NO_PARTITIONS
|
||||
# define WOLFBOOT_FIXED_PARTITIONS
|
||||
#endif
|
||||
|
||||
#define WOLFBOOT_FLASH_ADDR 0xffc00000
|
||||
#define WOLFBOOT_FLASH_SIZE (0x100000000 - WOLFBOOT_FLASH_ADDR)
|
||||
|
||||
#if defined(WOLFBOOT_RENESAS_TSIP)
|
||||
|
||||
#define WOLFBOOT_BOOT_SIZE 0x50000
|
||||
#define WOLFBOOT_RX_EXCVECT 0x10000
|
||||
#define WOLFBOOT_SECTOR_SIZE 0x20000
|
||||
|
||||
#define WOLFBOOT_PARTITION_SIZE\
|
||||
((WOLFBOOT_FLASH_SIZE - WOLFBOOT_BOOT_SIZE -\
|
||||
WOLFBOOT_RX_EXCVECT - WOLFBOOT_SECTOR_SIZE) / 2)
|
||||
|
||||
#define WOLFBOOT_PARTITION_BOOT_ADDRESS\
|
||||
(WOLFBOOT_FLASH_ADDR + WOLFBOOT_BOOT_SIZE)
|
||||
#define WOLFBOOT_PARTITION_UPDATE_ADDRESS\
|
||||
(WOLFBOOT_PARTITION_BOOT_ADDRESS + WOLFBOOT_PARTITION_SIZE)
|
||||
#define WOLFBOOT_PARTITION_SWAP_ADDRESS\
|
||||
(WOLFBOOT_PARTITION_UPDATE_ADDRESS + WOLFBOOT_PARTITION_SIZE)
|
||||
|
||||
#elif defined(WOLFBOOT_DUALBOOT)
|
||||
|
||||
#define WOLFBOOT_BOOT_SIZE 0x10000
|
||||
#define WOLFBOOT_RX_EXCVECT 0x10000
|
||||
#define WOLFBOOT_SECTOR_SIZE 0x0
|
||||
|
||||
#define WOLFBOOT_PARTITION_SIZE WOLFBOOT_FLASH_SIZE/2 - WOLFBOOT_BOOT_SIZE
|
||||
|
||||
#define WOLFBOOT_PARTITION_BOOT_ADDRESS\
|
||||
(WOLFBOOT_FLASH_ADDR + WOLFBOOT_BOOT_SIZE)
|
||||
#define WOLFBOOT_PARTITION_UPDATE_ADDRESS\
|
||||
(WOLFBOOT_FLASH_ADDR + WOLFBOOT_FLASH_SIZE/2 + WOLFBOOT_BOOT_SIZE)
|
||||
|
||||
#define WOLFBOOT_PARTITION_SWAP_ADDRESS 0x0
|
||||
|
||||
#else
|
||||
#define WOLFBOOT_BOOT_SIZE 0x10000
|
||||
#define WOLFBOOT_RX_EXCVECT 0x10000
|
||||
#define WOLFBOOT_SECTOR_SIZE 0x20000
|
||||
|
||||
#define WOLFBOOT_PARTITION_SIZE\
|
||||
((WOLFBOOT_FLASH_SIZE - WOLFBOOT_BOOT_SIZE -\
|
||||
WOLFBOOT_RX_EXCVECT - WOLFBOOT_SECTOR_SIZE) / 2)
|
||||
|
||||
#define WOLFBOOT_PARTITION_BOOT_ADDRESS\
|
||||
(WOLFBOOT_FLASH_ADDR + WOLFBOOT_BOOT_SIZE)
|
||||
#define WOLFBOOT_PARTITION_UPDATE_ADDRESS\
|
||||
(WOLFBOOT_PARTITION_BOOT_ADDRESS + WOLFBOOT_PARTITION_SIZE)
|
||||
#define WOLFBOOT_PARTITION_SWAP_ADDRESS\
|
||||
(WOLFBOOT_PARTITION_UPDATE_ADDRESS + WOLFBOOT_PARTITION_SIZE)
|
||||
#endif
|
||||
|
||||
#endif /* !H_TARGETS_TARGET_ */
|
||||
|
|
@ -0,0 +1,304 @@
|
|||
/* user_settings.h
|
||||
*
|
||||
* Custom configuration for wolfCrypt/wolfSSL.
|
||||
* Enabled via WOLFSSL_USER_SETTINGS.
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2021 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfBoot.
|
||||
*
|
||||
* wolfBoot is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* wolfBoot is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
|
||||
*/
|
||||
|
||||
#ifndef H_USER_SETTINGS_
|
||||
#define H_USER_SETTINGS_
|
||||
|
||||
|
||||
//#define WOLFBOOT_RENESAS_TSIP
|
||||
//#define WOLFBOOT_DUALBOOT
|
||||
|
||||
#ifdef WOLFBOOT_RENESAS_TSIP
|
||||
#define WOLFSSL_RENESAS_TSIP_SIGNATURE // Current version support only RSA2048
|
||||
#define WOLFSSL_NO_SW_MATH
|
||||
#define WOLFBOOT_SIGN_RSA2048
|
||||
#else
|
||||
/* #define WOLFBOOT_SIGN_RSA2048 */
|
||||
/* #defube WOLFBOOT_SIGN_RSA3072 */
|
||||
/* #defube WOLFBOOT_SIGN_RSA4096 */
|
||||
/* #define WOLFBOOT_SIGN_ED25519 */
|
||||
/* #define WOLFBOOT_SIGN_ED488 */
|
||||
#define WOLFBOOT_SIGN_ECC256
|
||||
/* #define WOLFBOOT_SIGN_ECC384 */
|
||||
/* #define WOLFBOOT_SIGN_ECC521 */
|
||||
#endif
|
||||
|
||||
#define WOLFBOOT_FIXED_PARTITIONS
|
||||
|
||||
#ifdef WOLFBOOT_DUALBOOT
|
||||
#define FLASH_IN_DUAL_BANK_MODE (1)
|
||||
#define DUALBANK_SWAP
|
||||
#endif
|
||||
|
||||
#define WOLFBOOT_HASH_SHA256
|
||||
|
||||
#include "rx72n/r_flash_rx72n.h"
|
||||
|
||||
#define FLASHBUFFER_SIZE WOLFBOOT_SECTOR_SIZE
|
||||
#define WOLFSSL_HAVE_MIN
|
||||
#define WOLFSSL_HAVE_MAX
|
||||
#define WC_NO_RNG_SIMPLE
|
||||
|
||||
#define WOLFSSL_USER_SETTINGS /* for renesas-tsip-crypt.h */
|
||||
#define WOLFSSL_SP_MATH_ALL /* for sp_int.c */
|
||||
//#define USE_FAST_MATH
|
||||
/* System */
|
||||
#define WOLFSSL_GENERAL_ALIGNMENT 4
|
||||
#define SINGLE_THREADED
|
||||
#define WOLFCRYPT_ONLY
|
||||
#define SIZEOF_LONG_LONG 8
|
||||
|
||||
#ifdef USE_FAST_MATH
|
||||
# define WC_NO_HARDEN
|
||||
#endif
|
||||
|
||||
#if defined(WOLFBOOT_SIGN_RSA2048) || defined(WOLFBOOT_SIGN_RSA3072) || defined(WOLFBOOT_SIGN_ED448)
|
||||
#define IMAGE_HEADER_SIZE 512
|
||||
#elif defined(WOLFBOOT_SIGN_RSA4096)
|
||||
#define IMAGE_HEADER_SIZE 1024
|
||||
#endif
|
||||
|
||||
/* ED25519 and SHA512 */
|
||||
#ifdef WOLFBOOT_SIGN_ED25519
|
||||
# define HAVE_ED25519
|
||||
# define ED25519_SMALL
|
||||
# define NO_ED25519_SIGN
|
||||
# define NO_ED25519_EXPORT
|
||||
# define WOLFSSL_SHA512
|
||||
# define USE_SLOW_SHA512
|
||||
# define NO_RSA
|
||||
# define NO_ASN
|
||||
#endif
|
||||
|
||||
/* ED448 */
|
||||
#ifdef WOLFBOOT_SIGN_ED448
|
||||
# define HAVE_ED448
|
||||
# define HAVE_ED448_VERIFY
|
||||
# define ED448_SMALL
|
||||
# define NO_ED448_SIGN
|
||||
# define NO_ED448_EXPORT
|
||||
# define NO_RSA
|
||||
# define NO_ASN
|
||||
# define WOLFSSL_SHA3
|
||||
# define WOLFSSL_SHAKE256
|
||||
#endif
|
||||
|
||||
/* ECC and SHA256 */
|
||||
#if defined (WOLFBOOT_SIGN_ECC256) ||\
|
||||
defined (WOLFBOOT_SIGN_ECC384) ||\
|
||||
defined (WOLFBOOT_SIGN_ECC521)
|
||||
# define HAVE_ECC
|
||||
# define ECC_TIMING_RESISTANT
|
||||
|
||||
|
||||
|
||||
/* Kinetis LTC support */
|
||||
# ifdef FREESCALE_USE_LTC
|
||||
# define LTC_MAX_ECC_BITS (256)
|
||||
# define LTC_MAX_INT_BYTES (128)
|
||||
# ifndef LTC_BASE
|
||||
# define LTC_BASE ((LTC_Type *)LTC0_BASE)
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* SP MATH */
|
||||
#ifndef WOLFSSL_NO_SW_MATH
|
||||
# ifndef USE_FAST_MATH
|
||||
# define WOLFSSL_SP
|
||||
# define WOLFSSL_SP_MATH
|
||||
# define WOLFSSL_SP_SMALL
|
||||
# define SP_WORD_SIZE 32
|
||||
# define WOLFSSL_HAVE_SP_ECC
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* ECC options disabled to reduce size */
|
||||
# define NO_ECC_SIGN
|
||||
# define NO_ECC_EXPORT
|
||||
# define NO_ECC_DHE
|
||||
# define NO_ECC_KEY_EXPORT
|
||||
|
||||
/* Curve */
|
||||
# define NO_ECC192
|
||||
# define NO_ECC224
|
||||
#ifdef WOLFBOOT_SIGN_ECC256
|
||||
# define HAVE_ECC256
|
||||
# define FP_MAX_BITS (256 + 32)
|
||||
# define NO_ECC384
|
||||
# define NO_ECC521
|
||||
#elif defined WOLFBOOT_SIGN_ECC384
|
||||
# define HAVE_ECC384
|
||||
# define FP_MAX_BITS (1024 + 32)
|
||||
# define WOLFSSL_SP_384
|
||||
# define WOLFSSL_SP_NO_256
|
||||
# define NO_ECC256
|
||||
# define NO_ECC521
|
||||
#elif defined WOLFBOOT_SIGN_ECC521
|
||||
# define HAVE_ECC521
|
||||
# define FP_MAX_BITS (544 + 32)
|
||||
# define NO_ECC256
|
||||
# define NO_ECC384
|
||||
#endif
|
||||
|
||||
# define NO_RSA
|
||||
# define NO_ASN
|
||||
#endif
|
||||
|
||||
#ifdef WOLFBOOT_SIGN_RSA2048
|
||||
# define RSA_LOW_MEM
|
||||
# define WOLFSSL_RSA_VERIFY_INLINE
|
||||
# define WOLFSSL_RSA_VERIFY_ONLY
|
||||
# define WC_NO_RSA_OAEP
|
||||
# define FP_MAX_BITS (2048 * 2)
|
||||
/* sp math */
|
||||
#ifndef WOLFSSL_NO_SW_MATH
|
||||
# ifndef USE_FAST_MATH
|
||||
# define WOLFSSL_HAVE_SP_RSA
|
||||
# define WOLFSSL_SP
|
||||
# define WOLFSSL_SP_SMALL
|
||||
# define WOLFSSL_SP_MATH
|
||||
# define SP_WORD_SIZE 32
|
||||
# define WOLFSSL_SP_NO_3072
|
||||
# define WOLFSSL_SP_NO_4096
|
||||
# endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef WOLFBOOT_SIGN_RSA3072
|
||||
# define RSA_LOW_MEM
|
||||
# define WOLFSSL_RSA_VERIFY_INLINE
|
||||
# define WOLFSSL_RSA_VERIFY_ONLY
|
||||
# define WC_NO_RSA_OAEP
|
||||
# define FP_MAX_BITS (3072 * 2)
|
||||
/* sp math */
|
||||
#ifndef WOLFSSL_NO_SW_MATH
|
||||
# ifndef USE_FAST_MATH
|
||||
# define WOLFSSL_HAVE_SP_RSA
|
||||
# define WOLFSSL_SP
|
||||
# define WOLFSSL_SP_SMALL
|
||||
# define WOLFSSL_SP_MATH
|
||||
# define SP_WORD_SIZE 32
|
||||
# define WOLFSSL_SP_NO_2048
|
||||
# define WOLFSSL_SP_NO_4096
|
||||
# endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef WOLFBOOT_SIGN_RSA4096
|
||||
# define RSA_LOW_MEM
|
||||
# define WOLFSSL_RSA_VERIFY_INLINE
|
||||
# define WOLFSSL_RSA_VERIFY_ONLY
|
||||
# define WC_NO_RSA_OAEP
|
||||
# define FP_MAX_BITS (4096 * 2)
|
||||
/* sp math */
|
||||
#ifndef WOLFSSL_NO_SW_MATH
|
||||
# ifndef USE_FAST_MATH
|
||||
# define WOLFSSL_HAVE_SP_RSA
|
||||
# define WOLFSSL_SP
|
||||
# define WOLFSSL_SP_SMALL
|
||||
# define WOLFSSL_SP_MATH
|
||||
# define SP_WORD_SIZE 32
|
||||
# define WOLFSSL_SP_4096
|
||||
# define WOLFSSL_SP_NO_2048
|
||||
# define WOLFSSL_SP_NO_3072
|
||||
# endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef WOLFBOOT_HASH_SHA3_384
|
||||
# define WOLFSSL_SHA3
|
||||
# define NO_SHA256
|
||||
#endif
|
||||
|
||||
#ifdef WOLFBOOT_HASH_SHA384
|
||||
# define WOLFSSL_SHA384
|
||||
# define NO_SHA256
|
||||
#endif
|
||||
|
||||
#ifdef EXT_ENCRYPTED
|
||||
# define HAVE_PWDBASED
|
||||
#else
|
||||
# define NO_PWDBASED
|
||||
#endif
|
||||
|
||||
/* Disables - For minimum wolfCrypt build */
|
||||
#ifndef WOLFBOOT_TPM
|
||||
# if !defined(ENCRYPT_WITH_AES128) && !defined(ENCRYPT_WITH_AES256)
|
||||
# define NO_AES
|
||||
# endif
|
||||
# define NO_HMAC
|
||||
#endif
|
||||
|
||||
#define NO_CMAC
|
||||
#define NO_CODING
|
||||
#define WOLFSSL_NO_PEM
|
||||
#define NO_ASN_TIME
|
||||
#define NO_RC4
|
||||
#define NO_SHA
|
||||
#define NO_DH
|
||||
#define NO_DSA
|
||||
#define NO_MD4
|
||||
#define NO_RABBIT
|
||||
#define NO_MD5
|
||||
#define NO_SIG_WRAPPER
|
||||
#define NO_CERT
|
||||
#define NO_SESSION_CACHE
|
||||
#define NO_HC128
|
||||
#define NO_DES3
|
||||
#define WC_NO_RNG
|
||||
#define WC_NO_HASHDRBG
|
||||
#define NO_WRITEV
|
||||
#define NO_DEV_RANDOM
|
||||
#define NO_FILESYSTEM
|
||||
#define NO_MAIN_DRIVER
|
||||
#define NO_OLD_RNGNAME
|
||||
#define NO_WOLFSSL_DIR
|
||||
#define WOLFSSL_NO_SOCK
|
||||
#define WOLFSSL_IGNORE_FILE_WARN
|
||||
#define NO_ERROR_STRINGS
|
||||
|
||||
#define BENCH_EMBEDDED
|
||||
#define NO_CRYPT_TEST
|
||||
#define NO_CRYPT_BENCHMARK
|
||||
|
||||
#ifdef __QNX__
|
||||
# define WOLFSSL_HAVE_MIN
|
||||
# define WOLFSSL_HAVE_MAX
|
||||
#endif
|
||||
|
||||
|
||||
/* Memory model */
|
||||
#ifndef WOLFBOOT_SMALL_STACK
|
||||
# ifdef WOLFSSL_SP_MATH
|
||||
# define WOLFSSL_SP_NO_MALLOC
|
||||
# define WOLFSSL_SP_NO_DYN_STACK
|
||||
# endif
|
||||
# define WOLFSSL_NO_MALLOC
|
||||
#else
|
||||
# define WOLFSSL_SMALL_STACK
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* !H_USER_SETTINGS_ */
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
if [ "$2" = "dual" ]; then
|
||||
org_primary=0xffc10000
|
||||
org_update=0xffe10000
|
||||
echo === Dual Bank mode ===
|
||||
else
|
||||
if [ "$2" = "tsip" ]; then
|
||||
org_primary=0xffc50000
|
||||
org_update=0xffe10000
|
||||
echo === Linear mode with TSIP ===
|
||||
else
|
||||
org_primary=0xffc20000
|
||||
org_update=0xffe00000
|
||||
echo === Linear mode ===
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Primary:" $org_primary
|
||||
echo "Update: " $org_update
|
||||
|
||||
cd wolfBoot/HardwareDebug
|
||||
rx-elf-objcopy.exe -O binary -R '$ADDR_C_FE7F5D00' -R '$ADDR_C_FE7F5D10' -R '$ADDR_C_FE7F5D20' -R '$ADDR_C_FE7F5D30' -R '$ADDR_C_FE7F5D40' -R '$ADDR_C_FE7F5D48' -R '$ADDR_C_FE7F5D50' -R '$ADDR_C_FE7F5D64' -R '$ADDR_C_FE7F5D70' -R EXCEPTVECT -R RESETVECT wolfBoot.x wolfBoot.bin
|
||||
rx-elf-objcopy.exe -I binary -O srec --change-addresses=0xffc00000 wolfBoot.bin ../../download/wolfBoot_0.hex
|
||||
rx-elf-objcopy.exe -I binary -O srec --change-addresses=0xffe00000 wolfBoot.bin ../../download/wolfBoot_1.hex
|
||||
|
||||
cd ../..
|
||||
cd $1/HardwareDebug
|
||||
rx-elf-objcopy.exe -O binary -R '$ADDR_C_FE7F5D00' -R '$ADDR_C_FE7F5D10' -R '$ADDR_C_FE7F5D20' -R '$ADDR_C_FE7F5D30' -R '$ADDR_C_FE7F5D40' -R '$ADDR_C_FE7F5D48' -R '$ADDR_C_FE7F5D50' -R '$ADDR_C_FE7F5D64' -R '$ADDR_C_FE7F5D70' -R EXCEPTVECT -R RESETVECT $1.x $1.bin
|
||||
sign --rsa2048 $1.bin ../../../../../pri-rsa2048.der 1.0
|
||||
rx-elf-objcopy.exe -I binary -O srec --change-addresses=$org_primary $1_v1.0_signed.bin ../../download/$1_v1.0_signed.hex
|
||||
sign --rsa2048 $1.bin ../../../../../pri-rsa2048.der 2.0
|
||||
rx-elf-objcopy.exe -I binary -O srec --change-addresses=$org_update $1_v2.0_signed.bin ../../download/$1_v2.0_signed.hex
|
||||
cd ../..
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include "include/user_settings.h"
|
||||
#include "include/target.h"
|
||||
|
||||
int main(int ac, char *av)
|
||||
{
|
||||
printf("WOLFBOOT_FLASH_ADDR: 0x%08x\n", WOLFBOOT_FLASH_ADDR);
|
||||
printf("WOLFBOOT_FLASH_SIZE: 0x%08x\n", WOLFBOOT_FLASH_SIZE);
|
||||
printf("WOLFBOOT_BOOT_SIZE: 0x%08x\n", WOLFBOOT_BOOT_SIZE);
|
||||
printf("WOLFBOOT_RX_EXCVECT: 0x%08x\n", WOLFBOOT_RX_EXCVECT);
|
||||
printf("WOLFBOOT_SECTOR_SIZE: 0x%08x\n", WOLFBOOT_SECTOR_SIZE);
|
||||
printf("\n");
|
||||
printf("WOLFBOOT_PARTITION_SIZE: 0x%08x\n",
|
||||
WOLFBOOT_PARTITION_SIZE);
|
||||
printf("WOLFBOOT_PARTITION_BOOT_ADDRESS: 0x%08x\n",
|
||||
WOLFBOOT_PARTITION_BOOT_ADDRESS);
|
||||
printf("WOLFBOOT_PARTITION_UPDATE_ADDRESS: 0x%08x\n",
|
||||
WOLFBOOT_PARTITION_UPDATE_ADDRESS);
|
||||
printf("WOLFBOOT_PARTITION_SWAP_ADDRESS: 0x%08x\n",
|
||||
WOLFBOOT_PARTITION_SWAP_ADDRESS);
|
||||
printf("\n");
|
||||
printf("Application Entry Address: 0x%08x\n",
|
||||
WOLFBOOT_PARTITION_BOOT_ADDRESS+IMAGE_HEADER_SIZE);
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -50,11 +50,11 @@
|
|||
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.compiler.114148530" name="Compiler" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.compiler">
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.fpu.817445107" name="浮動小数点演算命令を使用する (-fpu/-nofpu)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.fpu" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.fpu.yes" valueType="enumerated"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.include.435935644" name="インクルード・ファイルを検索するフォルダ (-include)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.include" useByScannerDiscovery="false" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value="../../keys"/>
|
||||
<listOptionValue builtIn="false" value="../../include"/>
|
||||
<listOptionValue builtIn="false" value="../../../../../include"/>
|
||||
<listOptionValue builtIn="false" value="../../../../../lib/wolfssl"/>
|
||||
<listOptionValue builtIn="false" value="${TCINSTALL}/include"/>
|
||||
<listOptionValue builtIn="false" value=""C:\wolfWorks\Kojo\wolfBoot\wolfboot/IDE/Renesas/e2Studio_CCRX/include"/>
|
||||
<listOptionValue builtIn="false" value=""C:\wolfWorks\Kojo\wolfBoot\wolfboot/include""/>
|
||||
<listOptionValue builtIn="false" value=""C:\wolfWorks\Kojo\wolfBoot\wolfboot""/>
|
||||
<listOptionValue builtIn="false" value=""C:\wolfWorks\Kojo\wolfBoot\wolfssl""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/general}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_pincfg}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_bsp}""/>
|
||||
|
|
@ -65,6 +65,7 @@
|
|||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_flash_rx/src/flash_type_3}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_flash_rx/src/flash_type_4}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_flash_rx/src/targets}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_tsip_rx}""/>
|
||||
</option>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.userBefore.869068341" name="追加するオプション(すべての指定オプションの前に追加)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.userBefore" useByScannerDiscovery="false" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value=""/>
|
||||
|
|
@ -77,12 +78,12 @@
|
|||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.outcode.1570072024" name="出力する文字コード (-outcode)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.outcode" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.outcode.utf8" valueType="enumerated"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.define.2058710491" name="プリプロセッサ・マクロの定義 (-define)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.define" useByScannerDiscovery="false" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="__WOLFBOOT"/>
|
||||
<listOptionValue builtIn="false" value="WOLFSSL_USER_SETTINGS"/>
|
||||
</option>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.preInclude.303954707" name="コンパイル単位の先頭にインクルードするファイル (-preinclude)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.preInclude" useByScannerDiscovery="false" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="../../include/user_settings.h"/>
|
||||
<listOptionValue builtIn="false" value="../../include/target.h"/>
|
||||
</option>
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.optimize.402664598" name="最適化レベル (-optimize)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.optimize" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.optimize.level0" valueType="enumerated"/>
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.optimize.402664598" name="最適化レベル (-optimize)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.optimize" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.option.optimize.levelMax" valueType="enumerated"/>
|
||||
<inputType id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.gcc.inputType.1343195127" name="Compiler Input C" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.gcc.inputType"/>
|
||||
<inputType id="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.gpp.inputType.1547456010" name="Compiler Input CPP" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.compiler.gpp.inputType"/>
|
||||
</tool>
|
||||
|
|
@ -105,6 +106,7 @@
|
|||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_flash_rx/src/flash_type_3}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_flash_rx/src/flash_type_4}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_flash_rx/src/targets}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_tsip_rx}""/>
|
||||
</option>
|
||||
<inputType id="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.inputType.718646193" name="Assembler InputType" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.assembler.inputType"/>
|
||||
</tool>
|
||||
|
|
@ -116,7 +118,7 @@
|
|||
<listOptionValue builtIn="false" value="D_8=R_8"/>
|
||||
<listOptionValue builtIn="false" value="PFRAM=RPFRAM"/>
|
||||
</option>
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.linkerSection.910319832" name="セクション (-start)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.linkerSection" useByScannerDiscovery="false" value="SU,SI,B_1,R_1,B_2,R_2,B,R,B_8,R_8,RPFRAM/04,PResetPRG,C_1,C_2,C,C_8,C$*,D*,W*,L,P,PFRAM/0FFC00000,EXCEPTVECT/0FFFFFF80,RESETVECT/0FFFFFFFC" valueType="string"/>
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.linkerSection.910319832" name="セクション (-start)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.linkerSection" useByScannerDiscovery="false" value="SI,B_1,R_1,B_2,R_2,B,R,B_8,R_8,RPFRAM/04,PResetPRG,C_1,C_2,C,C_8,C$*,D*,W*,L,P,PFRAM/0FFC00000,EXCEPTVECT/0FFFFFF80,RESETVECT/0FFFFFFFC" valueType="string"/>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.userBefore.1608946238" name="追加するオプション(すべての指定オプションの前に追加)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.userBefore" useByScannerDiscovery="false" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value=""/>
|
||||
</option>
|
||||
|
|
@ -129,6 +131,9 @@
|
|||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.noneLinkageOrderList.747513762" name="(リンク順序のリスト) (-input/-library/-binary)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.noneLinkageOrderList" useByScannerDiscovery="false" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value="".\wolfBoot.lib""/>
|
||||
</option>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.inputFile.1228050498" name="リンクするリロケータブル・ファイル、ライブラリ・ファイルおよびバイナリ・ファイル (-input/-library/-binary)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.linker.option.inputFile" useByScannerDiscovery="false" valueType="stringList">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/src/smc_gen/r_tsip_rx/lib/ccrx/r_tsip_rx72m_rx72n_rx66n_little.lib}""/>
|
||||
</option>
|
||||
</tool>
|
||||
<tool id="com.renesas.cdt.managedbuild.renesas.ccrx.base.librarian.824424223" name="Library Generator" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.base.librarian">
|
||||
<option id="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.fpu.1603488290" name="浮動小数点演算命令を使用する (-fpu/-nofpu)" superClass="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.fpu" useByScannerDiscovery="false" value="com.renesas.cdt.managedbuild.renesas.ccrx.librarian.option.fpu.yes" valueType="enumerated"/>
|
||||
|
|
@ -153,7 +158,7 @@
|
|||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry excluding="wolfboot/spi_flash.c|wolfboot/uart_flash.c|wolfboot/update_flash_hwswap.c|wolfboot/update_ram.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
|
||||
<entry excluding="wolfboot/update_flash_hwswap.c|wolfboot/spi_flash.c|wolfboot/uart_flash.c|wolfboot/update_ram.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
|
|
|
|||
|
|
@ -34,6 +34,11 @@
|
|||
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
|
||||
</natures>
|
||||
<linkedResources>
|
||||
<link>
|
||||
<name>src/keystore.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-4-PROJECT_LOC/src/keystore.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>src/hal/renesas-rx.c</name>
|
||||
<type>1</type>
|
||||
|
|
@ -69,6 +74,11 @@
|
|||
<type>1</type>
|
||||
<locationURI>PARENT-4-PROJECT_LOC/src/spi_flash.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>src/wolfboot/string.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-4-PROJECT_LOC/src/string.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>src/wolfboot/uart_flash.c</name>
|
||||
<type>1</type>
|
||||
|
|
@ -144,6 +154,21 @@
|
|||
<type>1</type>
|
||||
<locationURI>PARENT-5-PROJECT_LOC/wolfssl/wolfcrypt/src/hash.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>src/wolfcrypt/memory.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-4-PROJECT_LOC/lib/wolfssl/wolfcrypt/src/memory.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>src/wolfcrypt/misc.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-4-PROJECT_LOC/lib/wolfssl/wolfcrypt/src/misc.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>src/wolfcrypt/rsa.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-4-PROJECT_LOC/lib/wolfssl/wolfcrypt/src/rsa.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>src/wolfcrypt/sha256.c</name>
|
||||
<type>1</type>
|
||||
|
|
@ -159,5 +184,20 @@
|
|||
<type>1</type>
|
||||
<locationURI>PARENT-5-PROJECT_LOC/wolfssl/wolfcrypt/src/sp_c32.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>src/wolfcrypt/tfm.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-4-PROJECT_LOC/lib/wolfssl/wolfcrypt/src/tfm.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>src/wolfcrypt/Renesas/Renesas</name>
|
||||
<type>2</type>
|
||||
<locationURI>virtual:/virtual</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>src/wolfcrypt/Renesas/Renesas/renesas_tsip_rsa.c</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-4-PROJECT_LOC/lib/wolfssl/wolfcrypt/src/port/Renesas/renesas_tsip_rsa.c</locationURI>
|
||||
</link>
|
||||
</linkedResources>
|
||||
</projectDescription>
|
||||
|
|
|
|||
|
|
@ -703,9 +703,9 @@
|
|||
<tool id="SWComponent" version="1.0.0.0">
|
||||
<configuration inuse="true" name="r_bsp">
|
||||
<component description="依存モジュール: なし The r_bsp package provides a foundation for code to be built on top of. It provides startup code, iodefines, and MCU information for different boards. There are 2 folders that make up the r_bsp package. The 'mcu' folder contains files that are common to a MCU group. These files provide functionality such as easy register access, CPU functions, and a file named 'mcu_info.h' for each MCU group. The 'mcu_info.h' file has information about the MCU on the board and is configured based on the information given in r_bsp_config.h. The information in 'mcu_info.h' is used to help configure Renesas middleware that uses the r_bsp package. The 'board' folder has a folder with startup code for each supported board. Which MCU and board is chosen is decided by the settings in 'platform.h'. The user can choose which board they are using by uncommenting the include path that applies to their board. For example, if you are using the RSK+RX64M then you would uncomment the #include "./board/generic_rx64m/r_bsp.h" include path. Users are encouraged to add their own boards to the 'board' directory. BSPs are configured by using the r_bsp_config.h file. Each board will have a reference configuration file named r_bsp_config_reference.h. The user should copy this file to their project, rename it to r_bsp_config.h, and use the options inside the file to configure the BSP for their project." detailDescription="Board Support Packages." display="r_bsp" id="r_bsp7.20" version="7.20">
|
||||
<gridItem id="BSP_CFG_USER_STACK_ENABLE" selectedIndex="1"/>
|
||||
<gridItem id="BSP_CFG_USER_STACK_ENABLE" selectedIndex="0"/>
|
||||
<gridItem id="BSP_CFG_USTACK_BYTES" selectedIndex="0x1000"/>
|
||||
<gridItem id="BSP_CFG_ISTACK_BYTES" selectedIndex="0x400"/>
|
||||
<gridItem id="BSP_CFG_ISTACK_BYTES" selectedIndex="0x2000"/>
|
||||
<gridItem id="BSP_CFG_HEAP_BYTES" selectedIndex="0x400"/>
|
||||
<gridItem id="BSP_CFG_IO_LIB_ENABLE" selectedIndex="1"/>
|
||||
<gridItem id="BSP_CFG_USER_CHARGET_ENABLED" selectedIndex="0"/>
|
||||
|
|
@ -775,6 +775,11 @@
|
|||
<source description="Components supporting Firmware Integration Technology" display="Firmware Integration Technology" id="com.renesas.smc.tools.swcomponent.fit.source"/>
|
||||
<source description="Components supporting Firmware Integration Technology" display="Firmware Integration Technology" id="com.renesas.smc.tools.swcomponent.fit.source"/>
|
||||
</configuration>
|
||||
<configuration inuse="true" name="r_tsip_rx">
|
||||
<component description="依存モジュール: r_bsp バージョン 7.00 Support functions: AES, GCM, CCM, CMAC, SHA, MD5, Triple-DES, ARC4, RSA, ECC, Random number generate, Key management, secure boot/secure firmware update. The ".l" in version number means library version." detailDescription="TSIP(Trusted Secure IP) driver." display="r_tsip_rx" id="r_tsip_rx1.15.l" version="1.15.l"/>
|
||||
<source description="Components supporting Firmware Integration Technology" display="Firmware Integration Technology" id="com.renesas.smc.tools.swcomponent.fit.source"/>
|
||||
<source description="Components supporting Firmware Integration Technology" display="Firmware Integration Technology" id="com.renesas.smc.tools.swcomponent.fit.source"/>
|
||||
</configuration>
|
||||
</tool>
|
||||
<tool id="System">
|
||||
<section id="ocd">
|
||||
|
|
|
|||
|
|
@ -30,18 +30,31 @@
|
|||
#include "hal.h"
|
||||
#include "r_flash_rx.h"
|
||||
|
||||
#ifdef WOLFBOOT_RENESAS_TSIP
|
||||
#include "r_tsip_rx_if.h"
|
||||
#include "key_data.h"
|
||||
|
||||
tsip_tls_ca_certification_public_key_index_t g_key_index_1;
|
||||
tsip_update_key_ring_t g_key_index_2;
|
||||
|
||||
#endif
|
||||
|
||||
static inline void hal_panic(void)
|
||||
{
|
||||
while(1)
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
void hal_init(void)
|
||||
{
|
||||
if(R_FLASH_Open() != FLASH_SUCCESS)
|
||||
hal_panic();
|
||||
|
||||
#ifdef WOLFBOOT_RENESAS_TSIP
|
||||
if(R_TSIP_Open(&g_key_index_1, &g_key_index_2)!= TSIP_SUCCESS)
|
||||
hal_panic();
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void hal_prepare_boot(void)
|
||||
|
|
@ -49,9 +62,6 @@ void hal_prepare_boot(void)
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#define MIN_PROG (0x8000)
|
||||
#define ALIGN_FLASH(a) ((a) / MIN_PROG * MIN_PROG)
|
||||
static uint8_t save[MIN_PROG];
|
||||
|
|
@ -59,7 +69,8 @@ static uint8_t save[MIN_PROG];
|
|||
int blockWrite(const uint8_t *data, uint32_t addr, int len)
|
||||
{
|
||||
for(; len; len-=MIN_PROG, data+=MIN_PROG, addr+=MIN_PROG) {
|
||||
if(R_FLASH_Write((uint32_t)data, addr, MIN_PROG) != FLASH_SUCCESS)
|
||||
memcpy(save, data, MIN_PROG); /* for the case "data" ls a flash address */
|
||||
if(R_FLASH_Write((uint32_t)save, addr, MIN_PROG) != FLASH_SUCCESS)
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -96,6 +107,8 @@ int hal_flash_write(uint32_t addr, const uint8_t *data, int len)
|
|||
if(len > 0) {
|
||||
memcpy(save, (const void *)addr, MIN_PROG);
|
||||
memcpy(save, data, len);
|
||||
if(R_FLASH_Erase((flash_block_address_t)addr, 1) != FLASH_SUCCESS)
|
||||
return -1;
|
||||
if(R_FLASH_Write((uint32_t)save, addr, MIN_PROG) != FLASH_SUCCESS)
|
||||
goto error;
|
||||
}
|
||||
|
|
@ -150,6 +163,12 @@ void RAMFUNCTION hal_flash_lock(void)
|
|||
|
||||
void RAMFUNCTION hal_flash_dualbank_swap(void)
|
||||
{
|
||||
flash_cmd_t cmd = FLASH_CMD_SWAPFLAG_TOGGLE;
|
||||
printf("FLASH_CMD_SWAPFLAG_TOGGLE=%d\n", FLASH_CMD_SWAPFLAG_TOGGLE);
|
||||
hal_flash_unlock();
|
||||
if(R_FLASH_Control(cmd, NULL) != FLASH_SUCCESS)
|
||||
hal_panic();
|
||||
hal_flash_lock();
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
14
src/image.c
14
src/image.c
|
|
@ -48,6 +48,11 @@ static int wolfBoot_unseal_pubkey(uint8_t* pubkey, WOLFTPM2_KEY* tpmKey);
|
|||
|
||||
#endif /* WOLFBOOT_TPM */
|
||||
|
||||
#ifdef WOLFBOOT_RENESAS_TSIP
|
||||
#include "r_tsip_rx_if.h"
|
||||
#include "key_data.h"
|
||||
#include "wolfssl/wolfcrypt/port/Renesas/renesas-tsip-crypt.h"
|
||||
#endif
|
||||
|
||||
static int keyslot_id_by_sha(const uint8_t *hint);
|
||||
|
||||
|
|
@ -290,9 +295,11 @@ static int RsaUnPad(const byte *pkcsBlock, int pkcsBlockLen, byte **output)
|
|||
static void wolfBoot_verify_signature(uint8_t key_slot,
|
||||
struct wolfBoot_image *img, uint8_t *sig)
|
||||
{
|
||||
int ret;
|
||||
int ret = 0;
|
||||
uint8_t output[IMAGE_SIGNATURE_SIZE];
|
||||
#ifdef WOLFBOOT_TPM
|
||||
int output_sz = sizeof(output);
|
||||
#endif
|
||||
uint8_t* digest_out = NULL;
|
||||
uint8_t *pubkey = keystore_get_buffer(key_slot);
|
||||
int pubkey_sz = keystore_get_size(key_slot);
|
||||
|
|
@ -351,7 +358,6 @@ static void wolfBoot_verify_signature(uint8_t key_slot,
|
|||
{
|
||||
struct RsaKey rsa;
|
||||
word32 in_out = 0;
|
||||
int res = 0;
|
||||
|
||||
#if !defined(WOLFBOOT_RENESAS_SCEPROTECT)
|
||||
|
||||
|
|
@ -368,6 +374,7 @@ static void wolfBoot_verify_signature(uint8_t key_slot,
|
|||
return;
|
||||
}
|
||||
|
||||
#ifndef WOLFBOOT_RENESAS_TSIP
|
||||
XMEMCPY(output, sig, IMAGE_SIGNATURE_SIZE);
|
||||
RSA_VERIFY_FN(ret, wc_RsaSSL_VerifyInline, output, IMAGE_SIGNATURE_SIZE,
|
||||
&digest_out, &rsa);
|
||||
|
|
@ -387,6 +394,7 @@ static void wolfBoot_verify_signature(uint8_t key_slot,
|
|||
}
|
||||
#endif /* WOLFBOOT_TPM */
|
||||
|
||||
#ifndef WOLFBOOT_RENESAS_TSIP
|
||||
#ifndef NO_RSA_SIG_ENCODING
|
||||
if (ret > WOLFBOOT_SHA_DIGEST_SIZE) {
|
||||
/* larger result indicates it might have an ASN.1 encoded header */
|
||||
|
|
@ -395,7 +403,7 @@ static void wolfBoot_verify_signature(uint8_t key_slot,
|
|||
#endif
|
||||
if (ret == WOLFBOOT_SHA_DIGEST_SIZE && img && digest_out)
|
||||
RSA_VERIFY_HASH(img, digest_out);
|
||||
|
||||
#endif
|
||||
}
|
||||
#endif /* WOLFBOOT_SIGN_RSA2048 || WOLFBOOT_SIGN_3072
|
||||
|| WOLFBOOT_SIGN_RSA4096 */
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ int isalpha(int c)
|
|||
return (isupper(c) || islower(c));
|
||||
}
|
||||
|
||||
#if !defined(__CCRX__) /* Renesas CCRX */
|
||||
#if !defined(__IAR_SYSTEMS_ICC__) && !defined(PLATFORM_X86_64_EFI)
|
||||
void *memset(void *s, int c, size_t n)
|
||||
{
|
||||
|
|
@ -108,6 +109,7 @@ int strcmp(const char *s1, const char *s2)
|
|||
|
||||
return diff;
|
||||
}
|
||||
#endif /* Renesas CCRX */
|
||||
|
||||
int strcasecmp(const char *s1, const char *s2)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -93,5 +93,5 @@ void RAMFUNCTION wolfBoot_start(void)
|
|||
}
|
||||
}
|
||||
hal_prepare_boot();
|
||||
do_boot((void *)WOLFBOOT_PARTITION_BOOT_ADDRESS + IMAGE_HEADER_SIZE);
|
||||
do_boot((void *)(WOLFBOOT_PARTITION_BOOT_ADDRESS + IMAGE_HEADER_SIZE));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue