RL78/F13 hex file doesn't run

Hello everybody,

I'm quite experienced with microcontrollers programming, but I'm a real beginner with Renesas family !

I'm building my first application for RL78/F13 (R5F10BGG), and I'm facing a beginner issue. Actually, my application is as simple as possible : just toggeling an IO in the while(1) loop.

I'm using e2 studio IDE, cc-rl compiler and Renesas E1 programming probe.

My project is running fine in HardwareDebug mode.

The issue comes when I switch to release mode. The hex file is generated, and I can download it to my target with Renesas Flash Programmer. But the program is not running anymore. So basically, In can debug my software, but I can't run it standalone.

Is this a classical beginner issue with RL78 controllers ? I'have searched Google for a day, but found nothing relevant.

Is it possible to directly download the hex file from e2 studio ? I haven't found a way to do so !


Thank you for supporting


  • Does your software have debug settings?

    There is an option byte to enable debug mode (address 0x00C3). This has to be modified for release.

  • Hello,
    Thank you for supporting !
    0x00C3 is the DEBUG OPTION BYTE. It is set to 0x84 in HardwareDebug mode, and 0x04 (on-chip debug operation disabled) in release mode. So normally it should work... but no !
    This byte is configured in Project/Properties/C-C++ Build/Settings/Tool settings/Linker/Device. Is it possible that it's overwritten somewhere else ?

    Any other hint ?

    Thank you
  • In reply to franck_tlse:

    It could also be defined from software as const.
    The easiest way is to have a look at the hex-file to see what the value at 0x00C3 is.
    Beside this you may have the normal problems of some initialization that is done by the debug monitor in the debugger and that is missing if no debugger is present:
    - missing stack pointer initialization
    - missing clock initialization
    - missing variable initialization
  • In reply to FrankL:

    Hello Frank,

    I checked the hex file, and the option bytes values seems to be OK.
    Initializations looks like a good suggestion. How should I include this in my code ?
    I have cstart.asm and stkinit.asm in the generate folder. How can I check if they are included in my release build ?

    Is there any documentation on the initialization / startup process ?

    Thank you very much for supporting

  • In reply to franck_tlse:

    You could try this project. It has port toggle for P66 and P67 based on TAU0. and a RFP project for programming.

    The project is for R5F10BMG but it should also work when the processor is changed to your R5F10GG.

    Don't forget to disconnect E1 when you want to run stand alone. A connected E1 will keep RL78 in RESET.


  • In reply to FrankL:


    Thank you for the project. I will test it, but have some compilation errors at the moment.

    In the meantime, could you have a look at my minimal project if you have some time ? Just to check some beginner mistakes in configuration !


    Thank's a lot for supporting


  • In reply to franck_tlse:

    Hi Franck,

    Just wanted to follow up if you've figured out this issue? Have you been successful running RL78/F13 hex file?

    RenesasRulz Forum Moderator

  • Hi Herald,

    Thank you for the follow up !
    Yes, I succeeded running my hex file.
    The issue was a bad clock configuration ! Kind of beginner mistake :-)

    Thank you