diff --git a/IDE/Renesas/e2studio_CCRX/Readme.md b/IDE/Renesas/e2studio_CCRX/Readme.md index 65e8812f..c915a4c5 100644 --- a/IDE/Renesas/e2studio_CCRX/Readme.md +++ b/IDE/Renesas/e2studio_CCRX/Readme.md @@ -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 $ export PATH:$PATH:/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 + diff --git a/IDE/Renesas/e2studio_CCRX/app_RenesasRX01/.cproject b/IDE/Renesas/e2studio_CCRX/app_RenesasRX01/.cproject new file mode 100644 index 00000000..f697e376 --- /dev/null +++ b/IDE/Renesas/e2studio_CCRX/app_RenesasRX01/.cproject @@ -0,0 +1,189 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IDE/Renesas/e2studio_CCRX/app_RenesasRX01/src/app_RenesasRX01.c b/IDE/Renesas/e2studio_CCRX/app_RenesasRX01/src/app_RenesasRX01.c index 74a231fd..3ea2c25b 100644 --- a/IDE/Renesas/e2studio_CCRX/app_RenesasRX01/src/app_RenesasRX01.c +++ b/IDE/Renesas/e2studio_CCRX/app_RenesasRX01/src/app_RenesasRX01.c @@ -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); } diff --git a/IDE/Renesas/e2studio_CCRX/include/target.h b/IDE/Renesas/e2studio_CCRX/include/target.h new file mode 100644 index 00000000..d8bd989e --- /dev/null +++ b/IDE/Renesas/e2studio_CCRX/include/target.h @@ -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_ */ diff --git a/IDE/Renesas/e2studio_CCRX/include/user_settings.h b/IDE/Renesas/e2studio_CCRX/include/user_settings.h new file mode 100644 index 00000000..cd97a0a8 --- /dev/null +++ b/IDE/Renesas/e2studio_CCRX/include/user_settings.h @@ -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_ */ diff --git a/IDE/Renesas/e2studio_CCRX/sign.sh b/IDE/Renesas/e2studio_CCRX/sign.sh new file mode 100644 index 00000000..8501d43b --- /dev/null +++ b/IDE/Renesas/e2studio_CCRX/sign.sh @@ -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 ../.. diff --git a/IDE/Renesas/e2studio_CCRX/target.c b/IDE/Renesas/e2studio_CCRX/target.c new file mode 100644 index 00000000..7161a24a --- /dev/null +++ b/IDE/Renesas/e2studio_CCRX/target.c @@ -0,0 +1,26 @@ + +#include +#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; +} diff --git a/IDE/Renesas/e2studio_CCRX/wolfBoot/.cproject b/IDE/Renesas/e2studio_CCRX/wolfBoot/.cproject index 966e953a..2d71cd3d 100644 --- a/IDE/Renesas/e2studio_CCRX/wolfBoot/.cproject +++ b/IDE/Renesas/e2studio_CCRX/wolfBoot/.cproject @@ -50,11 +50,11 @@ @@ -105,6 +106,7 @@ + @@ -116,7 +118,7 @@ - @@ -129,6 +131,9 @@ +