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

Using ubxlib with dwm3000 drivers (UWB) #108

Closed
darkhmiza opened this issue Jun 1, 2023 · 0 comments
Closed

Using ubxlib with dwm3000 drivers (UWB) #108

darkhmiza opened this issue Jun 1, 2023 · 0 comments

Comments

@darkhmiza
Copy link

Hello,

I am trying to merge two scripts, the first one is a TWR code to calculate distance between a tag and an anchor using the decawave dwm3000 drivers that you can find here https://github.com/foldedtoad/dwm3000, the second one is the main_pos.c example https://github.com/u-blox/ubxlib/tree/master/example/gnss ,The two codes work fine on their own but when I try to add ubxlib to my existing TWR project (for now I am simply copying the ubxlib directory in my project directory and adding the CMakeLists lines), it builds with no error but I get the error below when flashing :

*** Booting Zephyr OS build v3.0.99-ncs1  ***
ASSERTION FAIL [((((prio)) == 0 && z_is_idle_thread_entry((entry))) || (((0 - 1) >= ((-16))) && ((prio)) >= ((-16)) && ((prio)) <= (0 - 1)))] @ WEST_TOPDIR/zephyr/kernel/thread.c:511
        invalid priority (99); allowed range: -1 to -16
[00:00:00.423,431] <err> os: r0/a1:  0x00000004  r1/a2:  0x000001ff  r2/a3:  0x00000002
[00:00:00.423,431] <err> os: r3/a4:  0xfffffff0 r12/ip:  0x0001702c r14/lr:  0x0000fb73
[00:00:00.423,461] <err> os:  xpsr:  0x41000000
[00:00:00.423,461] <err> os: Faulting instruction address (r15/pc): 0x00012c28
[00:00:00.423,492] <err> os: >>> ZEPHYR FATAL ERROR 4: Kernel panic on CPU 0
[00:00:00.423,492] <err> os: Current thread: 0x20001f58 (main)
[00:00:01.461,608] <err> os: Halting system

The only changes I make are the addition of these two lines in the 'CMakeLists.txt' :

set(ENV{UBXLIB_DIR} ${CMAKE_CURRENT_LIST_DIR}/ubxlib)
include($ENV{UBXLIB_DIR}/zephyr/ubxlib.cmake)

Here is the 'CMakeLists.txt' without ubxlib :

cmake_minimum_required(VERSION 3.13.1)
#set(ENV{UBXLIB_DIR} ${CMAKE_CURRENT_LIST_DIR}/ubxlib)
#include($ENV{UBXLIB_DIR}/zephyr/ubxlib.cmake)
set(DTS_ROOT   "${CMAKE_CURRENT_SOURCE_DIR}/../..")
set(BOARD_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/../..")
set(SHIELD qorvo_dwm3000)

set(BOARD nrf52840dk_nrf52840)
#set(BOARD nrf52dk_nrf52832)
#set(BOARD nrf5340dk_nrf5340_cpuapp)
#set(BOARD nrf5340dk_nrf5340_cpunet)
#set(BOARD nucleo_f429zi)
#set(BOARD nucleo_l476rg)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(Example_01A)

add_definitions(-DSIMPLE_TX)

target_sources(app PRIVATE ../../main.c)
target_sources(app PRIVATE ../../config_options.c)
target_sources(app PRIVATE simple_tx.c)

target_sources(app PRIVATE ../../decadriver/deca_device.c)

target_sources(app PRIVATE ../../platform/port.c)
target_sources(app PRIVATE ../../platform/deca_sleep.c)
target_sources(app PRIVATE ../../platform/deca_spi.c)
target_sources(app PRIVATE ../../platform/port.c)

target_sources(app PRIVATE ../../shared_data/shared_functions.c)

target_include_directories(app PRIVATE ../../)
target_include_directories(app PRIVATE ../../decadriver/)
target_include_directories(app PRIVATE ../../platform/)
target_include_directories(app PRIVATE ../../compiler/)
target_include_directories(app PRIVATE ../../shared_data/)

# zephyr_compile_options(-save-temps)

I am running my code in the main thread no multithreading is used.

I am using ncs 2.0.0 on an nrf52840dk Does anyone know the cause of this error.

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

1 participant