memory mapping 78KOR in CubeSuite++

I am attempting to access the dataflash memory on an R5F100LJ by setting up a memory segment.  The statement "MEMORY MY_FLASH : ( 0F1000H, 02000H )" in the linker directive file results in an error, "RA78KOR error E3116: memory area 'MY_FLASH' definition out of range".  The target file used is DR5F100LJ.DVF.

Can anyone think of what must be set incorrectly?

  • Which compiler do you use? CA78K0R or CC-RL?

    Why do you edit the linker file and do not input the section in CS+?

    How do you access to the data flash? Which flash library do you use?

  • Thank you for responding.

    I am using the CA78KOR compiler.

    This code further divides the dataflash into to two segments.  The CubeSuite+ manuals seem to indicate that this is accomplished by placing the following statements in the linker directive file:

    MEMORY MY_FLASH : (0F1000H, 02000H)

    MERGE MEM_POOL1:AT(0F1000H) = MY_FLASH

    MERGE MEM_POOL2:AT(0F2000H) = MY_FLASH

    Then the following pragma is required in each c file that requires access:

    #pragma section @ECNSTL MEM_POOL1    /* or MEM_POOL2 */

    Just out of curiousity, how is this accomplished on the Build Tools Property pages?

    I will be using the pfdl.lib to write to dataflash.

  • Please disregard my question about how to input sections into CS+. 

    REGULAR                                              0x00000000               0x000fffff

    STACK                                           0x000ff600                 0x000ffe1f

    MY_FLASH                                   0x000f1000               0x000f2fff

    MEM_POOL1                     0x000f1000                                -

    MEM_POOL2                     0x000f2000                                -

    ROM                                               0x00000000              0x0003ffff

    PFDL_COD                         0x00002100                              -

    SEG_1                                  0x00038800                             -

    @ECNSTL                           0x0000a800                             -

    SEG_2                                  0x00010000                             -

    RAM                                                0x000fb400                0x000ff5ff

    RAM_SADDR                                0x000ffe20                 0x000fffff\

    This generates the following file.

    ;MEMORY
    MEMORY STACK : ( 000ff600H, 00000820H ) / REGULAR
    MEMORY D_FLASH : ( 000f1000H, 00002000H ) / REGULAR
    MEMORY ROM : ( 00000000H, 00040000H ) / REGULAR
    MEMORY RAM : ( 000fb400H, 00004200H ) / REGULAR
    MEMORY RAM_SADDR : ( 000ffe20H, 000001e0H ) / REGULAR
    ;SEGMENT
    MERGE MEM_POOL1 : AT ( 000f1000H ) = MY_FLASH / REGULAR
    MERGE MEM_POOL2 : AT ( 000f2000H ) = MY_FLASH / REGULAR
    MERGE PFDL_COD : AT ( 00002100H ) = ROM / REGULAR
    MERGE SEG_1 : AT ( 00038800H ) = ROM / REGULAR
    MERGE @ECNSTL : AT ( 0000a800H ) = ROM / REGULAR
    MERGE SEG_2 : AT ( 00010000H ) = ROM / REGULAR

    Which causes the following linker errors.

    RA78KOR error E3116: Memory area 'MY_FLASH' out of range

    RA78KOR error E3116: Memory area 'ROM' out of range

    RA78KOR error E3210: Segment 'SEG_2' is not exist - ignored

  • I still have linker problems that have not been solved.  Sorry, if my last message sounded as if the problem may have been solved.  The end of my last shows that using the link directive generator actually increased the number of link errors.  As an experiment, I commented "MEMORY ROM : ( 00000000H, 00040000H ) / REGULAR" from the generated *.dr file.  Then the link errors were reduced to two:

    RA78KOR error E3116: Memory area 'MY_FLASH' out of range, and

    RA78KOR error E3210: Segment 'SEG_2' is not exist - ignored.

    When my original *.dr file is used, only E3116 results.

    Any ideas?

  • The segment definitions are only accepted if these sections are used in your code somewhere. Use for example for a const definition #pragma section @@CNST MemPool1

    I don't know yet about E3116 because I don't have this.

    And I don't why you always write ...KOR where the tools are named ...K0R.

  • My pragma statements are:

    #pragma section @ECNSTL MEM_POOL1  // in the c file that is to access 0F1000H to 0F1FFFH, and

    #pragma section @ECNSTL MEM_POOL2  // in the c file that is to access 0F2000H to 0F2FFFH

    E3116 is explained as: "The sum of the start address and the size of the memory area in the memory directive is greater than 1048575(0FFFFFH)."

    I do not understand.  0F1000H + 002000H < 0FFFFFH.

    0 and O look very similar in CS on my screen.  I will type K0R from now on.

    I do have another important clue.  A coworker loaded CubeSuite and my project onto his machine.  The project built.  We have not been able to figure out which environmental differences may be the cause.