From 9ccb9345bef83b66e445cf99631e26dc407e217f Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Tue, 3 Jul 2018 12:06:30 -0700 Subject: [PATCH] nxphlite-v3:bin file must be padded to multiple of 8 Flash programing on the K66 has to be units of 8 bytes. So we cache the write of words until there are 2 written. Then the 2 words are written to FLASH. This change ensure the bin file has an even number of (4 byte) words by padding the last section in progflash with 0xffffffff if needed. --- .../nuttx/nuttx-configs/nxphlite-v3/scripts/ld.script | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/platforms/nuttx/nuttx-configs/nxphlite-v3/scripts/ld.script b/platforms/nuttx/nuttx-configs/nxphlite-v3/scripts/ld.script index 255f4c9ff4..3e8b83400c 100644 --- a/platforms/nuttx/nuttx-configs/nxphlite-v3/scripts/ld.script +++ b/platforms/nuttx/nuttx-configs/nxphlite-v3/scripts/ld.script @@ -87,7 +87,9 @@ SECTIONS * use the NuttX get_errno_ptr() function. */ __errno = get_errno_ptr; - } > progflash + . = ALIGN(8); + _eotext = .; + } > progflash =0xff /* * Init functions (static constructors and the like) @@ -132,7 +134,9 @@ SECTIONS _sramfuncs = ABSOLUTE(.); *(.ramfunc .ramfunc.*) _eramfuncs = ABSOLUTE(.); - } > datasram AT > progflash + . = ALIGN(8); + _eotext = .; + } > datasram AT > progflash =0xff _framfuncs = LOADADDR(.ramfunc);