Unable to load my code in R5F21258SNFP through Renesas E8a deubgger -"Memory area error. It is outside the effective address range" warning is shown by emulator.

Specifications

  • Controller: R5F21258SNFP 
  • Debugger: Renesas E8a 
  • ToolChain : M16C
  • IDE         : HEW Version 4.08.00.011
  • Evaluation Version

Issue 

  •  When i try to load my code into controller. My  debugger is getting connected but when trying to load into the device, the emulator throws the following warning. "Memory area error. It is outside the effective address range".

 

  • For your kind reference the Memory details are below
    • DATA 0002757(00AC5H) Byte(s)
    • ROMDATA 0003776(00EC0H) Byte(s)
    • CODE 0053064(0CF48H) Byte(s)

Attachments

      Please find the attachments in the URL(Google Drive)

  • Files
    • Build Output Log file
    • Map File (File name Rest.map)
  • Images
    • Memory Area error warning message
    • Build Log
  • Related Files
    • ncrt0.a30
    • nc_define.inc 
    • sect30.inc

 

 

  • The debugger has information about the available memory range in the processor. It "knows" that program flash uses the address range 0x004000 - 0x13FFF. Your code goes far beyond this area. Please split your code to near code and far code areas.
  • In reply to FrankL:

    Noted and Thanks. It was very helpful.

    Now i face a problem wherein my library files are creating a issue. sprintf,strncpy,strlen etc are not able to link properly. This causes my device to hang completely. I use nc30lib and have set CPU settings to R8C/2X series

    How to overcome this issue.
  • In reply to Raja:

    Sorry, a description "it does not work, why" does not give any hints as to what could be the problem.
    What gives you the idea that it is a library problem?
    I have never heard of a library problem crashing an application.
    To which addresses are your libraries linked?
    Have you checked the library calls in your application? Do they go to the correct addresses?
    Which CPU type do you select?
  • In reply to Raja:

    Hi Raja,

    Is this issue okay now? Please confirm so that we can close this thread. Thank you.

    JB
    RenesasRulz Forum Moderator

    https://renesasrulz.com/
    https://academy.renesas.com/
    https://en-us.knowledgebase.renesas.com/

  • In reply to JB:

    I resolved the issue using #pragma. I have another question. Is it possible to write/erase half of 1kb page (internal flash).
  • In reply to Raja:

    You can write a single byte, but you can only erase complete blocks. So 1KB in data flash is minimum.
  • In reply to FrankL:

    Noted and thanks. While writing Flash i must check whether Vcc falls below 2.7 V

    Found this document: reu05b0104_r8cap.pdf where API_MonitorVccAndResetIfLow seems useful.

    But i couldn't find the iec_tests.c iec_tests.h.
  • In reply to Raja:

    This application note is for implementing self test for IEC 60730.
    Did you also download the sample source code?
    www.renesas.com/.../D3000500.html

    I would guess this is much more than what you are looking for. The monitor software initializes the voltage detection circuit and resets the processor if the voltage detection is triggered.
  • In reply to FrankL:

    Thank you for the quick response. Minutes ago i found the same document. I was lost initially!!
    My aim is to stop writing into internal flash if my Vcc goes beyond the 2.7V being said in Datasheet

    how to enable the interrupt of voltage monitoring?
    how to get the voltage value from registers?

    Pseudocode:
    if(Voltval( )>2.7V) //Voltvalfunction shall return value
    {
    Result=FlashWrite((FLASH_PTR_TYPE)0x2400,(BUF_PTR_TYPE) local_buff,902);//BlockA
    while(Result)
    {
    //try 3 times
    then break;
    }
    else
    {
    display error on screen
    }



    unsigned char Voltval(void)
    {

    /* Protection off for VCA2 and VW1C */
    prc3 = 1;

    vw1c1 = 0x01;//bit 1 dig filter disabled
    vca26 = 0x01;//bit 6 set , Voltage detection 1 circuit enabled

    //wait for 100 μs
    asm("nop");
    asm("nop");
    asm("nop");
    asm("nop");

    vw1c7 = 0x00;
    vw1c1 = 0x01//dig filter disabled
    vw1c1 = 0x00;//volt monitor1 interrupt mode

    vw1c2 = 0x00;

    prc0 = 1;//prcr = 1; /* Protection off */
    cm14 = 0x00;
    prc0 = 0;//prcr = 1; /* Protection on */

    //wait time req only if dig filer is enabled

    vw1c0 = 0x01;//volt monitor enabled

    /* Protection on for VCA2 and VW1C */
    prc3 = 0;

    //BUT HOW TO RETURN THE VOLTAGE VALUE
    }

    ------------------------------------------------------------------------------------------
    In the sample code being provided (API_MonitorVccAndResetIfLow) Why is it shifted and divided. In my case wherein i have to just know the Vcc . how can i implement it.

    And my OFS register is something like this in sect30.c
    ;===============================================================
    ; fixed vector section
    ;---------------------------------------------------------------
    .section fvector,ROMDATA ; fixed vector table
    ; .org 0ffdcH
    .
    .
    .
    .
    ; option function select register
    ;
    .ofsreg 0FFH //THIS ONE

    .endif ; __R8C


    Regards
    Rajavelu
  • In reply to FrankL:

    How should i enable the Voltage Monitor 2 Interrupt? While doing so my code id was corrupted and i couldn't reprogram my MCU.
  • In reply to FrankL:

    Hi, Please provide me some solution, i'm stuck up in creating the voltage monitor 2 interrupt