How to increase RX66T boot loader size from 32Kbytes to 64Kbytes?

Hi, I'm using R5F566TAAGFF mcu for the project. The Renesas example bootloader with xmodem flash meory area size is less than 30Kbyte which is working fine.

I've updated code from xmodem to ymodem protocol, program is flash into flash memory and jumping to user application (with optimization level as 0 and code size is 36Kbytes). But if i reset or power cycle the MCU then the MCU is hanged in " flash_softwareUnlock() " function.  

r_main_userinit() -> flash_write_init() -> R_FLASH_Open() -> flash_softwareUnlock() ;

 

I've changed the optimization level as 1 and the boot loader program size is reduced from 36Kbytes to 26Kbytes. After that the reset or power cycle issue is resolved.

Then i've implemented I2C EEPROM read and write code, the code size is increased to 28Kbytes, but the I2C related code is not working.

All the issues are related to flash program size, then cross verified with " Renesas Starter Kit for RX66T Boot Loader Application Note " and the document shows the flash memory area Address from 0xFFF80000 to 0xFFF8FFFF which is 64Kbytes. Attached all the neccessary screeshots for your reference.

The flash program memory size for different test condition is listed below:

Protocol                             Flash Size                       optimiation level                 Boot Loader status                I2C Status

Xmodem-128byte                 30Kbyte                                 0                                  working fine                         Not Implemented 

Ymodem-1024byte               36Kbyte                                 0                                  Not working                         Working

Ymodem-1024byte               26Kbyte                                 1                                   working fine                         Not Implemented   

Ymodem-1024byte               28Kbyte                                 1                                   working fine                        Implemented but Not Working   

Requesting your support to increase the flash memory area from 32Kbytes to 64Kbytes. Please share the flash memory size increase related screenshots or working sample code for 64Kbytes. 

 

“Thank You in Advance”

Murali

  • Hello,

    I suspect that you may face issue while writing over 32KB, so you need to utilize more than 1 block. 

    Could you please try to follow these steps:

    • Open the code_flash.c file
    • Navigate to  write_flash_block function
    • Remove these lines 

    The code is erasing the flash ROM before writing, but the area is already erased at the preprocessing. Making the suggested modification will help you resolve your issue.

    Thank you,
    Panos

  • Hi Panos,

    Thanks for your support.

    The same logic suggested by Mr. Venu from Renesas Bangalore.

    I tried as you said, but result was same.

    In the first image:

    1.  I've masked the lines
    2.  Optimization level is assigned as 0. In memory usage window shows ~34Kbytes.
    3.  From the .mot file, user application start address is shown for reference.
    4.  It receive the file via teraterm and jumps to user application code. 
    5.  But if reset or power cycle happens then the code hanged/blocked in  flash_lock_state().

    In the second image:

    1. Due to some unexpected codition, code always hanged/blocked in the flash_lock_state().
    2. g_flash_lock value is 0.

    In the third image shows the g_flash_state for your reference.

    In the fourth image:

    1.  I've masked the lines
    2.  Optimization level is assigned as 1. In memory usage window shows ~26Kbytes.
    3.  From the .mot file, user application start address is shown for reference.
    4.  It receive the file via teraterm and jumps to user application code. 
    5. After power cycle or reset, jumps to user application code and working fine.

    In the fifth image:

    1.  Very rarely, code is blocked in Earasing Application code and it is not recovered.
    2.  If it is blocked then the MCU need to reset or power cycle. After that it is working fine. 

    In summary, after changing that the issue is not resolved fully. 

    Could you please provide any other suggestion for the issue.

    “Thank You in Advance”

    Murali

  • Do you use a custom board for the MCU?

    Also, did you modify the example?

  • Do you use a custom board for the MCU?

    Yes, My project is Inverter, pilot patch testing in progress.

    Also, did you modify the example?

    Yes, I've modified xmodem to ymodem protocol conversion and also adding i2c eeprom to store some information. 

  • Hi,

    Can you please try to make a simple test?

    Just try the example with the XModem and try to increase the app code to be higher than 32KB. Then follow my previous suggestion about deleting some lines of code. 

    Please let us know the outcome of the test.

    Thank you,
    Panos

  • Thanks for your response. Tomorrow i'll try and share the details with you.

  • I'm extremly sorry for the delayed response. 

    Issue1: Flash program file size increase issue.

    In crc.h file, APP_START code size is updated to 64Kbyte and after that the issue is resolved.

    Issue2: Erase application code block issue.

    I've missed to configure the watchdog timer Reset output.

    Thanks for your support.