Running Zephyr on Arty,
#litex
ps.lindblad@...
Hi, I've been trying to get a Zephyr sample running on the Arty FPGA-board without succeeding. Thanks, Stefan printenv | grep ZEPHYR ZEPHYR_TOOLCHAIN_VARIANT=zephyr ZEPHYR_BASE=/home/stefan/FPGA/Zeph/zephyr ZEPHYR_SDK_INSTALL_DIR=/opt/zephyr-sdk/ stefan@virtLinux:~/FPGA/Zeph/zephyr$ ls arch CMakeLists.txt doc include lib modules soc version.h.in boards CODE_OF_CONDUCT.md drivers Kconfig LICENSE README.rst subsys west.yml build CODEOWNERS dts Kconfig.zephyr Makefile samples tests zephyr-env.cmd cmake CONTRIBUTING.rst ext kernel misc scripts VERSION zephyr-env.sh stefan@virtLinux:~/FPGA/Zeph/zephyr$ west build -b litex_vexriscv samples/hello_world -- west build: build configuration: source directory: /home/stefan/FPGA/Zeph/zephyr/samples/hello_world build directory: /home/stefan/FPGA/Zeph/zephyr/build BOARD: litex_vexriscv (origin: CMakeCache.txt) -- west build: building application ninja: no work to do. stefan@virtLinux:~/FPGA/Zeph/zephyr$ lxterm --serial-boot --kernel build/zephyr/zephyr.bin /dev/ttyUSB1 [LXTERM] Starting.... __ _ __ _ __ / / (_) /____ | |/_/ / /__/ / __/ -_)> < /____/_/\__/\__/_/|_| (c) Copyright 2012-2019 Enjoy-Digital (c) Copyright 2007-2015 M-Labs Ltd BIOS built on Aug 27 2019 22:09:58 BIOS CRC passed (354dfde9) Migen git sha1: -------- LiteX git sha1: 5a7b4c34 --============ SoC info ================-- CPU: VexRiscv @ 100MHz ROM: 32KB SRAM: 32KB L2: 8KB MAIN-RAM: 262144KB --========= Peripherals init ===========-- Initializing SDRAM... SDRAM now under software control Read leveling: m0, b0: |11111100000000000000000000000000| delays: 03+-03 m0, b1: |00000000000011111111100000000000| delays: 16+-04 m0, b2: |00000000000000000000000000001111| delays: 30+-02 m0, b3: |00000000000000000000000000000000| delays: - m0, b4: |00000000000000000000000000000000| delays: - m0, b5: |00000000000000000000000000000000| delays: - m0, b6: |00000000000000000000000000000000| delays: - m0, b7: |00000000000000000000000000000000| delays: - best: m0, b1 delays: 16+-04 m1, b0: |11111111100000000000000000000000| delays: 04+-04 m1, b1: |00000000000001111111111100000000| delays: 18+-05 m1, b2: |00000000000000000000000000000111| delays: 30+-01 m1, b3: |00000000000000000000000000000000| delays: - m1, b4: |00000000000000000000000000000000| delays: - m1, b5: |00000000000000000000000000000000| delays: - m1, b6: |00000000000000000000000000000000| delays: - m1, b7: |00000000000000000000000000000000| delays: - best: m1, b1 delays: 18+-05 SDRAM now under hardware control Memtest OK --========== Boot sequence =============-- Booting from serial... Press Q or ESC to abort boot completely. sL5DdSMmkekro [LXTERM] Received firmware download request from the device. [LXTERM] Uploading build/zephyr/zephyr.bin to 0x40000000 (9608 bytes)... [LXTERM] Upload complete (7.7KB/s). [LXTERM] Booting the device. [LXTERM] Done. Executing booted program at 0x40000000 --============= Liftoff! ===============--
|
|
NRF52832 debugging in eclipse
#nrf52832
#jlink
#debugging
#eclipse
Stefan Hristozov
Hi,
i am trying to set up eclipse, gdb and jlink for debugging NRF52832. I am using a PCA10040 board with an integrated Jlink debugger. I have a simple project with a single main.c file. My prj.conf are: CONFIG_DEBUG=y CONFIG_DEBUG_INFO=y CONFIG_DEBUG_OPTIMIZATIONS=y CONFIG_SYS_PM_DEBUG=y I configured the debugger in eclipse as shown in the figures: Unfortunately when I start the debug session the execution stops in the _find_fd_entry: How to properly configure the debugger for debugging zephyrs applications?
|
|
API meeting: agenda
Carles Cufi
Hi all,
This week we will look at: Agenda: - Sensor API: Update on progress - GPIO: Update on https://github.com/zephyrproject-rtos/zephyr/pull/16648 and possibly merging it Additional items in the "Triage" column in the GitHub project may be discussed if time permits. If you want an item included in the meeting, please add it to the GitHub project. https://github.com/zephyrproject-rtos/zephyr/wiki/Zephyr-Committee-and-Working-Group-Meetings#zephyr-api-discussion https://github.com/zephyrproject-rtos/zephyr/projects/18 https://docs.google.com/document/d/1lv-8B5QE2m4FjBcvfqAXFIgQfW5oz6306zJ7GIZIWCk/edit Regards, Carles
|
|
Re: Adding SOC EFR32MG13P linking issue
Kumar Gala
On Aug 26, 2019, at 4:52 PM, via Lists.Zephyrproject.Org <marianoizzi=yahoo.com@lists.zephyrproject.org> wrote:If you can share your work on GitHub, it will probably be easier to try and see what might be going on. - k
|
|
Adding SOC EFR32MG13P linking issue
Mariano Izzi <marianoizzi@...>
Hi, I'm trying to use Zephyr on a Silabs board already supported (efr32_slwstk6061a) but with a different SOC; the EFR32MG13P. What I did was copying all the EFR32MG12P related files, renamed them to EFR32MG13P and edited their content (memory size mostly) Also I created a new board (efr32mg13_slwstk6061a) and add it as an option on all the config files. Finally I added the lib and hal files for the new SOC. So far I was able to compile but NOT TO LINK the sample project. The project with the original board/SOC links fine. I'm attaching the log, seems to me linker path issue; but I'm new with cmake and don't know how to fix it. Best Regards, Mariano Izzi
|
|
Re: #bluetooth #nrf52832 #bt
#bluetooth
#nrf52832
#bt
Carles Cufi
Hi there,
There was recently a similar question on Slack. Take a look at https://github.com/zephyrproject-rtos/zephyr/blob/master/subsys/bluetooth/mesh/crypto.c BLE Mesh has a similar requirement to encrypt/decrypt contents of advertising packets.
Carles
From: users@... <users@...>
On Behalf Of 1606140 via Lists.Zephyrproject.Org
Sent: 25 August 2019 13:53 To: users@... Cc: users@... Subject: [Zephyr-users] #bluetooth #nrf52832 #bt
Hi, all. I am encrypting the UUID of my beacon and wants to decrypt it at the scanner's end. But the problem is that the docs say only about encryption function bt_encrypt_be(). How
do I decrypt my UUID at the scanner's end?.
|
|
#bluetooth #nrf52832 #bt
#bluetooth
#nrf52832
#bt
1606140@...
Hi, all. I am encrypting the UUID of my beacon and wants to decrypt it at the scanner's end. But the problem is that the docs say only about encryption function bt_encrypt_be(). How do I decrypt my UUID at the scanner's end?.
Also, what's the difference if I use bt_encrypt_le() instead of bt_encrypt_be() ? (I'm not a crypto pro here)
|
|
Re: GPIO support on nRF52840 DK
That makes sense!
I stand corrected; the interrupt is raised just as it is in the button example! I am not quite sure why it didn't trigger before but it must have been a result of playing around with these files. Thanks, Leo
|
|
Bolivar, Marti
Hello again :)
"leonardomt via Lists.Zephyrproject.Org" <leonardomt=gmail.com@lists.zephyrproject.org> writes: Is there a way to detect programmatically if a given pin can be configured as interrupt using Zephyr? (e.g. some sort of a map/list or macros that I could reuse).I would say that if the hardware supports interrupts, then the Zephyr GPIO driver for it should as well. Otherwise, it's a bug in the driver. As far as I know, in general this problem needs to be solved by knowing the hardware. There are all sorts of GPIO chips out there.
|
|
Re: GPIO support on nRF52840 DK
Bolivar, Marti
"leonardomt via Lists.Zephyrproject.Org"
<leonardomt=gmail.com@lists.zephyrproject.org> writes: This worked, although this pin in particular did not trigger the interrupt function but required calling gpio_pin_read(...) inside a loop to detect changes in its state.Sure thing! Port 1 is the GPIO controller; the .0 is a pin number it controls. You want the device label for the controller -- as you've seen, the pin number is a separate piece of data. You can look at the DTS files to know what nodes are available: https://github.com/zephyrproject-rtos/zephyr/blob/master/dts/arm/nordic/nrf52840.dtsi#L126 This dtsi (Device Tree Source Include) is included from the .dts file for the board, which you can find by searching for its name in boards/*/: https://github.com/zephyrproject-rtos/zephyr/blob/master/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts The nodes have the addresses of the hardware peripherals they correspond to, so you can find the one you want by comparing your chip memory map with the DT reg property. (But usually, they're numbered according to the same peripheral numbering in the chip reference manual, so P1 means you're looking for GPIO_1. And similarly for other types of peripheral, like SPI_1, I2C_3, etc.) Marti Thanks
|
|
Is there a way to detect programmatically if a given pin can be configured as interrupt using Zephyr? (e.g. some sort of a map/list or macros that I could reuse).
Are there any side effects in configuring a pin as an interrupt if it didn't have such hardware capability? Is this information listed in a dts or yaml file or is the only approach to search with a vendor's datasheet if a pin has an interrupt? What I would like to do is to configure pins dynamically, so that at a given point a GPIO pin is configured as a digital output and later on it is configured as a digital input; if it is interruptible, use that feature preferably, otherwise check its state in a loop. Thank you!
|
|
Re: GPIO support on nRF52840 DK
This worked, although this pin in particular did not trigger the interrupt function but required calling gpio_pin_read(...) inside a loop to detect changes in its state.
Thanks for the fix and the walk-thru! What thought process or what resource/documentation makes one realize that pin P1.0 belongs to port DT_ALIAS_GPIO_1_LABEL? For example, I found that P1.0 (D1) belongs to port "gpio1" by looking at the gpio-map definition in nrf52840_pca10056.dts; as you suggested, generated_dts_board_unfixed.h lists that "GPIO_1" is assigned to DT_NORDIC_NRF_GPIO_50000300_LABEL and finally that DT_ALIAS_GPIO_1_LABEL = DT_NORDIC_NRF_GPIO_50000300_LABEL... but is this the only way to know what's where? Thanks
|
|
Adding a Sensor LSM9DS1
I am trying to add a sensor to my project. I have already verified that it is electrically connected to the i2c bus correctly with a simple test program which reads the WHO_AM_I register using direct i2c_transfer calls:
struct i2c_msg msgs[1];
msgs[0].buf = data; msgs[0].len = num_bytes; msgs[0].flags = I2C_MSG_READ | I2C_MSG_STOP;
return i2c_transfer(i2c_dev, &msgs[0], 1, addr);
Now I want to enable the sensor subsystem, that seems easy enough, just add a few lines to the prj.conf file: CONFIG_SENSOR=y CONFIG_SENSOR_LOG_LEVEL_INF=y CONFIG_SENSOR_LOG_LEVEL=3 CONFIG_SENSOR_INIT_PRIORITY=90
And finally since the drivers are already in the zephyrproject tree, I want to use the LSM9DS1 drivers that are in modules/hal/st/sensor/stmemsc/lsm9ds1_STdC/driver
Here is where I get stuck, I know I need to add a few things:
‘ninja menuconfig’ doesn’t know anything about the external modules, although west build did put the name of the directory in build/zephyr_modules.txt
I couldn’t find any examples even for other sensors in the zephyr/samples directory, or in the zephyrproject documentation (although but I may have missed it).
Does someone have an example of the device tree entries, and the build process for an external sensor module?
Lawrence King Principal Developer Connected Transport Market Unit +1(416)627-7302
CONFIDENTIAL: This e-mail and any attachments are confidential and intended solely for the use of the individual(s) to whom it is addressed. It can contain proprietary confidential information and be subject to legal privilege and/or subject to a non-disclosure Agreement. Unauthorized use, disclosure or copying is strictly prohibited. If you are not the/an addressee and are in possession of this e-mail, please delete the message and notify us immediately. Please consider the environment before printing this e-mail. Thank you.
|
|
Re: GPIO support on nRF52840 DK
Bolivar, Marti
Hi,
" via Lists.Zephyrproject.Org" <leonardomt=gmail.com@lists.zephyrproject.org> writes: Hello everyone,All GPIOs are supported and accessible, not just the LEDs and buttons. This includes all GPIOs pinned out to the expansion headers. I think this is likely to be a common question for beginners, so I'll provide various details here that hopefully will be google-able for others later :). There is a TL;DR for this specific question below. Zephyr's GPIO API works differently than Arduino's. Instead of a single, linear pin numbering from 0 to N-1 for all the pins (or the D0, D1, ... "digital" and A0, A1, ... "analog" pin macros), Zephyr identifies a GPIO with two pieces of information: 1. The GPIO "controller", which is a struct device implementing the GPIO API. For all the gory details on the device model, see: https://docs.zephyrproject.org/latest/reference/drivers/index.html 2. The pin number, which is specific to each controller. For example, pin 0 on one controller is different than pin 0 on another controller. On nRF SoCs, there are two separate GPIO controller devices: one for the P0.x pins, and another for the P1.x pins. So, to use pin P1.01 in the button sample, you need to set PORT to use the P1.x controller, and PIN to 1. To set PORT, you need the "label" for the P1.x controller, which in this case is DT_ALIAS_GPIO_1_LABEL. This define is generated by device tree. See zephyr/include/generated/generated_dts_board_unfixed.h in your build directory for all the available defines, and https://docs.zephyrproject.org/latest/guides/dts/index.html for more information on DT. It works the exact same way on other SoCs. Only the label defines from DT vary. TL;DR here's a patch that does what you want: diff --git zephyr/samples/basic/button/src/main.c zephyr/samples/basic/button/src/main.c index d55147c171..c1e94767a7 100644 --- zephyr/samples/basic/button/src/main.c +++ zephyr/samples/basic/button/src/main.c @@ -52,6 +52,10 @@ /* Sleep time */ #define SLEEP_TIME 500 +#undef PORT +#undef PIN +#define PORT DT_ALIAS_GPIO_1_LABEL +#define PIN 1 void button_pressed(struct device *gpiob, struct gpio_callback *cb, u32_t pins) You did great! Your question was clear. Hope this helps, Marti
|
|
#nvs can someone clarify how to traverse NVS?
#nvs
Ruben Kertesz
I would like to use the NVS with the nrf9160 for remote logging. Specifically I don't understand how to track latest read and latest write at the same time.
I want to be able to write 5 values (time stamp and four readings) to a ring buffer in flash each time we take a measurement. I was thinking that the way to do this is to use 5 IDs and then use an index to track the latest successful read + upload. When I am connected to the internet I will read all five IDs for each measurement interval and send them to the server . The issue is that I don't want to send all of the recorded data to the server if for example the first hundred records that are stored in the ring buffer were already successfully uploaded and there are only 20 remaining measurement intervals that need to be uploaded. Am I going about this the wrong way? Does anybody have any expertise that they can offer in terms of how to index the saved measurements and then the traverse the index using something like a read pointer and a right pointer? Speaking of, the point of all of this is that I know the sensor will sometimes be configured to log locally and only upload data every hour, 2 hours, 3 hours, etc. I would rather not clear out the buffer every time I upload data in the event that something else goes wrong, like data loss on the server. it's nice to be able to go to the physical device and retrieve locally logged data if needed
|
|
Zephyr SDK 0.10.3
Kumar Gala
Hi,
Latest version of the SDK can be found here: https://github.com/zephyrproject-rtos/sdk-ng/releases/tag/v0.10.3 Please download and try things out and report any issues. Changes since the last release: • Fixes a Linker issue found on RISC-V. - k
|
|
GPIO support on nRF52840 DK
Leonardo Molina <leonardomt@...>
Hello everyone, Can I access (read/write) a GPIO that is not an LED or button listed in the "Connections and IOs" section of link below?
I read in that page that "Other hardware features are not supported by
the Zephyr kernel." but (since I am a newbie in embedded devices) I am not sure if that means that "only buttons 1 to 4 are supported and no other GPIO" or else refers to more abstract features (e.g. Enhanced ShockBurst). Here's the context of my question: I am editing the example code samples/basic/button to use a GPIO pin that is different from BUTTON 1, 2, 3 or 4 to trigger the button_pressed callback. I changed #define PIN DT_ALIAS_SW0_GPIOS_PIN ... to ... #define PIN 33 and the callback is never called when I toggle the logical state of that pin in the board (from ground to 3.3V nor VDD). I am not sure if this makes sense if I am using Zephyr, but in the nRF's SDK, GPIO P1.01 of the development board is mapped to 33: nRF5_SDK_15/components/boards/pca10056.h
#define ARDUINO_0_PIN This is my very first question on a public list/forum ever (...as far as I recall) so please forgive any mistakes in terms of posting rules, etc. Thanks for your help!
|
|
Re: Retrieve Mesh Proxy Data Out
#bluetoothmesh
#zephyrbluetoothmesh
#nrf52-pca10040
Hi Paul,
On 13 Aug 2019, at 17.00, paul.leguennec@stimio.fr wrote: I'm putting this message up, if by any chance someone have an idea or may help me.You need to configure proxy filtering to tell the proxy what addresses your proxy client is interested in. See section 6, and 6.4 in particular in the Mesh Profile Specification. There are many apps that can already do this, such as meshctl from BlueZ and nRF Mesh from Nordic (available both for iOS and Android). Johan
|
|
API meeting: agenda
Carles Cufi
Hi all,
This week we will look at: Agenda: - Sensor API: Update on progress rtio PR: https://github.com/zephyrproject-rtos/zephyr/pull/17434 - GPIO: Update on implementation and way forward Additional items in the "Triage" column in the GitHub project may be discussed if time permits. If you want an item included in the meeting, please add it to the GitHub project. https://github.com/zephyrproject-rtos/zephyr/wiki/Zephyr-Committee-and-Working-Group-Meetings#zephyr-api-discussion https://github.com/zephyrproject-rtos/zephyr/projects/18 https://docs.google.com/document/d/1lv-8B5QE2m4FjBcvfqAXFIgQfW5oz6306zJ7GIZIWCk/edit Regards, Carles
|
|
Re: Retrieve Mesh Proxy Data Out
#bluetoothmesh
#zephyrbluetoothmesh
#nrf52-pca10040
paul.leguennec@...
Hi,
|
|