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,
|
|
Re: Running Peripheral_hids app on Linux PC
Hi Gopal,
On 12 Aug 2019, at 19.34, Gopal krishna Reddy <gopalkrishnareddy514@gmail.com> wrote: I have compiled the Peripheral_hids app using the build option as native_posix and was able to generate the zephyr.exeThe HCI device needs to be powered down first, using e.g. “hciconfig hci0 down”. Does that help? Johan
|
|
Running Peripheral_hids app on Linux PC
Gopal krishna Reddy <gopalkrishnareddy514@...>
Hi, I have compiled the Peripheral_hids app using the build option as native_posix and was able to generate the zephyr.exe I have connected a CSR Bluetooth 4.0 Dongle to the Linux PC and tried to run the zephyr.exe using the below command. sudo ./zephyr.exe --bt-dev=hci0 Output:
00:00:00.000,000] <inf> flash_native_posix: Device flash_ctrl initialized
***** Booting Zephyr OS build zephyr-v1.14.0-3069-g513244afe251 *****
[00:00:00.000,000] <err> bt_hci_core: HCI driver open failed (-16)
Bluetooth init failed (err -16) I am getting the above error. Thanks, Gopal
|
|
Re: IDE for app development
Hi Kevin,
toggle quoted messageShow quoted text
Thanks for your reply. Any editor recommendation? Thanks, Marco
On August 10, 2019 1:42:28 a.m. PDT, Kevin Townsend <kevin@...> wrote:
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
|
Re: IDE for app development
Kevin Townsend
For debugging I generally use Ozone from Segger which is free depending on the JLink model you have. You just need to point it to the zephy.elf file. Kevin
On Sat, 10 Aug 2019 at 05:30, Marco Tozzini <lists@...> wrote: Hi,
|
|
IDE for app development
Hi,
Eclipse IDE is used as reference example to debug apps in Zephyr What are the recommended IDE? Thanks, Marco
|
|
West 0.6.0 is released, and required
Bolivar, Marti
Hello,
West 0.6.0 has been released and is now the minimum version which will be supported in Zephyr mainline (and thus for the 2.0 release).
To upgrade on Linux: pip3 install --upgrade --user west
macOS and Windows: pip3 install --upgrade west
Release notes are part of the documentation and are up on the latest docs pages: https://docs.zephyrproject.org/latest/guides/west/release-notes.html
Thanks, Marti
|
|
West flashing very large images to nrf52840
My code has finally grown over 512k. I am programming the nrf52840_mdk board: BOARD=nrf52840_mdk
When attempting to program the nrf52840 the flash operation fails because the -t parameter emitted by west is incorrect. West flash does the following: runners.pyocd: pyocd flash -e sector -a 0xc000 -t nrf52 <path>/build/zephyr/zephyr.bin as you can see west sets “-t nrf52”, this works great as long as you don’t overrun the 512k of code (the nrf52832 limit) into the flash, beyond which pyocd (or nrfjprog) will complain that there is too much code.
West should set the -t parameter to “-t nrf52840” for nrf52840 boards.
Current workaround is to manually run pyocd or nrfjprog with the correct -t parameter.
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.
|
|
West flash annoyance (signed images)
It took me a while to figure out my problem with west flash.
After building regular zephyr app, you can simply call ‘west flash’, and west happily does the right thing, it gets the image passes it to the runner, the file gets flashed onto the board and it runs. All is good.
Then I started to build files to run under MCUBoot. West happily builds the image, and west happily signs the image when you run the right command and give it a path to the key: $ west sign -t imgtool -- --key ~/rc-demo/mcuboot/mykey-rsa-2048.pem --version 1.2 Generating: /home/lawrence/zephyrproject/zephyr/samples/subsys/mgmt/mcumgr/smp_svr/build/zephyr/zephyr.signed.bin Generating: /home/lawrence/zephyrproject/zephyr/samples/subsys/mgmt/mcumgr/smp_svr/build/zephyr/zephyr.signed.hex West starts with the image file, and generates two new signed files, just as one would expect
Then things go bad(ish). I politely asked west to flash the signed file $ west flash --hex-file zephyr.signed.hex -- west flash: rebuilding ninja: no work to do. -- west flash: using runner pyocd -- runners.pyocd: Flashing Target Device [====================] 100% 0018045:INFO:loader:Erased 131072 bytes (32 sectors), programmed 131072 bytes (32 pages), skipped 0 bytes (0 pages) at 7.46 kB/s You would expect west to go fetch the signed file and pass it to the runner, and it sure looks like it did, there is even enough of an image signature that mcu boot thinks there is an image in the primary slot. But mcuboot says the image is not valid. ***** Booting Zephyr OS build zephyr-v1.14.0-2977-g8622c3415d2f ***** [00:00:00.004,974] <inf> mcuboot: Starting bootloader [00:00:00.011,444] <inf> mcuboot: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3 [00:00:00.021,392] <inf> mcuboot: Scratch: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3 [00:00:00.030,792] <inf> mcuboot: Boot source: primary slot [00:00:00.039,855] <inf> mcuboot: Swap type: none [00:00:00.045,013] <err> mcuboot: Image in the primary slot is not valid! [00:00:00.052,490] <err> mcuboot: Unable to find bootable image
It took me the longest time to figure out that west did not do what I had expected: $ west --verbose flash --hex-file zephyr.signed.hex ZEPHYR_BASE=/home/lawrence/zephyrproject/zephyr (origin: env) -- west flash: rebuilding ninja: no work to do. -- west flash: using runner pyocd -- runners.pyocd: Flashing Target Device runners.pyocd: pyocd flash -e sector -a 0xc000 -t nrf52 /home/lawrence/zephyrproject/zephyr/samples/subsys/mgmt/mcumgr/smp_svr/build/zephyr/zephyr.bin [====================] 100%
Why would west send the unsigned file? Why would west send a bin file when I requested a hex file. At the very least west could complain that it couldn’t find the hex file. Instead west silently does the wrong thing.
The work around is: $ west --verbose flash --hex-file build/zephyr/zephyr.signed.hex ZEPHYR_BASE=/home/lawrence/zephyrproject/zephyr (origin: env) -- west flash: rebuilding ninja: no work to do. -- west flash: using runner pyocd -- runners.pyocd: Flashing Target Device runners.pyocd: pyocd flash -e sector -a 0xc000 -t nrf52 build/zephyr/zephyr.signed.hex [====================] 100% 0017210:INFO:loader:Erased 4096 bytes (1 sector), programmed 4096 bytes (1 page), skipped 126976 bytes (31 pages) at 7.92 kB/s As you can see, the runner only had to reprogram the signature in the last page. And mcuboot happily started the image which it is running as expected.
In an ideal world west should know that I needed to sign the image (based on the setting “CONFIG_BOOTLOADER_MCUBOOT=y” in the prj.conf file), and should by default send the signed image to the runner. Of course west will need to know where the keys are, and determine if the code should go into the primary or secondary slot.
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: Cmake and DTC Version issues installing Zephyr
Dear All:
toggle quoted messageShow quoted text
Charles has updated the instructions on the getting started guide. I have followed these instructions carefully on a 'new' Virtual Machine'. The instructions work on Ubuntu 18.04 and 19.04 as written, at the time I tested them (Around July 31st). Of course we are in an ever evolving world, Lunix, and Zephyr are always changing so just because the instructions are currently working doesn't mean they will always work, but at this time I am satisfied that they do work as written. Thanks to Charles for the updates to the getting started guide. Lawrence King Principal Developer +1(416)627-7302
-----Original Message-----
From: Andrei Emeltchenko <andrei.emeltchenko.news@gmail.com> Sent: Tuesday, August 6, 2019 9:26 AM To: Lawrence King <lawrence.king@irdeto.com> Cc: Bolivar, Marti <Marti.Bolivar@nordicsemi.no>; Zephyr-users@lists.zephyrproject.org; users@lists.zephyrproject.org Subject: Re: [Zephyr-users] Cmake and DTC Version issues installing Zephyr Hi All, I was having similar issue: west was failing, probably because there were several revisions: a default one and bootstrapping one. I switched default to the same revision as bootstrapping and it did help. $ pip3 install --user west==0.6.0 Best regards Andrei Emeltchenko On Thu, Jul 25, 2019 at 02:16:57PM +0000, Lawrence King wrote: Hi Marti
|
|
API meeting: Agenda
Carles Cufi
Hi all,
This week we will look at: Agenda: - GPIO: Quick confirmation of API suitability * See: https://github.com/zephyrproject-rtos/zephyr/issues/15611#issuecomment-516488369 - Sensor API: Update on progress if contributors present 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: Cmake and DTC Version issues installing Zephyr
Andrei
Hi All,
toggle quoted messageShow quoted text
I was having similar issue: west was failing, probably because there were several revisions: a default one and bootstrapping one. I switched default to the same revision as bootstrapping and it did help. $ pip3 install --user west==0.6.0 Best regards Andrei Emeltchenko
On Thu, Jul 25, 2019 at 02:16:57PM +0000, Lawrence King wrote:
Hi Marti
|
|
Re: [EXT] [Zephyr-users] Zephyr SDK 0.10.2-rc1 available
Kumar Gala
Yeah, that’s merged now.
toggle quoted messageShow quoted text
:) - k
On Aug 5, 2019, at 4:01 AM, Andrei Gansari <andrei.gansari@nxp.com> wrote:
|
|
Re: [EXT] [Zephyr-users] Zephyr SDK 0.10.2-rc1 available
Andrei Gansari
Will not work in current mainline, unless you apply https://github.com/zephyrproject-rtos/zephyr/pull/17984
toggle quoted messageShow quoted text
Andrei Gansari
-----Original Message-----
From: users@lists.zephyrproject.org <users@lists.zephyrproject.org> On Behalf Of Kumar Gala via Lists.Zephyrproject.Org Sent: Friday, August 2, 2019 6:36 PM To: zephyr-devel <zephyr-devel@lists.zephyrproject.org>; zephyr-users@lists.zephyrproject.org Cc: users@lists.zephyrproject.org Subject: [EXT] [Zephyr-users] Zephyr SDK 0.10.2-rc1 available Caution: EXT Email Hi, Latest version of the SDK can be found here: https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fzephyrproject-rtos%2Fsdk-ng%2Freleases%2Ftag%2Fv0.10.2-rc1&amp;data=02%7C01%7Candrei.gansari%40nxp.com%7C76dce26ca04a4a350c2108d7175f282f%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637003569775968607&sdata=XyPtEs%2BkmpQap%2FxD9M%2BGu5tHNKtCM11tpNN3IIISgls%3D&reserved=0 Please download and try things out and report any issues. Changes since the last release: • Updated to QEMU 4.0.0 • Added aarch64 qemu target for use w/Cortex-R support (for xlnx-zcu102 target) • Updated openocd for bug fix on TI CC13x2/CC26x2 platforms. - k
|
|