RL78/L13 - CC-RL Compiler runtime issues on E2STudio V6

I have a project for our custom hardware using the RL78/L13 (R5F10WLEAFB - 64k Flash, 4k RAM). I am using E2STUDIO V6.0 and I have installed the CC-RL_V10500 compiler. 

Initially, I have been using the GCC compiler, but with my code growing, I had linker issues even with optimization and so I have moved to using the CC-RL compiler.

I created a new project, used code generator and adding my application files from the GCC project. So, pretty much, the source code is identical except for CC-RL specifics. The code compiles fine and I am running the hardware debug configuration on the target. The problem is that the board reboots repeatedly. The code runs to a point and resets.

I have a set the option bytes as follows: 6effaa84

I have also set IAWCTL = 0x00U;

Since hitting the issue, I have reverted to a more simpler project, which retains all the code generator code with some of my user defined functions for the UART1, and in my main() function, I simply print some text on UART1. This works fine. When I introduce more code, to detect a keypad keypress, I get some unexplained behavior where a function that checks if a key was pressed returns the key pressed or 0xFF if a key was not pressed. This is done by initializing a local variable to 0xFF and changing it to the value of the key pressed and returning this variable. I seem to always get 0x00 returned, when no key is pressed. Anway, after running this code in while loop for some time, the board just resets. This is just one part of the problem.

If I introduce more code, before the key detection and the while loop, where I am using the CSI0 port to write to registers on a transciever chip on the board, again, I hit issues with board resetting when R_CSI00_Send_Receive() is called.

Bear in mind that the equivalent simpler project, when compiled and run using the GCC compiler works perfectly fine. We also have a license for the IAR compiler. I created another project using IAR and, as with the GCC compiler, I can run the build fine on the target. 

My conclusion is there must be some differences in the compiler settings. At the moment, I am running the CC-RL without any compiler or linker optimization. Could there be some invalid memory access?

Where do I start with debugging this issue? I need some pointers.

Parents
  • Update - I managed to get the build to run without a reset. This occurred after I had ran up another project using the IAR compiler and after I had fixed some compiler warnings about function prototypes not being defined. I suspect that the problem was with the option bytes not being written correctly possibly and the WDT counter being enabled after reset. Since the other project using IAR, was stable. At this point I am not entirely sure, as I would image that each time I load a new project, the option bytes are erased and rewritten. I'm still concerned that things seemed to fixed themselves without understand the root cause. Could the option bytes not being written correctly, cause an issue here?
  • Hi Sudesh,

    Your case is quite complex and it would take time to replicate the error or at least confirm what causes the microcontroller to reset. Please give the forum more time to analyze your case. Thanks for understanding.

    JB
    RenesasRulz Forum Moderator
Reply
  • Hi Sudesh,

    Your case is quite complex and it would take time to replicate the error or at least confirm what causes the microcontroller to reset. Please give the forum more time to analyze your case. Thanks for understanding.

    JB
    RenesasRulz Forum Moderator
Children
No Data