Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Commit

Permalink
Merge branch 'rx_development_202012.00' into 'rx_development_202012.00'
Browse files Browse the repository at this point in the history
[Fix] Fix "illegal status" in OTA update demo

See merge request products/common/rtos/amazon-freertos/amazon-freertos!32
  • Loading branch information
VanNamDinh committed Oct 21, 2022
2 parents 73a5870 + 14227fb commit 99a958e
Show file tree
Hide file tree
Showing 33 changed files with 155 additions and 323 deletions.
12 changes: 6 additions & 6 deletions projects/renesas/rx65n-rsk/e2studio-gcc/aws_demos/.project
Original file line number Diff line number Diff line change
Expand Up @@ -2137,7 +2137,7 @@
<locationURI>AWS_IOT_MCU_ROOT/vendors/renesas/rx_driver_package/v133/r_s12ad_rx/r_s12ad_rx_if.h</locationURI>
</link>
<link>
<name>vendors/renesas/rx_driver_package/v133/r_tsip/r_tsip_rx_if.h</name>
<name>vendors/renesas/rx_driver_package/v133/r_tsip_rx/r_tsip_rx_if.h</name>
<type>1</type>
<locationURI>AWS_IOT_MCU_ROOT/vendors/renesas/rx_driver_package/v133/r_tsip_rx/r_tsip_rx_if.h</locationURI>
</link>
Expand Down Expand Up @@ -2691,6 +2691,11 @@
<type>1</type>
<locationURI>AWS_IOT_MCU_ROOT/vendors/renesas/rx_driver_package/v133/r_flash_rx/src/flash_type_4/r_flash_type4_if.h</locationURI>
</link>
<link>
<name>vendors/renesas/rx_driver_package/v133/r_tsip_rx/lib/gcc/libr_tsip_rx65n_little.a</name>
<type>1</type>
<locationURI>AWS_IOT_MCU_ROOT/vendors/renesas/rx_driver_package/v133/r_tsip_rx/lib/gcc/libr_tsip_rx65n_little.a</locationURI>
</link>
<link>
<name>vendors/renesas/boards/rx65n-rsk-gcc/aws_demos/src/smc_gen/general/r_cg_hardware_setup.c</name>
<type>1</type>
Expand All @@ -2701,11 +2706,6 @@
<type>1</type>
<locationURI>SMC_GENERATED_LOC/general/r_cg_interrupt_handlers.h</locationURI>
</link>
<link>
<name>vendors/renesas/rx_driver_package/v133/r_tsip_rx/lib/gcc/libr_tsip_rx65n_little.a</name>
<type>1</type>
<locationURI>AWS_IOT_MCU_ROOT/vendors/renesas/rx_driver_package/v133/r_tsip_rx/lib/gcc/libr_tsip_rx65n_little.a</locationURI>
</link>
<link>
<name>vendors/renesas/boards/rx65n-rsk-gcc/aws_demos/src/smc_gen/general/r_cg_macrodriver.h</name>
<type>1</type>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1350,6 +1350,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="Dependency : r_bsp version(s) 6.11&#10;Support functions: AES, GCM, CCM, CMAC, SHA, MD5, Triple-DES, ARC4, RSA, ECC, Random number generate, Key management, secure boot/secure firmware update.&#10;The &quot;.l&quot; in version number means library version." detailDescription="TSIP(Trusted Secure IP) driver." display="r_tsip_rx" id="r_tsip_rx1.14.l" version="1.14.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">
Expand Down
15 changes: 5 additions & 10 deletions projects/renesas/rx65n-rsk/e2studio/aws_demos/.project
Original file line number Diff line number Diff line change
Expand Up @@ -2136,7 +2136,7 @@
<locationURI>AWS_IOT_MCU_ROOT/vendors/renesas/rx_driver_package/v133/r_s12ad_rx/r_s12ad_rx_if.h</locationURI>
</link>
<link>
<name>vendors/renesas/rx_driver_package/v133/r_tsip/r_tsip_rx_if.h</name>
<name>vendors/renesas/rx_driver_package/v133/r_tsip_rx/r_tsip_rx_if.h</name>
<type>1</type>
<locationURI>AWS_IOT_MCU_ROOT/vendors/renesas/rx_driver_package/v133/r_tsip_rx/r_tsip_rx_if.h</locationURI>
</link>
Expand Down Expand Up @@ -2685,20 +2685,15 @@
<type>1</type>
<locationURI>AWS_IOT_MCU_ROOT/vendors/renesas/rx_driver_package/v133/r_flash_rx/src/flash_type_4/r_flash_type4_if.h</locationURI>
</link>
<link>
<name>vendors/renesas/boards/rx65n-rsk/aws_demos/src/smc_gen/general/r_cg_hardware_setup.c</name>
<type>1</type>
<locationURI>AWS_IOT_MCU_ROOT/vendors/renesas/boards/rx65n-rsk/aws_demos/src/smc_gen/general/r_cg_hardware_setup.c</locationURI>
</link>
<link>
<link>
<name>vendors/renesas/rx_driver_package/v133/r_tsip_rx/lib/ccrx/r_tsip_rx65n_little.lib</name>
<type>1</type>
<locationURI>AWS_IOT_MCU_ROOT/vendors/renesas/rx_driver_package/v133/r_tsip_rx/lib/ccrx/r_tsip_rx65n_little.lib</locationURI>
</link>
<name>vendors/renesas/boards/rx65n-rsk/aws_demos/src/smc_gen/general/r_cg_macrodriver.h</name>
<link>
<name>vendors/renesas/boards/rx65n-rsk/aws_demos/src/smc_gen/general/r_cg_hardware_setup.c</name>
<type>1</type>
<locationURI>AWS_IOT_MCU_ROOT/vendors/renesas/boards/rx65n-rsk/aws_demos/src/smc_gen/general/r_cg_macrodriver.h</locationURI>
<locationURI>AWS_IOT_MCU_ROOT/vendors/renesas/boards/rx65n-rsk/aws_demos/src/smc_gen/general/r_cg_hardware_setup.c</locationURI>
</link>
<link>
<name>vendors/renesas/boards/rx65n-rsk/aws_demos/src/smc_gen/general/r_cg_userdefine.h</name>
Expand Down Expand Up @@ -2858,7 +2853,7 @@
<type>10</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-name-matches-false-true-r_sci_rx|r_bsp|r_byteq|r_ether_rx|r_flash_rx|r_s12ad_rx|r_sci_rx</arguments>
<arguments>1.0-name-matches-false-true-r_sci_rx|r_bsp|r_byteq|r_ether_rx|r_flash_rx|r_s12ad_rx|r_sci_rx|r_tsip_rx|</arguments>
</matcher>
</filter>
</filteredResources>
Expand Down
5 changes: 5 additions & 0 deletions projects/renesas/rx65n-rsk/e2studio/aws_demos/aws_demos.scfg
Original file line number Diff line number Diff line change
Expand Up @@ -1372,6 +1372,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="Dependency : r_bsp version(s) 6.11&#10;Support functions: AES, GCM, CCM, CMAC, SHA, MD5, Triple-DES, ARC4, RSA, ECC, Random number generate, Key management, secure boot/secure firmware update.&#10;The &quot;.l&quot; in version number means library version." detailDescription="TSIP(Trusted Secure IP) driver." display="r_tsip_rx" id="r_tsip_rx1.14.l" version="1.14.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">
Expand Down
1 change: 1 addition & 0 deletions projects/renesas/rx65n-rsk/e2studio/boot_loader/.project
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<buildSpec>
<buildCommand>
<name>com.renesas.smc.ui.pgsupport.SCContentBuilder</name>
<triggers></triggers>
<arguments>
</arguments>
</buildCommand>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<buildSpec>
<buildCommand>
<name>com.renesas.smc.ui.pgsupport.SCContentBuilder</name>
<triggers></triggers>
<arguments>
</arguments>
</buildCommand>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<triggers></triggers>
<arguments>
</arguments>
</buildCommand>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ OTA_Err_t prvPAL_ResetDevice( void )
Then the boot loader will start and erase the image that failed to update. */
set_psw(0);
R_BSP_InterruptsDisable();
R_FLASH_Control(FLASH_CMD_BANK_TOGGLE, NULL);
//R_FLASH_Control(FLASH_CMD_BANK_TOGGLE, NULL);
R_BSP_RegisterProtectDisable(BSP_REG_PROTECT_LPC_CGC_SWR);
SYSTEM.SWRR = 0xa501;
while(1); /* software reset */
Expand Down
29 changes: 8 additions & 21 deletions vendors/renesas/boards/rx65n-gr-rose-gcc/ports/ota/aws_ota_pal.c
Original file line number Diff line number Diff line change
Expand Up @@ -642,27 +642,14 @@ OTA_Err_t prvPAL_ResetDevice( void )

OTA_LOG_L1( "[%s] Resetting the device.\r\n", OTA_METHOD_NAME );

if ((eOTA_ImageState_Accepted == load_firmware_control_block.eSavedAgentState) ||
(eOTA_ImageState_Testing == load_firmware_control_block.eSavedAgentState))
{
/* Software reset issued (Not swap bank) */
R_BSP_SET_PSW(0);
R_BSP_InterruptsDisable();
R_BSP_RegisterProtectDisable(BSP_REG_PROTECT_LPC_CGC_SWR);
SYSTEM.SWRR = 0xa501;
while(1); /* software reset */
}
else
{
/* If the status is rejected, aborted, or error, swap bank and return to the previous image.
Then the boot loader will start and erase the image that failed to update. */
R_BSP_SET_PSW(0);
R_BSP_InterruptsDisable();
R_FLASH_Control(FLASH_CMD_BANK_TOGGLE, NULL);
R_BSP_RegisterProtectDisable(BSP_REG_PROTECT_LPC_CGC_SWR);
SYSTEM.SWRR = 0xa501;
while(1); /* software reset */
}
/* If the status is rejected, aborted, or error, swap bank and return to the previous image.
Then the boot loader will start and erase the image that failed to update. */
R_BSP_SET_PSW(0);
R_BSP_InterruptsDisable();
//R_FLASH_Control(FLASH_CMD_BANK_TOGGLE, NULL);
R_BSP_RegisterProtectDisable(BSP_REG_PROTECT_LPC_CGC_SWR);
SYSTEM.SWRR = 0xa501;
while(1); /* software reset */

/* We shouldn't actually get here if the board supports the auto reset.
* But, it doesn't hurt anything if we do although someone will need to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -641,28 +641,14 @@ OTA_Err_t prvPAL_ResetDevice( void )
DEFINE_OTA_METHOD_NAME("prvPAL_ResetDevice");

OTA_LOG_L1( "[%s] Resetting the device.\r\n", OTA_METHOD_NAME );

if ((eOTA_ImageState_Accepted == load_firmware_control_block.eSavedAgentState) ||
(eOTA_ImageState_Testing == load_firmware_control_block.eSavedAgentState))
{
/* Software reset issued (Not swap bank) */
set_psw(0);
R_BSP_InterruptsDisable();
R_BSP_RegisterProtectDisable(BSP_REG_PROTECT_LPC_CGC_SWR);
SYSTEM.SWRR = 0xa501;
while(1); /* software reset */
}
else
{
/* If the status is rejected, aborted, or error, swap bank and return to the previous image.
Then the boot loader will start and erase the image that failed to update. */
set_psw(0);
R_BSP_InterruptsDisable();
R_FLASH_Control(FLASH_CMD_BANK_TOGGLE, NULL);
R_BSP_RegisterProtectDisable(BSP_REG_PROTECT_LPC_CGC_SWR);
SYSTEM.SWRR = 0xa501;
while(1); /* software reset */
}
/* If the status is rejected, aborted, or error, swap bank and return to the previous image.
Then the boot loader will start and erase the image that failed to update. */
set_psw(0);
R_BSP_InterruptsDisable();
//R_FLASH_Control(FLASH_CMD_BANK_TOGGLE, NULL);
R_BSP_RegisterProtectDisable(BSP_REG_PROTECT_LPC_CGC_SWR);
SYSTEM.SWRR = 0xa501;
while(1); /* software reset */

/* We shouldn't actually get here if the board supports the auto reset.
* But, it doesn't hurt anything if we do although someone will need to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -641,27 +641,14 @@ OTA_Err_t prvPAL_ResetDevice( void )

OTA_LOG_L1( "[%s] Resetting the device.\r\n", OTA_METHOD_NAME );

if ((eOTA_ImageState_Accepted == load_firmware_control_block.eSavedAgentState) ||
(eOTA_ImageState_Testing == load_firmware_control_block.eSavedAgentState))
{
/* Software reset issued (Not swap bank) */
set_psw(0);
R_BSP_InterruptsDisable();
R_BSP_RegisterProtectDisable(BSP_REG_PROTECT_LPC_CGC_SWR);
SYSTEM.SWRR = 0xa501;
while(1); /* software reset */
}
else
{
/* If the status is rejected, aborted, or error, swap bank and return to the previous image.
Then the boot loader will start and erase the image that failed to update. */
set_psw(0);
R_BSP_InterruptsDisable();
R_FLASH_Control(FLASH_CMD_BANK_TOGGLE, NULL);
R_BSP_RegisterProtectDisable(BSP_REG_PROTECT_LPC_CGC_SWR);
SYSTEM.SWRR = 0xa501;
while(1); /* software reset */
}
/* If the status is rejected, aborted, or error, swap bank and return to the previous image.
Then the boot loader will start and erase the image that failed to update. */
set_psw(0);
R_BSP_InterruptsDisable();
//R_FLASH_Control(FLASH_CMD_BANK_TOGGLE, NULL);
R_BSP_RegisterProtectDisable(BSP_REG_PROTECT_LPC_CGC_SWR);
SYSTEM.SWRR = 0xa501;
while(1); /* software reset */

/* We shouldn't actually get here if the board supports the auto reset.
* But, it doesn't hurt anything if we do although someone will need to
Expand Down
29 changes: 8 additions & 21 deletions vendors/renesas/boards/rx65n-gr-rose/ports/ota/aws_ota_pal.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,27 +641,14 @@ OTA_Err_t prvPAL_ResetDevice( void )

OTA_LOG_L1( "[%s] Resetting the device.\r\n", OTA_METHOD_NAME );

if ((eOTA_ImageState_Accepted == load_firmware_control_block.eSavedAgentState) ||
(eOTA_ImageState_Testing == load_firmware_control_block.eSavedAgentState))
{
/* Software reset issued (Not swap bank) */
set_psw(0);
R_BSP_InterruptsDisable();
R_BSP_RegisterProtectDisable(BSP_REG_PROTECT_LPC_CGC_SWR);
SYSTEM.SWRR = 0xa501;
while(1); /* software reset */
}
else
{
/* If the status is rejected, aborted, or error, swap bank and return to the previous image.
Then the boot loader will start and erase the image that failed to update. */
set_psw(0);
R_BSP_InterruptsDisable();
R_FLASH_Control(FLASH_CMD_BANK_TOGGLE, NULL);
R_BSP_RegisterProtectDisable(BSP_REG_PROTECT_LPC_CGC_SWR);
SYSTEM.SWRR = 0xa501;
while(1); /* software reset */
}
/* If the status is rejected, aborted, or error, swap bank and return to the previous image.
Then the boot loader will start and erase the image that failed to update. */
set_psw(0);
R_BSP_InterruptsDisable();
//R_FLASH_Control(FLASH_CMD_BANK_TOGGLE, NULL);
R_BSP_RegisterProtectDisable(BSP_REG_PROTECT_LPC_CGC_SWR);
SYSTEM.SWRR = 0xa501;
while(1); /* software reset */

/* We shouldn't actually get here if the board supports the auto reset.
* But, it doesn't hurt anything if we do although someone will need to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#endif

#ifndef LIBRARY_LOG_LEVEL
#define LIBRARY_LOG_LEVEL LOG_INFO
#define LIBRARY_LOG_LEVEL LOG_NONE
#endif

#include "logging_stack.h"
Expand Down
2 changes: 1 addition & 1 deletion vendors/renesas/boards/rx65n-rsk/ports/ota/aws_ota_pal.c
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ OTA_Err_t prvPAL_ResetDevice( void )
Then the boot loader will start and erase the image that failed to update. */
set_psw(0);
R_BSP_InterruptsDisable();
R_FLASH_Control(FLASH_CMD_BANK_TOGGLE, NULL);
//R_FLASH_Control(FLASH_CMD_BANK_TOGGLE, NULL);
R_BSP_RegisterProtectDisable(BSP_REG_PROTECT_LPC_CGC_SWR);
SYSTEM.SWRR = 0xa501;
while(1); /* software reset */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ Product Name=RX Group
Support FAW=FALSE
Support AWPR=FALSE
Support ESW=TRUE
Memory Area Count=6
Memory Area Count=4
[Clock Info]
Clock Mode=0
Support Clock=
OSC Frequency Range=16000000,16000000
CPU Frequency Range=120000000,120000000
SCI Frequency Range=0,16000000
SCI Frequency Range=0,60000000
CPU Ratio=
SCI Ratio=
[Memory Area 0]
Expand All @@ -27,38 +27,24 @@ Write Unit Size=0x00000080
Attribute=0x00000002
[Memory Area 1]
Area Type=0x00000001
Start Address=0xFFF00000
Size=0x000F0000
Erase Unit Size=0x00008000
Write Unit Size=0x00000080
Attribute=0x00000002
[Memory Area 2]
Area Type=0x00000001
Start Address=0xFFEF0000
Size=0x00010000
Erase Unit Size=0x00002000
Write Unit Size=0x00000080
Attribute=0x00000002
[Memory Area 3]
Area Type=0x00000001
Start Address=0xFFE00000
Size=0x000F0000
Size=0x001F0000
Erase Unit Size=0x00008000
Write Unit Size=0x00000080
Attribute=0x00000002
[Memory Area 4]
[Memory Area 2]
Area Type=0x00000010
Start Address=0x00100000
Size=0x00002000
Erase Unit Size=0x00000040
Write Unit Size=0x00000004
Attribute=0x00000000
[Memory Area 5]
[Memory Area 3]
Area Type=0x00010000
Start Address=0xFE7F5D00
Size=0x00000080
Erase Unit Size=0x00000000
Write Unit Size=0x00000010
Attribute=0x00000000
[Checksum]
Checksum=0xEFDDF413
Checksum=0x4B2D1FA6
Loading

0 comments on commit 99a958e

Please sign in to comment.