lbh00 Yes that link I saw ... but how can I pass these options to the linker ?
You shouldn't have to. It compiled fine before I ... optimized the OSX install.
lbh00 Yes that link I saw ... but how can I pass these options to the linker ?
You shouldn't have to. It compiled fine before I ... optimized the OSX install.
ok so now you also have the same issue ?
I recall having a similar issue in an older sdk... and the only way it was solved for me was with a new sdk(1.3).
Here are the steps to fix this:
First uninstall gcc-arm-embedded
from brew
brew uninstall gcc-arm-embedded
Install the toolchain by pulling it from ARM. Run these commands:
cd ~
wget "https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/gcc-arm-none-eabi-9-2019-q4-major-mac.tar.bz2"
tar xvfj gcc-arm-none-eabi-9-2019-q4-major-mac.tar.bz2
rm gcc-arm-none-eabi-9-2019-q4-major-mac.tar.bz2
Note for Catalina users you will get an error when running these utilities for the first time. You must allow them to be executed in your Security preferences.
Finally you'll need export a few important environment variables for things to work. For bash
here's the entry for .bash_profile
that I have:
# Zephyr related
export ZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb
export GNUARMEMB_TOOLCHAIN_PATH="~/gcc-arm-none-eabi-9-2019-q4-major"
Note: this should also work for
.zshrc
for those folks who are using newer versions of Mac OS (or just plain prefer zsh
)
For folks using fish
you're going to use:
set -Ux ZEPHYR_TOOLCHAIN_VARIANT gnuarmemb
set -Ux GNUARMEMB_TOOLCHAIN_PATH "~/gcc-arm-none-eabi-9-2019-q4-major"
Close and reopen all terminals and Visual Studio Code.
Try compiling again!
Also remove any reference to CROSS_COMPILE
in you .zshrc
or .bash_profile
or remove it in fish
using set -e CROSS_COMPILE
Hello,
Ok this solved the initial issue.
However now I have something like this error for some .h files
#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (/Users/louis/ncs/nrf/samples/nrf9160/gps/src/main.c).C/C++(1696)
cannot open source file "inttypes.h" (dependency of "zephyr.h")C/C++(1696)
cannot open source file "sys/types.h" (dependency of "nrf_socket.h")C/C++(1696)
cannot open source file "sys/types.h" (dependency of "net/socket.h")C/C++(1696)
cannot open source file "stdio.h"C/C++(1696)
VSC proposes to add them to the IncludePath... shall I do it ? or is it something I can solve in the config files ?
Regards
louis.h
and yes I guess these issues with the header files are causing this error at linking stage
/Users/louis/gcc-arm-none-eabi-9-2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: modules/nrf/drivers/gps/nrf9160_gps/lib..__nrf__drivers__gps__nrf9160_gps.a(nrf9160_gps.c.obj): in function `enable_gps':
/Users/louis/ncs/nrf/drivers/gps/nrf9160_gps/nrf9160_gps.c:361: undefined reference to `lte_lc_system_mode_get'
/Users/louis/gcc-arm-none-eabi-9-2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: /Users/louis/ncs/nrf/drivers/gps/nrf9160_gps/nrf9160_gps.c:389: undefined reference to `lte_lc_func_mode_get'
/Users/louis/gcc-arm-none-eabi-9-2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: /Users/louis/ncs/nrf/drivers/gps/nrf9160_gps/nrf9160_gps.c:380: undefined reference to `lte_lc_system_mode_set'
collect2: error: ld returned 1 exit status
%
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /usr/local/bin/cmake --build /Users/louis/ncs/nrf/samples/nrf9160/gps/build
This is the command I always do
especially when I have a compilation issue to remove the caches effects
rm -rf build && rm -rf ~/Library/Caches/zephyr && west build -b circuitdojo_feather_nrf9160ns -p
so rm -rf build does not solve it
lbh00 Can you provide the output of git log -n 1
and git status
? (in the gps
example directory is fine)
yes:
git log -n 1
commit c2d3f852399c96009677077c166e722ae0a54e5a (HEAD, tag: v1.3.2, origin/v1.3-branch)
Author: Carles Cufi <carles.cufi@nordicsemi.no>
Date: Fri Oct 9 11:32:06 2020 +0200
manifest: Set sdk-zephyr to v2.3.0-rc1-ncs3
For the NCS 1.3.2 release, point sdk-zephyr to the corresponding tag.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
louis@Louiss-MBP gps % git status
HEAD detached at v1.3.2
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: ../at_client/prj.conf
modified: CMakeLists.txt
modified: prj.conf
Untracked files:
(use "git add <file>..." to include in what will be committed)
../../../.DS_Store
../../.DS_Store
../.DS_Store
no changes added to commit (use "git add" and/or "git commit -a")
lbh00 Looks like CMakeLists.txt is modified. Can you reset it?
you mean git ?
what was the exact command ? sorry....
did this git checkout HEAD CMakeLists.txt
but I still have the same linking issue!
Hello,
I have just set this config to n
CONFIG_NRF9160_GPS_HANDLE_MODEM_CONFIGURATION=n
and the linking was successful.
I guess this tells it to use the GPS driver ?
so problem solved and case closed.
GPS testing started!