MCUBOOT RA6E1 Memory Region Issue

Hi! I have ported the "ra6-secure-firmware-update-using-mcuboot-and-flash-dual-bank-application-project" to RA6E1 and we have USB interface soldered correctly. 

Changes : I had to change the Heap Size to 0x1800 of the Bootloader project for MbedTLS (Hardware Acceleration - PKC) . I have set UCLK to 48MHz for USB PCDC. A few other minor changes. 

I did not change the stack size for primary or secondary projects.

Re-create the Issue : 

1. Erase MCU using Renesas Device Partition Manager. 

2. Debug primary_project and using USB interface, update to 1.1

3. Now try to erase secondary image to upgrade to 1.2, but stuck on Erasing secondary slot...

Inference : When I debug, I can see the R_FLASH_HP_BlankCheck() failing after erasing secondary slot ( close to the end of SECONDARY_IMAGE_END_ADDRESS ), I was confused whether the size of the image could be causing issues, or the above mentioned changes I did.

Also, could you suggest me to look at something, that might help me be certain about the Image Sizes that I need to change once I start adding more stuff to the primary and secondary projects (currently I am using

  • Hi kth,

    As you mentioned, the process is stuck in R_FLASH_HP_BlankCheck failing, when the api fails it will return a error code, could you read the error code, it may be the reason why the program cannot step further.




    and then it also fails to do the xmodem part after that due to it.

    The first time it does not fail, able to upgrade 1.0 to 1.1 but fails for second upgrade.

  • Hi,

    After checking the application note, I found some differences between your screenshot and the note's screenshot.

    After upgrading to Rev1.1, the secondary image slot should be Rev1.0:

    Could you please check if there is any step you missed.

    RA6 Secure Firmware Update using MCUboot and Flash Dual Bank – Application Project (

  • Yes I am getting the exact state you sent. The screenshot I sent is after I tried to erase the second slot again after the state you sent.

    it got stuck. Then I cycled power and then got the screenshot I sent.

    (seems like it did try to erase second slot but it failed)

  • Hello sir,

    As far I can understand your issue is that as soon as you load the secondary application image and then you press again 2 to load again a new image through XMODEM on the MCU the erasing process, seems to get stuck? Is that correct?

    Could you please send me Flash layout in the new bootloader project you created?

    Have you also enabled the Dual Bank for RA6E1?

    And in header.h  file what are the macros that define these info as shown here in your application projects?

    The example is created such way so that:

    The flash is divided in two banks:

    And these are the addresses which are reserved for the bootloader and the primary and secondary application.

    Are you sure that you haven't enabled any block protection for code flash in the secondary application configuration.xml ?

    Check the settings under BSP Tab in BPS2:

    Or PBPS2:

    And let us know.