platformio / platform-nxplpc

NXP LPC: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/nxplpc
Apache License 2.0
9 stars 12 forks source link

platformio run failes due to "cannot move location counter backwards" with lpc1114fn28 #16

Closed iwaita2ya closed 5 years ago

iwaita2ya commented 5 years ago

This issue occurs after I updated platformio-core up-to date. It seems any nxplpc boards that has few RAM (4KB) occurs this issue. (In fact, any program I wrote for lpc1114fn28 generates same error message below)

iwait@galc2:~/Projects/platformio/platform-nxplpc/examples/mbed-blink$ platformio init --board lpc1114fn28

iwait@galc2:~/Projects/platformio/platform-nxplpc/examples/mbed-blink$ platformio run
Processing lpc1114fn28 (platform: nxplpc; board: lpc1114fn28; framework: mbed)
----------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/nxplpc/lpc1114fn28.html
PLATFORM: NXP LPC > Switch Science mbed LPC1114FN28
HARDWARE: LPC1114FN28 48MHz 4KB RAM (32KB Flash)
DEBUG: CURRENT(cmsis-dap) ON-BOARD(cmsis-dap) EXTERNAL(blackmagic, jlink)
Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 4 compatible libraries

(...)

Generating LD script .pioenvs/lpc1114fn28/LPC1114.ld.link_script.ld
Linking .pioenvs/lpc1114fn28/firmware.elf
.pioenvs/lpc1114fn28/LPC1114.ld.link_script.ld:77 cannot move location counter backwards (from 0000000010000390 to 0000000010000000)
collect2: error: ld returned 1 exit status
*** [.pioenvs/lpc1114fn28/firmware.elf] Error 1
====================================================== [ERROR] Took 9.86 seconds ======================================================

Below is my current platform versions

$ platformio update
Updating tool-scons                      @ 2.20501.7      [Up-to-date]
Updating tool-unity                      @ 1.20403.0      [Up-to-date]
Updating contrib-pysite                  @ 2.27.190418    [Up-to-date]
Updating contrib-piohome                 @ 2.1.0          [Up-to-date]
Updating tool-pioplus                    @ 2.5.0          [Up-to-date]

Platform Manager
================
Platform NXP LPC
--------
Updating nxplpc                          @ 4.3.0          [Up-to-date]
Updating framework-mbed                  @ 5.51203.190509 [Up-to-date]
Updating toolchain-gccarmnoneeabi        @ 1.70201.0      [Up-to-date]

Platform NXP LPC
--------
Updating nxplpc                          @ 3cff855        [Up-to-date]
Updating framework-mbed                  @ 5.51204.190524 [Up-to-date]
Updating toolchain-gccarmnoneeabi        @ 1.70201.0      [Up-to-date]

If possible, please guide me how to downgrade these frameworks above to avoid this issue. I'm happy to test & confirm any idea/solution if someone provides me. :-)

valeros commented 5 years ago

Hi @iwaita2ya! Indeed, it looks like you are out of RAM. Are you able to compile your project using mbed-cli tool? You can try to use an older version of the platform (3.5.0 with mbed 5.10.1):

[lpc1114fn28]
platform = nxplpc@3.5.0
framework = mbed
board = lpc1114fn28
iwaita2ya commented 5 years ago

Hi @valeros ,

I confirmed now the project can be compiled successfully with platformio.ini setting you provided. Thank you for providing useful info. I will keep in mind when I work with these boards.

JFYI, current mbed-cli OS2 library has issue (mbed.h and some files are missing) and I needed to specify older mbed-cli revision for compiling this example project with mbed-cli.

This mbed-cli OS2 library issue has been raised at: https://github.com/ARMmbed/mbed-cli/issues/805#issuecomment-465017205

iwait@galc2:~/Projects/mbed/mbed-blink-cli$ mbed compile -m lpc1114 -t gcc_arm
[Error] @,: Compiler version mismatch: Have 8.2.1; expected version >= 6.0.0 and < 7.0.0
Building project mbed-blink-cli (LPC1114, GCC_ARM)
Scan: mbed-blink-cli
Compile [100.0%]: main.cpp
[Fatal Error] main.cpp@1,10: mbed.h: No such file or directory
[ERROR] ./src/main.cpp:1:10: fatal error: mbed.h: No such file or directory
 #include "mbed.h"
          ^~~~~~~~
compilation terminated.

[mbed] ERROR: "/home/iwait/.pyenv/versions/2.7.14/bin/python2.7" returned error code 1.
[mbed] ERROR: Command "/home/iwait/.pyenv/versions/2.7.14/bin/python2.7 -u /home/iwait/Projects/mbed/mbed-blink-cli/.temp/tools/make.py -t gcc_arm -m lpc1114 --source . --build ./BUILD/lpc1114/gcc_arm" in "/home/iwait/Projects/mbed/mbed-blink-cli"

Probably it's not related to my issue here, but would like to share with you. :-)

Again, Thank you for your kind support and have a nice day!