Just tried it here and I'm getting the same error. Must have something to do with the version of the toolchain. We may need to regress. Let me figure out how to get an older version with brew
Trying GPS sample on feather - MAC
- Edited
no did not do any modifications except adding MCUBoot support.
anyways here is the prj.conf
#
# Copyright (c) 2019 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
#
CONFIG_BSD_LIBRARY=y
CONFIG_STDOUT_CONSOLE=y
CONFIG_UART_INTERRUPT_DRIVEN=y
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
CONFIG_AT_CMD=y
CONFIG_AT_NOTIF=y
# Enable SUPL client support
CONFIG_SUPL_CLIENT_LIB=n
# Networking
CONFIG_NETWORKING=y
CONFIG_NET_SOCKETS_OFFLOAD=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_POSIX_NAMES=y
CONFIG_NET_SOCKETS_SOCKOPT_TLS=y
# Disable native network stack to save some memory
CONFIG_NET_NATIVE=n
# Main thread
CONFIG_HEAP_MEM_POOL_SIZE=2048
CONFIG_MAIN_STACK_SIZE=4096
# Enable Zephyr application to be booted by MCUboot
CONFIG_BOOTLOADER_MCUBOOT=y
# COEX0 is used to enable the GPS LNA, but it has to be configured to do so.
CONFIG_NRF9160_GPS_SET_COEX0=y
CONFIG_AT_CMD_PARSER=y
CONFIG_NRF9160_GPS_HANDLE_MODEM_CONFIGURATION=y
CONFIG_NRF9160_GPS=y
CONFIG_NRF9160_GPS_COEX0_STRING="AT%XCOEX0=1,1,1565,1586"
and this is the CMakeLists.txt
#
# Copyright (c) 2019 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic
#
cmake_minimum_required(VERSION 3.8.2)
#find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
find_package(Zephyr HINTS $ENV{ZEPHYR_BASE})
project(gps_socket_sample)
zephyr_library_sources(src/main.c)
zephyr_library_sources_ifdef(
CONFIG_SUPL_CLIENT_LIB
src/supl_support.c
)
Yes that link I saw ... but how can I pass these options to the linker ?
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).
- Edited
Here are the steps to fix this:
First uninstall
gcc-arm-embedded
frombrew
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 preferzsh
)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!
- Edited
Also remove any reference to CROSS_COMPILE
in you .zshrc
or .bash_profile
or remove it in fish
using set -e CROSS_COMPILE
- Edited
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
- Edited
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
- Edited
lbh00 Can you provide the output of git log -n 1
and git status
? (in the gps
example directory is fine)
- Edited
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....
- Edited
did this git checkout HEAD CMakeLists.txt
but I still have the same linking issue!
- Best Answerset by jaredwolff
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!