FR Softune V6 Value Out Of Range Linker Error

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
msdoganay
Level 1
Level 1
First reply posted First question asked Welcome!

Hello everyone,

We have a product that has been in the field for a long time. We are adding new features. I got an error while compiling and  I want to ask you why. MB91F59BC was used.

When I check the .mp1 file, there is no problem in ram and rom space. There is no case of overflow. I share the details about it.

S_Addr. -E_Addr. Size Remain Name/State C
# 00010000-0003FFFF 00030000 --------- _INRAM01
00010000-0003E4AE 0002E4AF +00001B51

00010000-0003E4A8 0002E4A9 --------- USED
0003E4A9-0003E4A9 00000001 --------- GAP
0003E4AA-0003E4AE 00000005 --------- USED
0003E4AF-0003FFFF 00001B51 --------- FREE

# 7FFF0000-7FFFFFFF 00010000 --------- _INRAM02
7FFF0000-7FFF695B 0000695C +000096A4

7FFF0000-7FFF4958 00004959 --------- USED
7FFF4959-7FFF495B 00000003 --------- GAP
7FFF495C-7FFF695B 00002000 --------- USED
7FFF695C-7FFFFFFF 000096A4 --------- FREE

RAM -- Total(00040000) Used(00034E0B) Remainder(+0000B1F5)

# 00070000-0027FFFF 00210000 --------- _INROM01
00070000-001F9813 00189814 +000867EC

00070000-00070423 00000424 --------- USED
00070424-00073FFF 00003BDC --------- GAP
00074000-00078D68 00004D69 --------- USED
00078D69-00078D69 00000001 --------- GAP
00078D6A-0018AE79 00112110 --------- USED
0018AE7A-0018AE7B 00000002 --------- GAP
0018AE7C-001F9813 0006E998 --------- USED
001F9814-0027FFFF 000867EC --------- FREE

# 00330000-0033FFFF 00010000 --------- _INROM02
00330000-........ 00000000 +00010000

00330000-0033FFFF 00010000 --------- FREE

ROM -- Total(00220000) Used(00189814) Remainder(+000967EC)

 

As you can see I have enough space for both INROM and INRAM. But the error I get on compiler side is:

*** D:\Project\Source_Code\src\freqInput.c(168) E4329L: Value out of range (0x00082640)
*** D:\Project\Source_Code\src\freqInput.c(178) E4329L: Value out of range (0x0008261A)
*** D:\Project\Source_Code\src\freqInput.c(201) E4329L: Value out of range (0x000825C6)
*** D:\Project\Source_Code\src\freqInput.c(211) E4329L: Value out of range (0x000825A0)
*** D:\Project\Source_Code\src\freqInput.c(261) E4329L: Value out of range (0x000824FC)

Address space included in the error is located in INROM1. (# 00070000-0027FFFF)  

It looks like a memory overflow on the code side. I am able to compile when I cancel some functions. 

Thank you advance for your valuable support on this topic.

 

 

 

 

 

 

 

 

0 Likes
6 Replies
zzz_3221081
Level 5
Level 5
25 solutions authored 100 sign-ins 10 likes received

What I can tell from my limited experience with FR60 MCUs is the following.

The "INRAM" and INROM" sections are only containers, you need some specific sections inside.
Here a screenshot of linker settings from one of my projects.

zzz_3221081_0-1670221879172.png

The sections marked with a red arrow are required AFAIK, the fourth is a user-added one.
For reference, check e.g. your startup code.

Another point you might check are optimisation settings.
Several of my project don't fit in ROM/FLASH when I reduce or disable optimisation.
And second, the FR60 can use a short 20-bit offset to reduce code size, whith this setting might cause trouble in larger projects.
Though I guess this does not apply to your problem.

zzz_3221081_2-1670222408396.png

 

 

0 Likes

First of all thanks for quick response. I make the setup section settings you mentioned in Other option oh the Linker tab. 

 

msdoganay_0-1670236340595.png

 

Linker->Disposition/Connection->Auto Disposition Mode 2 is set.

msdoganay_2-1670236756265.png

 

The full option list:

-g
-V
-AL 2
-ra _INRAM01=0x00010000/0x0003FFFF
-ra _INRAM02=0x7FFF0000/0x7FFFFFFF
-ro _INROM01=0x00070000/0x0027FFFF
-ro _INROM02=0x00330000/0x0033FFFF
-check_rora
-check_locate
-m
-mmi
-xlf
-slf
-mlf
-pl 60
-pw 132
-alin "D:\Project\Source_Code\Debug\LST\"
-alout "D:\Project\Source_Code\Debug\LST\"
-Xals
-Xalr
-na
-L "lib\softune_rev600012\use_vsync_update"
-w 1
-Xdof
-Xset_rora
-cwno
-a
-cpu MB91F59BC
-l lib911.lib, lib911if.lib, lib911e.lib
-l gdcdrv.lib
-l gdcenv.lib
-sc INIT/const=_INRAM02
-sc @INIT/const=_INROM01
-sc WORK_FLASH/const=_INROM02
-o "D:\Project\Source_Code\Debug\ABS\91590_template_9159bc.abs"

msdoganay_1-1670236505737.png

The thing I don't understand is: Why can't the linker create mhx even though INROM1 has enough space?

 

 

 

 

0 Likes

Since it is no new project, I assume you have not added any new sections.
Another point I remember :
You can force specific location via pragmas in the source code, a la :
#pragma section INIT=EEFLASH,attr=CONST
However, this alway applies to all eligible items in the source it is specified in, and later pragmas override earlier one's without warning.

If I remember correctly, the Softune linker sizes the sections dynamically in the "container" (i.e. _INROM1), in the order specified in the setup.

Your code section is immediately followed by a CONST section.
Not sure if you need this much space for constants.
You could e.g. try to delete the CONST section in INROM1, create an INROM2 section, and add the CONST sector there.

Besides the map file, the toolchain can create additional files like cross reference maps:

zzz_3221081_0-1670242168840.png

Perhaps that can help you.

0 Likes
zzz_3221081
Level 5
Level 5
25 solutions authored 100 sign-ins 10 likes received

Looking the error message itself up, it says the following:

E4329L Value out of range (value)
Overflow occurred in relocation operations.
This message contains the source program name including the description of data for relocation and the
line numbers. Use this information to check the program.
If you can use the tag jump of your editor, you can jump to the corresponding source lines immediately.

(FR Family SOFTUNE Linkage Kit Manual for V6, Spec. # 002-04570 Rev. *A)

Since explicit line numbers of source code are listed in the error message, I would check the sources.
Do they call external functions ?
If not set already, I would try to change the mentioned optimisation point "Code Area of External Symbol Size" from 20 bit to 32 bit, if not already done. AFAIK 20 bit is the default.

0 Likes

Do they call external functions ?

- Yes there is external functions but same error for global variables. Even if I change the order with set linkage order, result is the same.

msdoganay_0-1670310998234.png

If not set already, I would try to change the mentioned optimisation point "Code Area of External Symbol Size" from 20 bit to 32 bit, if not already done. AFAIK 20 bit is the default.

- Code Area of External Symbol Size is already 32.

You could e.g. try to delete the CONST section in INROM1, create an INROM2 section, and add the CONST sector there.

- This solution did not work.

At optimization level 1, code is compiled. But I should be able to compile without optimization. Because I have enough memory. 

 

 

 

 

 

0 Likes

As you might have guessed, I am not an Infineon/Cypress/Spansion/Fujitsu employee, but a Softune user. And starting to deal with it when it had already been fallen out of support.

>  Even if I change the order with set linkage order, result is the same.

That would have been my next idea.
Have you tried to move the modules that cause the errors and that implement the external functions/variables directly adjacent ?
As a test, I would try to move both (error-causing functions and ext. functions/variables) into one module.

> At optimization level 1, code is compiled. But I should be able to compile without optimization. Because I have enough memory. 

I cannot really comment on that.
But it demonstrates there is a code size/distance issue for the linker. Except for the mentioned 20/32-bit offset, I know of no other restriction, at least for the FR60 MCU we are using.

As mentioned, our own application cannot be linked with optimisation setting 0 or1, because Flash is fully stretched. Albeit not ideal, this had been the case with many projects in different companies I came in contact with. Just saying ...

0 Likes