(Nano-)Bootloader, Flashloader (<=SSP 1.3.0), Downloader, Secure Boot Manager (S5 only): Please advise what to choose for a S3A1 UART/USB field update?

We started in 2016 with S7 and S3 µC and developed our own boards, since that we are waiting for an easy to implement and maintainable bootloader/flashloader.

Every time in the last years when I've visited the Renesas booth on embedded world, they guys told me that an useable bootloader framework will be offered in the future.

Then finally when Renesas provides a bootloader/flashloader, Renesas - as far as I know - stopped the support with SSP 1.3.0., why?

May be I'm the only developer, who is confused which bootloader to choose now, ensuring support by Renesas also in future SSP versions.

So I'm not misunderstood, I have to say that I really appreciate SSP and also the support here in RenesasRulz, but regarding the subject bootloader I can't see a really clear and future-proof concept compared to other SSP modules.

E.g. ST provides CAN/Ethernet/USB/UART bootloader versions for their STM32 Cortex M series, why it is not possible to provide something similar for the Synergy family?

Background of this post is, that we actually have to plan a project for huge number of devices, installed all over the country in the next years, but being now unsure which solution we should choose.

What other piece of advice can you give us than to implement the bootloader itself?

Thank you very much and best regards

Ralph

Parents
  • Hi,

    The Synergy S3 devices do not have the same security and crypto capabilities as the S5 series and as such the SBM is not suitable for the S3 parts. Namely, the S3 does not have hardware support for public/private key crypto (RSA/ECC) or SHA256 hashing both of which are required by the SBM. The SBM also uses symmetric AES crypto which the S3 series does have.

    Therefore, I would look at the flashloader project. This project is designed as a starting point to assist in developing a bootloader. It would be possible to add security features within the capabilities of the S3 hardware if necessary.

    Below is a link to a pack file for the flashloader which can be used with versions of the SSP beyond 1.3.0.

    renesasrulz.com/.../REA.Synergy_5F00_flashloader.0.0.0.pack.zip

    Regards,

    Ian.
  • Hi Ian,

    thank you for your reply and the link to the pack file!
    Yes I knew that only S5 MCU provide a secure bootloader function, I only want to point out that in this case the provided information are not clear compared to other modules.
    So after installing the pack I can see now the regarding Renesas stacks. Is there any sample project or further documention available or can I use the document "Customizable Flashloader Solution for Synergy MCUs (R11AN0073EU0112 Rev.1.12 Dec 28, 2018)" even if it is limited to SSP 1.3.x ?

    Thank you very much and best regards

    Ralph
  • Hi Ralph,

    The Flashloader will work with SSP 1.6.0 so there is no need to upgrade.

    I will put a couple of basic examples together which you should be able to take an build upon.

    Regards,

    Ian.
  • Hi Ian,
    this sounds very good and thank youvery much in advance!
    One question, I'had a view on the Flashloader examples provided for SSP 1.3.x. there are different bootloader projects for UART and CDC (blockin and non blocking), but I thought the bootloader does only the flashing job, so normally there is no need to provide any communication interface and to distinguish between UART and CDC or did I miss something?

    Thank and best regards
    Ralph
  • Hi Ralph,

    The Flashloader is supplied as two projects used together. One is the bootloader and the other is the downloader. The downloader example is just that, responsible for downloading the new image and does nothing more than flash the board LEDs. In a real application the downloader is your application and the downloading the image will be part of it. The supplied examples use a Python script to perform the image transfer via a serial interface using the PySerial Python library. For this reason the downloader supplied must support a serial interface. There are two version supplied, one using a UART and the other using USB-CDC. The examples I am putting together (sorry for the delay I was feeling unwell on Friday) use USB-CDC and are based on the blocking example.

    The bootloader as supplied operates slightly differently depending upon whether the blocking or non-blocking example is used. The blocking example as supplied separates the internal flash memory into 3 sections. One is for the bootloader. The rest is split into two equal halves called slot 0 and slot 1. The downloader is linked to run from one of these slots. So, say it is running from slot 0 then the next update will be put into slot 1 and then the next in slot 0 and so on. The bootloader when it starts looks at what it is in the two slots, performs a CRC and if both are valid it boots the one with the latest version number or the only valid one if that is he case.

    For the non-blocking example the new image is downloaded into external memory. When the bootloader starts it checks the external memory for a new image and then handles the erasing of internal flash and programming of the new image.

    All of this is documented in the supplied PDF but takes a few reads to get your head around! It did for me anyway.

    The flashloader as supplied is unlikely to be a perfect fit but as it is supplied as full source then it can be changed as needed.

    I'll post the examples as soon as I have them completed.

    Ian.
  • downloader_usb_cdc_blocking_s3a1.zipbootloader_usb_cdc_blocking_s3a1.zipbootloader_usb_cdc_blocking_s7g2.zipdownloader_usb_cdc_blocking_s7g2.zip

    Hi Ralph,

    Attached are flashloader bootloader and downloader projects for the SK-S7G2 and TB-S3A1. Both are blocking using USB-CDC and the transfer interface.

    Hopefully they will be useful.

    Regards,

    Ian.

  • Hi Ian,

    thank you so much for your work and your support. Actually I can successfully program the bootloader and downloader to our custom board. With breakpoints  I've verified that the bootloader is called first before jumping to the downloader application with flashing leds.

    But now I'm stucking in converting "downloader_usb_cdc_blocking_s3a1_crc.srec"  (or should I use the one without crc) file to BCH, the GUI always shows the error message "Error! Please fill in all the information before attempting to convert the script.".

    I've attached the screenshot, but I think I've provided all necessary information.

    Thanks and best regards

    Ralph

  • Hi Ralph,

    In the version of the bootloader/downloader supplied originally with the documentation has a limitation that the version downloaded by the debugger does not have the CRC in it. This is because the CRC is added in by the Python tool. So, on the debugger if the bootloader is run it will fail to call the main application because of this. So, the build step adds the CRC so it works with the debugger.

    When converting the SREC file to BCH the non-CRC version should be used.

    I did not use the PC GUI tool as I ran into problems initially and so called the scripts manually. Here's what I used for the S3A1 for slot 0.

    C:\Python27\python.exe r_fl_mot_converter_modified.py -i downloader_usb_cdc_blocking_s3a1.srec -o downloader_usb_cdc_blocking_s3a1.bch -m 1024 -f 256 -e 0x20000 -l 0x20800 -s 0x0070000

    I erased slot 0 via COM14 (-p option uses 13 (14 -1)).

    C:\Python27\python.exe r_fl_serial_flash_loader.py -p 13 -c erase -b 0

    Then to load it using COM14.

    C:\Python27\python.exe r_fl_serial_flash_loader.py -p 13 -c load -f downloader_usb_cdc_blocking_s3a1.bch

    I hope this helps.

    Regards,

    Ian.
  • Hi Ian,

    thank you for providing the scripts. When I compile your S3A1 sample the .._crc.srec file is generated via the "CRC_Script" , which is included in your project folder. I've searched over and over but I was unable to find where this script is invoked and where to configure that. In your script you use the "r_fl_mot_converter_modified.py" script in the pack I've got, there is only the "r_fl_mot_converter.py" script , is there any relevant difference?

    Thanks and best regards

    Ralph
  • Hi Ralph,

     

    The CRC version of the SREC file is created by an e2studio custom build phase. This can be found in the Builders section of the project's peroperties.

     

     

    This is only needed when using the debugger and the first build and not when using a free running version of the donloader and/or subsequent builds.

     

    Apologies for not included the newer Python file. Please find it attached. This was modified by another form user, Erik, and fixes an issue where a 4k section of flash can be mistaken for RAM and excluded from the output.

     

    Regards,

     

    Ian.

    r_fl_mot_converter_modified.zip

  • Hi Ian,

    thank you for providing the modified Python script! Actually I've got the problem, that your bootloader (S3A1) won't jump to my own downloader application (also S3A1), caused by different CRC values.
    But the image is correct located - for my opinion - because, when I change the the crc value in the debugger, so that the values are equal, the downloader is started correctly (leds are flashing) and also the breakpoints work correctly (symbols match with .._crc_srec file).

    I don't know what the reason could be, I compared everything with your project but I can't found any difference until now.
    The header valid mask, image version everything is correct, but the CRC value. I use the same batch and the same values from your CRC script.

    May be you have any idea?

    Thanks and best regards

    Ralph
  • Hi Ralph,

    In the crc_add.bat file on the call to srec_cat.exe (line 33) temporarily remove the "2> nul" from the end of the line. This will then allow the srec_cat.exe tool to output to the build console. If there is anything going wrong with this tool it will be displayed. You can ignore the warning about a hole in the area being checksummed as the hole is where the CRC is being placed.

    Regards,

    Ian.
Reply
  • Hi Ralph,

    In the crc_add.bat file on the call to srec_cat.exe (line 33) temporarily remove the "2> nul" from the end of the line. This will then allow the srec_cat.exe tool to output to the build console. If there is anything going wrong with this tool it will be displayed. You can ignore the warning about a hole in the area being checksummed as the hole is where the CRC is being placed.

    Regards,

    Ian.
Children
No Data