How to work with a bootloader?


I would like to learn how to work with a bootloader on a Synergy S3A7 device. My intention is to flash a bootloader which loads my application from internal flash memory, which can be updated trough a UART or USB connection if necessary. I found some documentation about the S7G2 DK, but the examples provided there don't work at all. It's mentioned that it is necessary to install SSP 1.3.0, but now we are at version 1.7.5. I didn't find a way to download this version. I can't either believe that there is a bootloader only for S7G2DK, but it's very hard to get some usable information about this topic, especially for Renesas Synergy devices.

  • Hi Kerberos,

    Information about Flashloader Framework (along with a download link) is provided in the following post:

  • In reply to Renesas Karol:


    That thread says that the Flashloader Framework has been deprecated in favor of the Secure Boot Manager.

    I've looked at both and I think I understand the Flashloader Framework pretty well. It nicely divides between the bootloader and the downloader, and lets you customize both (since the downloader is also going to be the application, that's good!). I am not sure how this works with debugging, though. When I connect via JTAG, does it flash both the bootloader and downloader, and start in the bootloader and jump to the downloader? And I guess there's no security at all for this process: anybody can JTAG in and download your exe code, right?

    However, I don't understand how the Secure Boot Manager works at all. It seems very confusing and difficult to debug with, and worst, I can't figure out how or if it can load an image that was downloaded by the application. Does the SBM allow loading an image that is stored locally?

    So... some guidance from the pros would be very helpful.

    1. Suppose I have two dev boards. One has the SBM installed, and the other does not. I build and debug my application on the non-secure board, and then install it via the SBM on the secure board for testing. Does that sound like a reasonable strategy? How do I ensure that the two environments are the same? How do I account for the resources consumed by the SBM (is it just some flash space, and how much?)

    2. Can the SBM load a file from a flash drive, SSD card, or other local storage? Can I modify the source code for the SBM to do so?

    3. I really don't understand how much I can customize the SBM. I don't need all the security keys; just verifying the image is valid and not letting anyone download the firmware is sufficient.

    So, if you were running a new project with these requirements: downloads encrypted updates from the web,decrypts and installs them off-line, if the install fails restores a previous version, and prevents users from copy the firmware out of flash: which approach would you use - FF or SBM?
  • Take a look at the appnote for the secure boot manager App Note. Most of your questions are answered there.

    Note the idea of using a secure boot loader is that it will verify that the code that it is booting is trusted ie that it was developed by someone known who had access to a private key to sign the image. That secure boot loader verifies that the code was developed by someone who knew that private key, without actually having that private key.

    If you don't need this, you can use the built in bootloader to update via uart or usb. If you want a bootloader that loads new code from another source, you have to write it using the bootloader framework.
  • In reply to larry_c_not_Renesas:

    I did read that document, and I couldn't quite figure out if it supported loading a saved file. Frankly I don't see how it could; and I gather they're not giving us the source code to the SBM so we can't customize it. I'll go read it again.

    Your last sentence, however, is the kind of guidance I was looking for. I'm concerned that Renesas isn't officially supporting the bootloader framework anymore. Surely the whole IoT fad means people want to download updates over the web. How does the SBM handle that?

    I guess I'm looking for the experience of people who have used the SBM in an actual project. How did it go? What were the downsides? What problems did it cause or solve?
  • In reply to MCP:

    The bootloader frameworks is your starting point. You have to decide thd source of the update file and write that part. You either use the framework, or write a bootloader from scratch. Two weeks vs two months is the difference.
    If you want to uodate your device from a uart or usb, that's builflt into most chips. You ground MD at boot, and the built in loader will read those interfaces. Renesas provides a PC tool to send the file. This takes 1 hr to set up.