Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi,

I just realised there might be someone here with an answer to my problem.

I am working on making a simple test application on an i.MX8QM chip using one of the A53 cores to test our new hardware when it arrives in January. Our hardware is a derivative of the I.MX8QM MEK board design.

All it needs to do is simply echo on the UART Tx line whatever is received on the UART's Rx line.

I have got it up and running nicely on the MEK board. I use the WindRiver workbench which uses the LLVM toolkit ( version 10.0.1.1 ) to compile and link it.

The application is based on a more complex one one of my colleagues wrote to test other more complicated things such PCIE etc...
I stripped that one from all superfluous code and added some to handle the UART interfacing.

The only problem I have is that however much I strip/reduce the code the final binary file always remains at exactly 327680 bytes ( i.e.: 5 x 64KBytes ).

I guess there are some instructions somewhere to always keep it at that minimum size and, if necessary provide extra padding, but have been unable to locate where those instructions/setup file(s) is(are) located.

The reason I would like to reduce the binary to 256 Kbytes is that I would also like to run the application from the I.MX8QM chip's 256 KByte OCRAM in case we have a problem in getting the SDRAM up and running.

I know it should work in 256Kbyte as I have reduced the stack and heap to half of what it was originally and it still works happily.

Any help/suggestions would be very much appreciated.

What I have tried:

Googled it ad nauseam but could not find any useful answers.
Posted
Updated 14-Feb-23 20:10pm

I'd almost forgotten I posted this question.

The solution was to remove a bit of unnecessary assembly source code in which a rather large data section was defined/allocated. That caused the reservation of a 256Kbyte memory section aligned on a 64Kbyte boundary, the rest was a few Kbyte of code + padding within the first 64KByte block to match the boundary. Hence the fixed 5x64Kbyte size.
 
Share this answer
 
I don't know your particular toolchain and HW. What I consult with other Cortex-M toolchains is the MAP file (the textual report of what the linker did do). That tells you exactly what parts are in the image and what space they occupy.
Cheers
Andi
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900