AnsweredAssumed Answered

Align section linker

Question asked by biafra on Jan 15, 2018
Latest reply on Jan 16, 2018 by biafra

Hi everyone,

 

I'm writing a bootloader using MCUXpresso v10.1.1_606 and MK66FN2M0VMD18 device.

I found a problem in the flash programming phase.

Based on the device reference manual, the flash must be programmed on a 64 bit aligned phrases (flash start addresses [2:0] = 000, 8 byte length).
The problem rises from the output file of the application, here is an extract (S19):

 

S21402C4D030313233343536373839616263646566F3
S20802C4E000FFFFFF54
S21402C4E400B00640000000008025000000000100A5

 

The first two record are programmed fine, but the third generates an access error because it isn't 64 bit aligned, due to the 4 bytes length of the previous record. Although the two records are contiguous, the linker keeps them separate because there is the division of two different sections, text and data.


I think that the solution could be keeping the application sections aligned on 8 bytes boudary: I searched how to tell the linker to do this, but I didn't find any procedure to configure it.

 

Have anyone some suggestions?

 

Many thanks
Biafra

Outcomes