USB Bootloader with external flash QSPI

Hi.

I'm trying to get my application to load, one part in the internal flash and another part in external flash by QSPI. Putting in the definition of the function  <BSP_PLACE_IN_SECTION (". Qspi_flash_code")>, I got it and it works correctly in debug mode. But I need to generate the file to be able to update it on my board through a USB bootloader using a pendrive.

I have the problem when generating the file to convert from SREC to BCH. The Renesas Synergy Flashloader application returns the error: ('Indexing Error, Slot:', 1609564160). Can someone help me to do this?.

My script is:

MEMORY
{
FLASH (rx) : ORIGIN = 0x00100000, LENGTH = 0x0300000 /* 3M */
RAM (rwx) : ORIGIN = 0x1FFE0000, LENGTH = 0x00A0000 /* 640K */
DATA_FLASH (rx) : ORIGIN = 0x40100000, LENGTH = 0x0010000 /* 64K */
QSPI_FLASH (rx) : ORIGIN = 0x60000000, LENGTH = 0x4000000 /* 64M, Change in QSPI section below also */
SDRAM (rwx) : ORIGIN = 0x90000000, LENGTH = 0x2000000 /* 32M */
}

 

Loading the entire application in the internal flash, works correctly. Once the .BCH file is generated, I update it with a pendrive through the USB port.

 

Regards.

Fernando

  • Hi Fernando,

    Any updates with your concern? Have you already found a way to generate a .BCH file? If not yet, please wait a little bit more until Synergy experts respond to your post. Thank you for understanding.

    JB
    RenesasRulz Forum Moderator

    https://renesasrulz.com/
    https://academy.renesas.com/
    https://en-us.knowledgebase.renesas.com/

  • Hi Fernando,

    I don't think the flashloader framework can handle QSPI memory by default. It is intended to flash applications stored in internal flash memory, you might need to customize it.

    Regards,
    adboc
  • In reply to adboc:

    Hi.

    Thanks for the help and apologies for the delay in responding.

    I am trying to modify the bootloader program to be able to work with qspi flash memory. But first I need to be able to generate the files img#qspi.bch and img#mcu.bch separately and that's what I do not know how to do it.

    Regards.
    Fernando
  • In reply to feraro:

    Hi

    Can anyone help me generate the files img#qspi.bch and img#mcu.bch with the program "Renesas Synergy Flashloader.exe" when I have part of the code in the internal flash and another part in the external flash qspi ?.

    Thank you very much

    regards

  • In reply to adboc:

    Hi adboc.

    I have configured in my project that some functions are stored in the qspi flash memory.

    I attach the .srec file generated by e2studio when building the project.

    From this file, can you tell me if it is possible to generate two .bch files to be able to load them with the bootloader on my SK-S7G2 board?

    One file I want to record in the internal flash and the other in the flash qspi.

    When I generate the two files separately, my goal is to modify the bootloader so that the file can be recorded in the flash memory qspi. But the first thing I need is to know if it can be done and how to do it.

    Thank you so much for everything.
    Regards
    Fernando

     

    https://we.tl/RhJTH7ahox

  • In reply to feraro:

    Hi Fernando,

    I don't think the Flashloader utility (or the underlying r_fl_mot_converter.py Python script) has any restrictions on memory addresses, so it should successfully convert SREC image of QSPI memory to BCH format.

    Regards,
    adboc
  • In reply to adboc:

    Hi adboc

    There may be something that you are not understanding well.

    Is it not necessary to generate two bch files, one to load it in the internal flash and the other to load it in the qspi flash?

    Once I generate the .srec file with the e2studio, I have to edit it and generate the two srec files manually, and then convert them to the bch format.

    I already have the bootloader program customized to load a file in each flash memory zone. The file img#mcu.bch in the internal flash and the file img#qspi.bch in the external flash.

    Regards
    Fernando
  • In reply to feraro:

    Hi Fernando,

    I suppose BCH format supports multiple memory regions in one file, but not sure if the Flashloader utility can handle this. If your modified bootloader requires two images, I would go with building separate images for both internal flash and QSPI. Converting them separately using the Flashloader utility should work.

    Regards,
    adboc
  • In reply to adboc:

    Hi adboc

    That's what I'm trying to do, but I do not know if there's any way the e2studio can generate two different srec files, one for each flash zone.

    Currently, I open the srec file generated by e2studio with a text editor, and by copying the corresponding data, I generate two srec format files, one for each destination flash zone. But I would like to know if it can be done automatically.

    Thanks

    Regards
    Fernando
  • In reply to feraro:

    Hi Fernando,

    e2 Studio cannot generate two images directly, but you may use an external tool (e.g. in a post build step): srecord.sourceforge.net/

    Regards,
    adboc
  • In reply to adboc:

    Hi adboc.

    Ok, thank you very much for your help.

    Best regards.
    Fernando