How to include "ID-code protection" in ".bin" file generated with e2Studio

Hello all,

I'm working with an S3A6 and its ID-code protection feature. My e2Studio and SSP versions are 7.6.0 and 1.6.2 respectively. The ID-code protection is working fine after downloading it to the microcontroller with a J-LINK EDU: I can set different codes without any problem and debug the whole program:

However, I have a problem when using the SEGGER FLASHER PORTABLE PLUS and J-FLASH software:

To program the S3A6 with SEGGER FLASHER I need to dowload the ".bin" file generated in the "debug" folder during the building process in e2Studio. The program is correctly dowloaded to the S3A6 and the PCB works as expected, but the ID-CODE is never updated. In other words, the valid ID-CODE to unlock the device is the last one that I burnt with J-LINK EDU and e2Studio, not the one that I burnt with FLASHER and J-FLASH

Is this happening because I haven't compiled the ".bin" properly? How can I solve this?

 

Thanks in advance!

  • Have you checked the .ld file to see if ID Code loading is suppressed? Here is an example of how NOLOAD works:

    en-support.renesas.com/.../19114566
  • In reply to WarrenM:

    Hi Warren, thanks for your response.

     

    My script doesn't use the word NOLOAD:

     

    In addition, this is the end of my ".bin" file:

    OSIS Register is saved in address 0x01010018, but in my ".bin" there's no code beyond address 15790.

    How can I tell e2Studio to include the ID-CODE?

  • In reply to hardwariano:

    How are you currently creating the binary file? Is there a reason you are using a binary file rather than an srecord file?

  • In reply to Jeremy:

    The ".bin" file is being configured like this:

    This is something new to me so I don't know if there are any other options or I've done something wrong.

    The reason we're using a binary file is that it's easier for us read and use those files in other applications. However, we could use the other files if necessary.

  • In reply to hardwariano:

    The ID Codes are in their own sections (from the linker script file):-

     

    So you would have to add those sections as well :-

     

    To include the ID codes in the binary output, though the binary out file will be about 16MB in size, because the file will have to have padding added. Alternatively output an S-record file.

  • In reply to Jeremy:

    It worked! Thanks Warren!

    It worked when I generated the S-record file the way you told me. However, when I tried to do the same with a binary file, J-Flash showed me this message:

    What could be happening?

  • In reply to hardwariano:

    The binary file has padding (as a binary file has no address information) between the code and the ID Bytes. This means there is padding data in the binary file where there is no flash memory. JFlash detects the binary files contains data at locations where there is no flash, and returns an error.