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

AURIX™ Forum Discussions

Not applicable
Hi, I'm writing an application that will be sent in Boot mode to TC17xx, my problem is to understand very well how LSL file is working (I have read the PDF documentation)
The error I have it's "requirement: 0x1c bytes of ROM area in space spe:tc:abs18", my memory space is located 0xD4000000.
Can someone post a LSL file to use where the only available memory is the sram at address 0xD4000000 and put all sections in this piece of memory?

Best regards
GMG
0 Likes
3 Replies
User13290
Level 5
Level 5
First solution authored
Hi,

gmgunderground wrote:
Hi, I'm writing an application that will be sent in Boot mode to TC17xx, my problem is to understand very well how LSL file is working (I have read the PDF documentation)
The error I have it's "requirement: 0x1c bytes of ROM area in space spe:tc:abs18", my memory space is located 0xD4000000.
Can someone post a LSL file to use where the only available memory is the sram at address 0xD4000000 and put all sections in this piece of memory?

Best regards
GMG


I can't provide an LSL as such, but I can give you my hunch, for what it's worth. It might point you in the right direction. You might want to take a look at the following menu:

"Project | Properties | C/C++ Build | Memory"

This should produce a pane that contains a number of TAB's that control several macro's that are being used to preprocesses the LSL file. Probably you already did some tinkering in here, but the TAB I'm referring to in particular is the "Specical Areas" TAB. This controls macro's that deal with the reset vector and the vector table, and those may not be in alignment with your memory definitions of the "Memory" TAB. Possibly they need to be adjusted.

Hope this will help.

Best regards,

Henk-Piet Glas
Principal Technical Specialist
0 Likes
User13836
Level 5
Level 5
10 solutions authored 50 replies posted 25 sign-ins
Hi!

The cause of the linker error you got is that near addressable ROM sections are included in your code. Those need to be placed in the first 16kB range of a 256MB segment:

0x?0000000 to 0x?0003FFF

Since no memory is available (0xD4000000 is far outside of this range) the linker complaints. You can prevent the automatic near allocation of data ny using the C compiler option -N0. Then all variables will be far addressed and can be placed outside of this range. In case you are using the Eclipse environment you can fill in the value 0 (zero) in menu:

Project >> Properties >> C/C++ Build >> Settings >> C/C++ Compiler >> Allocation

under 'Threshold for putting data in __near'.

About locating a bootloader in the RAM range starting at 0xD4000000: The linker refuses to place const and program code sections in RAM memory. To mitigate this you can add a writeable attribute to the sections you would like to place in RAM memory using an attribute entry in the LSL file like:

section_layout ::linear
{
// attributes rwx -> read, writeable and executable
group BOOTLODER_CODE (ordered, run_addr=mem:spe:spram, attributes=rwx)
{
// all program code sections shall get the writeable attribute
select ".text.*";
}

Or you can modify the memory settings in menu:

Project >> Properties >> C/C++ Build >> Memory -> Memory tab

and change the memory type for the SPRAM from RAM no NVRAM. Then the linker will also place read only sections in this range without complaining.

Attached is a minimized project which is placed in range starting at 0xD4000000. I simply reserved the other memory ranges then the linker won't place sections in there. Exception: the context save ares (CSA) range. This is starting at 0xD0004000. This project also does not use interrupt or trap vectors.

The tasks the C startup code shall execute are configured in menu:

Project >> Properties >> C/C++ Build >> Startup Configuration

The placement of sections like the reset vector is configured in menu:

Project >> Properties >> C/C++ Build >> Memory -> Special Areas tab

You can import the project into an Eclipse workspace using:

File >> Import >> General >> Existing Projects into Workspace

Best regards,
Ulrich Kloidt

TASKING tools support
0 Likes
Not applicable
Thank you ulrichk, you are right, I have found quite the same approach, but your is more fine.

Best regards
GMG
0 Likes