Initialization and usage of device drivers in user code
akrckn <alexander@...>
Hello everyone,
I'm pretty new to the Zephyr Project as we (our company) are evaluating it to use it as our base for the upcoming projects. It didn't take long to get our own application running on our hardware, but as we are developing battery powered modules we just activate and use devices when they really are needed. Is there a way to define devices (e.g. BME280 below) in the device tree file and trigger the initialization and start / stop in the application code and how can we do that? I'm assuming there is a solution and I didn't get or find it, yet - could you please help me?
Thank you in advance and best regards!
|
|
@Hidastelija
Hi,
I've tried to run the sht3xd sample using nRF52840DK, which is one of the boards with sample configuration overlay file, but all I get out in the logs is this: *** Booting Zephyr OS build v2.6.0-rc1-ncs1 ***
Could not get SHT3XD device What I get from this log is that for some reason the system fails to load the device driver for the sensor. I'm relatively new to Zephyr and I have trouble understanding how to debug the problem. Can anyone give me pointers where to look? I've built the sample using NordicConnectSDK 1.6.1 which uses Zephyr 2.6.0-rc1-ncs1 ...NordicConnectSDK/1.6.1/zephyr/samples/sensor/sht3xd$ west build -b nrf52840dk_nrf52840 Thanks.
|
|
Re: nRF9160 custom board dynamic GPIO
#nrf9160
Bolivar, Marti
"DKaplan via lists.zephyrproject.org"
<DKaplan=amiglobal.com@...> writes: Shalom!Hello! Since you're using NCS, if you haven't figured this out yet, I'd recommend asking on DevZone. This mailing list is for where you can get community support for "vanilla" zephyr; DevZone is where you can get official support for NCS from Nordic. Good luck! Marti
|
|
Defining preprocessor directives through
#west
Diogo Correia
Hi everyone,
I'm trying to automate the building of a set of LoRaWAN boards by using preprocessor directives to set their keys. Is it possible to define the directives using west? I was only able to change compiling options (-D). Kind regards, Diogo Correia
|
|
SDK 0.13.0 Release
Kumar Gala
Hi,
Latest version of the SDK can be found here: https://github.com/zephyrproject-rtos/sdk-ng/releases/tag/v0.13.0 Please download and try things out and report any issues. • general: • Added support for ARC64. NOTE: GDB isn't currently supported for ARC64. • CI/go.sh changes to make building MacOS and CI building easier. • Various fixes for building/packaging on MacOS • Added GitHub CI workflow to build MacOS x86_64 packages • qemu: • Updated to QEMU 6.0.0 • Added arc64 support. NOTE: this update ARC support replaces the machine (-M simhs) with (-M virt). This change will require updates to boards/arc/qemu_arc/board.cmake in Zephyr to match. • Pull in fix from upstream for TFM: target/arm: Use correct SP in M-profile exception • Pull in fixes from upstream for: hw/arm: Fix modelling of SSE-300 TCMs and SRAM • gcc: • Update to gcc 10.3 release • Added support for ARC64 • Removed libgcc transactional memory clone registry support • Fixed incorrect build specs for libstdc++ nano variant. The libstdc++ nano variant, which is used with newlib-nano, is now built with -fno-exceptions to reduce compiled binary size. • binutils: • Updated to add support for ARC64 • newlib: • Updated to add support for ARC64 • Added multithreading support • Fix nano.spec file to pull in nano libraries. • Set -mthumb-interwork for nano newlib builds to workaround at crosstool issue. • crosstool-ng: • sync with upstream. Upstream now supports newlib-nano so we drop our Zephyr specific updates. This also pulls in gcc-10.3 and initial support for ARC64. • Fix stripping of newlib-nano libs • yocto: • Update to yocto 3.2.3 baseline. This is in prep to support building qemu-6.0.0 • openocd: • Update to upstream 20210630 snapshot Thanks to all that contributed fixes and enhancements to this version of the SDK.
|
|
Networking Forum Agenda
Lubos, Robert
Hi all,
There is a networking forum tomorrow Tue 3 August at 8AM PST / 17.00 CEST.
The current agenda is empty, please let me know if there are any topics you’d like to discuss. Otherwise, I’ll cancel the meeting.
Meeting notes: https://docs.google.com/document/d/1qFsOpvbyLzhflJbbv4Vl__497pKHDoUCy9hjAveyCX0
Shared Folder: https://drive.google.com/drive/folders/1j6d0FLeOjiMil1Ellb59AsfHdzuWdAAc?usp=sharing
Regards,
|
|
k_uptime_get values in QEMU
martin.schoenstedt@...
Hello,
I am experiencing a problem and don't know how to solve it. Running k_uptime_get() returns the same value as k_uptime_ticks() and is a lot higher than the actual uptime in milliseconds. I did not change any configurations and am using Zephyr version 2.6.0. Did anyone encounter a similar problem or is this a problem related to QEMU? (I don't have a physical board to check the same samples there). Thankful for any help! kind regards Martin Schönstedt
|
|
Re: Esp32 flashing issue on Ubuntu 20.10
Hi,
It could be as simple as you can not have a console connection and trying to flash as the USB is not good at handling two simultaneous connects. Happens to me all the time.
|
|
Re: Esp32 flashing issue on Ubuntu 20.10
Frank Duignan
You need to be a member of the dialout group. For example sudo adduser pritam dialout Then logout and back in again
On Wed 28 Jul 2021, 15:28 pritam sutar, <pritamsutar660@...> wrote:
|
|
Esp32 flashing issue on Ubuntu 20.10
pritam sutar <pritamsutar660@...>
I am able to build code for esp32 but flash is being failed by denying permission on ttyUSB0. Any help would be appreciated.
|
|
nRF9160 custom board dynamic GPIO
#nrf9160
David Kaplan
Shalom!
We have a nRF9160 custom board on which I cannot switch some of the IO lines. For example we have two leds, P0.9 an P0.10 but only P0.9 works. The hardware guy reports the P0.10 output (scope) does not change when I toggle the output while debugging. I tried moving the led to P0.30 & P0.31 also without success. Also I need to change a uart1's rx and tx lines in some scenarios when it is not used to save energy. In this case I do not call uart_dev = device_get_binding("UART_1"), but want to just clear both lines. I am evidently doing something wrong or missing something. The gpio APIs all report no errors and in the debugger I see that the pin numbers are correct.
|
|
Re: Compiler and linker warnings with GCC 11
Kumar Gala
Some of these issues might be resolved by:
toggle quoted messageShow quoted text
https://github.com/zephyrproject-rtos/zephyr/pull/35893 - k
On Jul 21, 2021, at 4:06 AM, Sven Vainküla <svenvainkyla@...> wrote:
|
|
Re: TF-M samples build
Bolivar, Marti
Marti Bolivar <marti.bolivar@...> writes:
Hi,D'oh, I forgot to reply-all.
|
|
Re: Cmake Error While Building Blinky Sample
Carles Cufi
Have you set GNUARMEMB_TOOLCHAIN_PATH ?
Also, have you tried cleaning your build/ folder?
Carles
From: users@... <users@...>
On Behalf Of Daniel Wing via lists.zephyrproject.org
Sent: 21 July 2021 19:08 To: users@... Subject: [Zephyr-users] Cmake Error While Building Blinky Sample
Hello,
I am trying to west build the blinky sample from the getting started guide (https://docs.zephyrproject.org/latest/getting_started/index.html). However, the below error comes up:
C:\zephyrproject\zephyr>west build -p auto -b nrf52840dk_nrf52840 samples\basic\blinky
I have tried restarting my pc, and checked the GNU ARM Embedded toolchain installation and that the environment variables were set correctly. I have also checked that the cmake folder exists in the zephyrproject and I tried reinstalling the cmake packages. Still the same error keeps occurring.
Any help with diagnosing and fixing this issue would be greatly appreciated.
Best, Daniel Wing
|
|
TF-M samples build
Philippe Gerard <philippegera@...>
HI All. nice to meet you, this is my first day evaluating Zephyr. it looks pretty exciting, i have struggled to build the TFM samples. is there a clear procedure to build them on windows for a nRF5340DK target? does it exist any other basic sample using TFM (such as an hello word)? thanks a lot Philippe
|
|
Cmake Error While Building Blinky Sample
danwin354@...
Hello, I am trying to west build the blinky sample from the getting started guide (https://docs.zephyrproject.org/latest/getting_started/index.html). However, the below error comes up: C:\zephyrproject\zephyr>west build -p auto -b nrf52840dk_nrf52840 samples\basic\blinky -- west build: generating a build system Including boilerplate (Zephyr base (cached)): C:/zephyrproject/zephyr/cmake/app/boilerplate.cmake -- Application: C:/zephyrproject/zephyr/samples/basic/blinky -- Zephyr version: 2.6.99 (C:/zephyrproject/zephyr), build: zephyr-v2.6.0-806-gf818d8770b04 -- Found west (found suitable version "0.11.0", minimum required is "0.7.1") -- Board: nrf52840dk_nrf52840 -- Cache files will be written to: C:/zephyrproject/zephyr/.cache -- Found toolchain: gnuarmemb (C:/gnu_arm_embedded) CMake Error at C:/zephyrproject/zephyr/cmake/compiler/gcc/generic.cmake:8 (message): Zephyr was unable to find the toolchain. Is the environment misconfigured? User-configuration: ZEPHYR_TOOLCHAIN_VARIANT: gnuarmemb Internal variables: CROSS_COMPILE: C:/gnu_arm_embedded/bin/arm-none-eabi- TOOLCHAIN_HOME: C:/gnu_arm_embedded Call Stack (most recent call first): C:/zephyrproject/zephyr/cmake/generic_toolchain.cmake:42 (include) C:/zephyrproject/zephyr/cmake/app/boilerplate.cmake:570 (include) C:/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include) C:/zephyrproject/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:40 (include_boilerplate) CMakeLists.txt:4 (find_package) -- Configuring incomplete, errors occurred! FATAL ERROR: command exited with status 1: 'C:\Program Files\CMake\bin\cmake.EXE' '-DWEST_PYTHON=c:\python39\python.exe' '-BC:\zephyrproject\zephyr\build' '-SC:\zephyrproject\zephyr\samples\basic\blinky' -GNinja I have tried restarting my pc, and checked the GNU ARM Embedded toolchain installation and that the environment variables were set correctly. I have also checked that the cmake folder exists in the zephyrproject and I tried reinstalling the cmake packages. Still the same error keeps occurring. Any help with diagnosing and fixing this issue would be greatly appreciated. Best, Daniel Wing
|
|
Compiler and linker warnings with GCC 11
Sven Vainküla <svenvainkyla@...>
Hello!
After updating my GCC to version 11.1.0 I started getting a bunch of linker errors when compiling projects. Previously I was using GCC 10.2.0. For example, when building the sample hello_world project using: west build -b stm32f4_discoMany warnings are emitted that are related to Z_KERNEL_STACK_ARRAY_x macros, for example: [...]zephyr/arch/arch/arm/core/aarch32/CMakeFiles/arch__arm__core__aarch32.dir/thread.c.obj In file included from ../../../include/kernel_includes.h:39,/home/sv/extern-projects/zephyr/zephyr/arch/arm/core/aarch32/thread.c:15: ../../../include/kernel/thread_stack.h:157:16: warning: ignoringattribute 'section (".noinit.\"../../../kernel/include/kernel_internal.h\".1")' because it conflicts with previous 'section (".noinit.\"../../../arch/arm/include/aarch32/cortex_m/stack.h\".0")' [-Wattributes] 157 | struct z_thread_stack_element lsect \macro 'Z_KERNEL_STACK_ARRAY_DEFINE_IN' 221 | Z_KERNEL_STACK_ARRAY_DEFINE_IN(sym, nmemb, size,__kstackmem) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~of macro 'K_KERNEL_STACK_ARRAY_DEFINE' 155 | extern K_KERNEL_STACK_ARRAY_DEFINE(z_interrupt_stacks,CONFIG_MP_NUM_CPUS, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~previous declaration here 29 | extern K_KERNEL_STACK_ARRAY_DEFINE(z_interrupt_stacks,CONFIG_MP_NUM_CPUS, | ^~~~~~~~~~~~~~~~~~macro 'Z_KERNEL_STACK_ARRAY_DEFINE_IN' 159 | sym[nmemb][Z_KERNEL_STACK_LEN(size)]expansion of macro 'K_KERNEL_STACK_ARRAY_DEFINE' 29 | extern K_KERNEL_STACK_ARRAY_DEFINE(z_interrupt_stacks,CONFIG_MP_NUM_CPUS, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~A couple of linker warnings are also emitted during linking: [132/139] Linking C executable zephyr/zephyr_prebuilt.elf/usr/lib/gcc/arm-none-eabi/11.1.0/../../../../arm-none-eabi/bin/ld.bfd: warning: orphan section `.debug_line_str' from `/usr/lib/gcc/arm-none-eabi/11.1.0/thumb/v7e-m/nofp/libgcc.a(_aeabi_uldivmod.o)' being placed in section `.debug_line_str' /usr/lib/gcc/arm-none-eabi/11.1.0/../../../../arm-none-eabi/bin/ld.bfd: warning: orphan section `.debug_loclists' from `/usr/lib/gcc/arm-none-eabi/11.1.0/thumb/v7e-m/nofp/libgcc.a(_udivmoddi4.o)' being placed in section `.debug_loclists' /usr/lib/gcc/arm-none-eabi/11.1.0/../../../../arm-none-eabi/bin/ld.bfd: warning: orphan section `.debug_rnglists' from `/usr/lib/gcc/arm-none-eabi/11.1.0/thumb/v7e-m/nofp/libgcc.a(_udivmoddi4.o)' being placed in section `.debug_rnglists' /usr/lib/gcc/arm-none-eabi/11.1.0/../../../../arm-none-eabi/bin/ld.bfd: warning: orphan section `.debug_line_str' from `/usr/lib/gcc/arm-none-eabi/11.1.0/thumb/v7e-m/nofp/libgcc.a(_dvmd_tls.o)' being placed in section `.debug_line_str' The same warnings occur when building for the nRF development kit. Noticed the issue first while using the Nordic nRF SDK, but it also happens with non-nRF Zephyr. Tested with latest Zephyr at the time of this e-mail (HEAD at 0ef77d4ea41fb765061c64896b3fbd0b2e4bc276). The configuration flag CONFIG_LINKER_ORPHAN_SECTION_PLACE does get rid of the linker warnings, but the compiler warnings related to Z_KERNEL_STACK_ARRAY_* remain. I don't think that this is related to an invalid configuration of the build environment, as compilation used to complete without these linker warnings. This causes a lot of noise in the build logs that can mask other warnings. Does anyone have any ideas on how to fix these build errors? Is this a known bug or have I misconfigured something that just didn't manifest with an older GCC? Best regards Sven Vainküla
|
|
I've had a quick look and am confused as there is reference to a file:
#include "lis2mdl_reg.h"
It appears that when this driver was created they may have forgotten to include both lis2mdl_reg.c and lis2mdl_reg.h, eg like these: https://os.mbed.com/teams/ST/code/LIS2MDL//file/8562ae1a0534/lis2mdl_reg.c/https://github.com/tencentyun/qcloud-iot-c-sdk-porting-examples/blob/master/Tencent_icube_based_Nucleol476_FreeRTOS/Drivers/BSP/Components/lis2mdl/lis2mdl_reg.c Billy..
|
|
Armando VISCONTI <armando.visconti@...>
Hi Marti,
On 7/14/21 9:15 PM, Bolivar, Marti wrote: Hi,I confirm that, in case CONFIG_PM_DEVICE is enabled, the driver does not build correctly. I just created a pull request with the fix (#36975) as suggested by Frank. Having said that, I doubt this PR will fix the original issue of the reporter ("The values it produces do not change when you re-orient the device"), as the lis2mdl pm_control init routine was never called (in the PR I fixed also this). I suggest to open a specific bug for it and I'll look into it. Thanks for reporting this build bug! Armando
|
|
Bolivar, Marti
Hi,
+Armando "frank.duignan via lists.zephyrproject.org" <frank.duignan=gmail.com@...> writes: I have been experimenting with the microbit v2 and zephyr. Everything seems to work ok except for the magnetometer. The values it produces do not change when you re-orient the device. If you re-orient the device and power cycle it you will see a new set of values which will remain unchanged until the next power cycle. My build version is zephyr-v2.6.0-535-gbd09d4ff3f81Did you send a pull request with the fix? If not, please do. Although I'm confused about how this builds with no 'dev' in scope. Martí
|
|