Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to build in step 2: cannot move location counter backwards (from 20090e84 to 20040000) #23

Open
yudataguy opened this issue Nov 18, 2024 · 9 comments

Comments

@yudataguy
Copy link

Running on Adafruit Feather RP2040 Adalogger

In step 2, when I try to build, the following error comes up after reaching 100%

[100%] Linking CXX executable ../bin/featherrp2040/LedBlinker.elf
<command-line>: note: this is the location of the previous definition
/home/xyz/.arduino15/packages/rp2040/tools/pqt-gcc/4.0.1-8ec9d6f/bin/../lib/gcc/arm-none-eabi/14.2.0/../../../../arm-none-eabi/bin/ld:/home/xyz/Downloads/code/fprime/led-blinker/build-fprime-automatic-featherrp2040/arduino-cli-sketch/memmap_default.ld:235 cannot move location counter backwards (from 20090e84 to 20040000)
collect2: error: ld returned 1 exit status
gmake[2]: *** [LedBlinker/CMakeFiles/LedBlinker.dir/build.make:340: bin/featherrp2040/LedBlinker.elf] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:7420: LedBlinker/CMakeFiles/LedBlinker.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2
[ERROR] CMake erred with return code 2

settings.ini

[fprime]
project_root: .
framework_path: ./fprime
library_locations: ./fprime-arduino:./fprime-baremetal
config_directory: ./config
deployment_cookiecutter: https://github.com/fprime-community/fprime-arduino-deployment-cookiecutter.git

default_toolchain: featherrp2040

default_cmake_options:  FPRIME_ENABLE_FRAMEWORK_UTS=OFF
                        FPRIME_ENABLE_AUTOCODER_UTS=OFF

current connected board:

/dev/ttyACM0 serial   Serial Port (USB) Adafruit Feather RP2040 Adalogger rp2040:rp2040:adafruit_feather_adalogger rp2040:rp2040

It seems to be some kind of memory issue, since nothing has been added yet, not really sure what can possibly be wrong.

Update:
Tried w/ Pico board, got same result. default_toolchain: rpipico

@ethancheez
Copy link
Collaborator

Hello,

Was anything in the config/ directory changed? Did you copy the config/ directory from fprime/config/ or another source?

@yudataguy
Copy link
Author

copied config directly from fprime/config as suggested, i'll try not copy later today

@ethancheez
Copy link
Collaborator

copied config directly from fprime/config as suggested, i'll try not copy later today

Use the config/ from the deployment cookiecutter since the default fprime/config/ is too large for majority (if not all) of the Arduino boards after the recent updates.

I will update the tutorial docs to reflect this.

@yudataguy
Copy link
Author

yudataguy commented Nov 18, 2024

updated settings.ini

[fprime]
project_root: .
framework_path: ./fprime
library_locations: ./fprime-arduino:./fprime-baremetal
config_directory: ./LedBlinker/config
deployment_cookiecutter: https://github.com/fprime-community/fprime-arduino-deployment-cookiecutter.git

default_toolchain: featherrp2040

default_cmake_options:  FPRIME_ENABLE_FRAMEWORK_UTS=OFF
                        FPRIME_ENABLE_AUTOCODER_UTS=OFF

1st encountered this error:

fprime/led-blinker/build-fprime-automatic-featherrp2040/F-Prime/Svc/PolyIf/PolyPortAc.hpp:21:10: fatal error: LedBlinker/config/PolyDbEntryEnumAc.hpp: No such file or directory
   21 | #include "LedBlinker/config/PolyDbEntryEnumAc.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

After I copied VersionEnumEnumAc.app and VersionEnumEnumAc.hpp to LedBlinker/config folder, this error was gone, but errored without any obvious error

[ 40%] Linking CXX static library ../../../lib/featherrp2040/libSvc_FileDownlinkPorts.a
[ 41%] Linking CXX static library ../../../lib/featherrp2040/libSvc_DpPorts.a
[ 41%] Built target Svc_FileDownlinkPorts
[ 41%] Linking CXX static library ../../../../lib/featherrp2040/libSvc_Ports_VersionPorts.a
[ 41%] Linking CXX static library ../../../lib/featherrp2040/libSvc_PassiveConsoleTextLogger.a
[ 41%] Built target Svc_DpPorts
[ 41%] Built target Svc_Ports_VersionPorts
[ 41%] Built target Svc_PassiveConsoleTextLogger
[ 41%] Linking CXX static library ../../../lib/featherrp2040/libSvc_CmdSplitter.a
[ 41%] Built target Svc_CmdSplitter
[ 41%] Linking CXX static library ../../../lib/featherrp2040/libSvc_AssertFatalAdapter.a
[ 41%] Built target Svc_AssertFatalAdapter
gmake: *** [Makefile:136: all] Error 2
[ERROR] CMake erred with return code 2

line 136 from Makefile

$(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 all

@ethancheez
Copy link
Collaborator

Try copy the LedBlinker/config/ directory into the project root instead, and change the settings.ini to be

config_directory: ./config

@yudataguy
Copy link
Author

Thank you. It finally worked. Why would have the same files, but different directory causing different behaviors?

@ethancheez
Copy link
Collaborator

build cache seems to always place the config/ path under build-fprime-automatic-x instead of build-fprime-automatic-x/LedBlinker, hence why the include path couldn't be found.

I'm not sure the reasoning behind this.. probably some underlying linking stuff FPrime is doing within their cmake files.

@LeStarch is this a bug? Or were custom config/ files not intended to go in other file paths other than the project root?

@LeStarch
Copy link
Contributor

Configs must be synonymous with a project. This is because it is invalid to have different configs between different items in the same build. A build and a project are one to one.

@LeStarch
Copy link
Contributor

That being said, configs should be allowed to be placed anywhere in a project. That bit might be a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants