Date   

Re: Adding SOC EFR32MG13P linking issue

Kumar Gala
 

On Aug 26, 2019, at 4:52 PM, via Lists.Zephyrproject.Org <marianoizzi=yahoo.com@...> wrote:

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.
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?. 
Also, what's the difference if I use bt_encrypt_le() instead of bt_encrypt_be() ? (I'm not a crypto pro here)   


#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

leonardomt@...
 

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


Re: Test if a given GPIO is interruptible #gpio #dts

Bolivar, Marti
 

Hello again :)

"leonardomt via Lists.Zephyrproject.Org"
<leonardomt=gmail.com@...> 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).
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?
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.


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.
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.


Thank you!


Re: GPIO support on nRF52840 DK

Bolivar, Marti
 

"leonardomt via Lists.Zephyrproject.Org"
<leonardomt=gmail.com@...> 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.
Thanks for the fix and the walk-thru!
Sure thing!


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?
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


Test if a given GPIO is interruptible #gpio #dts

leonardomt@...
 

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

leonardomt@...
 

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

Lawrence King
 

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:

  1. A device tree entry under i2c0
  2. Descriptions of which interrupt pins from the sensor are connected to which gpios added to the device tree
  3. Convince west or cmake to bring in the source from modules and compile it into the build

 

‘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

https://www.Irdeto.com

+1(416)627-7302

 

1  2 - linkedin  3 - instagram  4 - youtube  6 - facebook  7

            

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@...> writes:

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?
https://docs.zephyrproject.org/latest/boards/arm/nrf52840_pca10056/doc/index.html#push-buttons

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).
All GPIOs are supported and accessible, not just the LEDs and
buttons. This includes all GPIOs pinned out to the expansion headers.


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
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)



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.
You did great! Your question was clear.


Thanks for your help!
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

Johan Hedberg
 

Hi Paul,

On 13 Aug 2019, at 17.00, paul.leguennec@... wrote:
I'm putting this message up, if by any chance someone have an idea or may help me.

I also tried to implement a GATT service to see if I was able to receive notifications on nrfConnect, but had no difference.

FIY the mesh message received by the proxy node is a buffer that I add retrieve using net_buf_simple_add_mem function.
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,

I'm putting this message up, if by any chance someone have an idea or may help me.

I also tried to implement a GATT service to see if I was able to receive notifications on nrfConnect, but had no difference.

FIY the mesh message received by the proxy node is a buffer that I add retrieve using net_buf_simple_add_mem function.


Thanks in advance,
Paul


Re: Running Peripheral_hids app on Linux PC

Johan Hedberg
 

Hi Gopal,

On 12 Aug 2019, at 19.34, Gopal krishna Reddy <gopalkrishnareddy514@...> wrote:
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)
The 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

Marco Tozzini
 

Hi Kevin,

Thanks for your reply.
Any editor recommendation?

Thanks,
Marco


On August 10, 2019 1:42:28 a.m. PDT, Kevin Townsend <kevin@...> wrote:
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,

Eclipse IDE is used as reference example to debug apps in Zephyr
What are the recommended IDE?

Thanks,
Marco




--
Sent from my Android device with K-9 Mail. Please excuse my brevity.