How to put a whole .o File into ITCM(no IDE)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to put a whole .o File into ITCM(no IDE)

1,713 Views
david_huwyler
Contributor III

I need to place two .o Files into ICTM (flash_QuadSpi.o and fsl_flexspi.o) . The rest of the application runs from QSPI Flash. 

I succseeded in placeing the files into ITCM with the following linker script lines at the start of the "Sections" section:

pastedImage_1.png

But this results in runtime errors (because other stuff is now at the wrong place i guess?). But if i put the "itcm_ram_obj" section at another place in the linker script, the files are not placed into ram (checked with the map-file)

Has anyone an idea how to do this correct?

I dont want to touche the code in those files (one is a library file), therefore I dont want to use the __attribute__((section(".ramfunc.$SRAM_ITC"))) to place single functions into ITCM...

Labels (2)
0 Kudos
2 Replies

889 Views
lpcxpresso_supp
NXP Employee
NXP Employee

I suspect that the issue you are running into is that although you are placing the object explicitly, you are not taking into account that with GNU linker scripts the first match wins, rather than any later explicit match. This means that if you have a wildcard that matches earlier in the linker script - that is where your objects will end up.

To prevent this, you need to both place the object as now, but also use the EXCLUDE_FILE keyword to stop the earlier wildcard match. There is some information on this in the MCUXpresso IDE v11.0 User Guide, section 18.15.1, "Relocating code from FLASH to RAM" that should help you see how to do this.

Regards

MCUXpresso IDE Support

0 Kudos

889 Views
david_huwyler
Contributor III

The infos in the MCUXpresso IDE v11.0 User Guide did the trick!

 

I excluded the files from the Flash: 

pastedImage_1.png

and inserted them: 

pastedImage_2.png

and voila, it works!

Thanks 

Dave

0 Kudos