I am using the RL78/78K0R compiler in the CubeSuite+ environment.
When building a project for an RL78 family MCU with a mirror area, the following error occurs.
RA78K0R error E3206: Segment '@@CODEL' can't allocate to memory - ignore
The program is a size that can be located in on-chip ROM. Why does this occur?
Please tell me how to work around this problem.
In a device with a mirror area, the @@CNST section which has a narrow allocatable range is allocated in the mirror area before the @@CODEL section.
This will divide the empty area (gap) so that the @@CODEL section cannot be allocated, and thus this error occurs.
Check the size of the @@CODEL section and the empty area (gap) in the map file and adjust the location of the @@CODEL section so that the @@CODEL section can fit within the range of the code flash area.
An example of the map file at error occurrence and how to solve the error are shown below.
[Map file example at error occurrence]
78K0R Linker Wx.x Date:xx May 20xx Page:x （snip） * gap * 00316H 01CEAH ※1 @@CNST 02000H 00C1EH CSEG MIRRORP @@CNST @cstart 02000H 00000H （snip） @@CNST xxx_xxxx 02C16H 00008H * gap * 02C1EH 011E2H ※2 ??OCDROM 03E00H 00200H CSEG （snip） *** Not allocated segment *** SEGMENT SIZE TYPE MEMORY @@CODEL 0021EAH CSEG BASE ROM ※3
In the above example, the empty area (gap) being divided by @@CNST (*1, *2) prevents @@CODEL (Size: 0021EAH (*3)) from being placed in the code flash area, thus resulting in an error.
In this case, the solution is to specify an address in the link directive file as shown below so that the @@CODEL section is allocated near the address of the first empty area (gap).
merge @@CODEL: AT (400H)
|CS+ (formerly CubeSuite+)|
|C Compiler Package for RL78 and 78K Families|