Date   

Re: Example of how use UART to communicate with a LTE modem #uart #stm32

Gustavo FN
 

Hi Rodrigo,

Yes the pins are okay. I can confirm the STM32 is sending a testing message (I connected the sending UART to my computer and read the input).

Looks like the code to read the response is not working, the following part:

while (1) {
unsigned char recvChar;
while (uart_poll_in(uart, &recvChar) < 0)
printk("%c", recvChar);
}

On Fri, Nov 30, 2018 at 2:45 PM Rodrigo Peixoto <rodrigopex@...> wrote:
Gustavo,

Are you sure the pins are setup ok? You can try to use a ftdi connector to be sure.

Do you have an dts overlay?

Best regards,
Rodrigo
On Fri, 30 Nov 2018 at 12:59 Gustavo FN <gustavofn@...> wrote:
Thank you Stefan, I'll take a look.

I'll share here the simple code I'm doing but so far it is not working. The pins PA9 and PA10 of my STM32 are connected to an adapter to serial port (TX->RX, RX->TX and same ground, also I powed the adapter at 3.3V STM32 pin), a serial port cable and then connected to the modem LTE serial port (I'll double check if the adapter is working well to).

#include <zephyr.h>
#include <device.h>
#include <gpio.h>
#include <uart.h>

static int myuart_send(struct device *uart, char * szStr) {
    size_t i;
    unsigned char temp;
    for (i = 0; i < strlen(szStr); i++) {
        temp = szStr[i];
        temp = uart_poll_out(uart, temp);
    }
}

#define myuart_UART "UART_1"

void main(void) {
    struct device * uart;

    // uart setup
    uart = device_get_binding(myuart_UART);
    if (!uart) {
        printk("Cannot find myuart uart(%s)!\n", myuart_UART);
        return;
    }

    printk("Sending AT to UART");
    myuart_send(uart,"AT\r");
    printk("Sleeping 500ms");
    k_sleep(500);
    printk("Infinite Loop to read the response from uart1");
    while (1) {
unsigned char recvChar;
while (uart_poll_in(uart, &recvChar) < 0)
printk("%c", recvChar);
    }
}

What I'm missing? This code should send the command "AT" to the modem and the loop should expect to print the "OK" back.

Thanks everyone,

On Fri, Nov 30, 2018 at 6:58 AM Paul Sokolovsky <paul.sokolovsky@...> wrote:
Hello Stefan,

On Fri, 30 Nov 2018 10:20:19 +0000
"Stefan Jaritz" <stefan@...> wrote:

[]

> Keep in mind when you are on the master branch that the API is
> changing from time to time. p.e. 2 days ago the uart_poll_out
> function changed and broke my demo project. :D

Can you elaborate on this? uart_poll_out() is one of the most stable
functions one can imagine, and we're making commitment to not touch it
with the upcoming refactors of UART APIs (which are required otherwise
to both make it more general and easier to use).

>
>
> Regards!
>
>
> Stefan

[]

--
Best Regards,
Paul

Linaro.org | Open source software for ARM SoCs
Follow Linaro: http://www.facebook.com/pages/Linaro
http://twitter.com/#!/linaroorg - http://www.linaro.org/linaro-blog



--
Gustavo

--
Rodrigo Peixoto
Co-founder and Technical guru

+55 (82) 98144-8585
http://ayna.tech | Skype: rodrigopex

.
--
Gustavo


Re: Example of how use UART to communicate with a LTE modem #uart #stm32

Rodrigo Peixoto
 

Gustavo,

Are you sure the pins are setup ok? You can try to use a ftdi connector to be sure.

Do you have an dts overlay?

Best regards,
Rodrigo

On Fri, 30 Nov 2018 at 12:59 Gustavo FN <gustavofn@...> wrote:
Thank you Stefan, I'll take a look.

I'll share here the simple code I'm doing but so far it is not working. The pins PA9 and PA10 of my STM32 are connected to an adapter to serial port (TX->RX, RX->TX and same ground, also I powed the adapter at 3.3V STM32 pin), a serial port cable and then connected to the modem LTE serial port (I'll double check if the adapter is working well to).

#include <zephyr.h>
#include <device.h>
#include <gpio.h>
#include <uart.h>

static int myuart_send(struct device *uart, char * szStr) {
    size_t i;
    unsigned char temp;
    for (i = 0; i < strlen(szStr); i++) {
        temp = szStr[i];
        temp = uart_poll_out(uart, temp);
    }
}

#define myuart_UART "UART_1"

void main(void) {
    struct device * uart;

    // uart setup
    uart = device_get_binding(myuart_UART);
    if (!uart) {
        printk("Cannot find myuart uart(%s)!\n", myuart_UART);
        return;
    }

    printk("Sending AT to UART");
    myuart_send(uart,"AT\r");
    printk("Sleeping 500ms");
    k_sleep(500);
    printk("Infinite Loop to read the response from uart1");
    while (1) {
unsigned char recvChar;
while (uart_poll_in(uart, &recvChar) < 0)
printk("%c", recvChar);
    }
}

What I'm missing? This code should send the command "AT" to the modem and the loop should expect to print the "OK" back.

Thanks everyone,

On Fri, Nov 30, 2018 at 6:58 AM Paul Sokolovsky <paul.sokolovsky@...> wrote:
Hello Stefan,

On Fri, 30 Nov 2018 10:20:19 +0000
"Stefan Jaritz" <stefan@...> wrote:

[]

> Keep in mind when you are on the master branch that the API is
> changing from time to time. p.e. 2 days ago the uart_poll_out
> function changed and broke my demo project. :D

Can you elaborate on this? uart_poll_out() is one of the most stable
functions one can imagine, and we're making commitment to not touch it
with the upcoming refactors of UART APIs (which are required otherwise
to both make it more general and easier to use).

>
>
> Regards!
>
>
> Stefan

[]

--
Best Regards,
Paul

Linaro.org | Open source software for ARM SoCs
Follow Linaro: http://www.facebook.com/pages/Linaro
http://twitter.com/#!/linaroorg - http://www.linaro.org/linaro-blog



--
Gustavo

--
Rodrigo Peixoto
Co-founder and Technical guru

+55 (82) 98144-8585
http://ayna.tech | Skype: rodrigopex

.


Re: Example of how use UART to communicate with a LTE modem #uart #stm32

Gustavo FN
 

Thank you Stefan, I'll take a look.

I'll share here the simple code I'm doing but so far it is not working. The pins PA9 and PA10 of my STM32 are connected to an adapter to serial port (TX->RX, RX->TX and same ground, also I powed the adapter at 3.3V STM32 pin), a serial port cable and then connected to the modem LTE serial port (I'll double check if the adapter is working well to).

#include <zephyr.h>
#include <device.h>
#include <gpio.h>
#include <uart.h>

static int myuart_send(struct device *uart, char * szStr) {
    size_t i;
    unsigned char temp;
    for (i = 0; i < strlen(szStr); i++) {
        temp = szStr[i];
        temp = uart_poll_out(uart, temp);
    }
}

#define myuart_UART "UART_1"

void main(void) {
    struct device * uart;

    // uart setup
    uart = device_get_binding(myuart_UART);
    if (!uart) {
        printk("Cannot find myuart uart(%s)!\n", myuart_UART);
        return;
    }

    printk("Sending AT to UART");
    myuart_send(uart,"AT\r");
    printk("Sleeping 500ms");
    k_sleep(500);
    printk("Infinite Loop to read the response from uart1");
    while (1) {
unsigned char recvChar;
while (uart_poll_in(uart, &recvChar) < 0)
printk("%c", recvChar);
    }
}

What I'm missing? This code should send the command "AT" to the modem and the loop should expect to print the "OK" back.

Thanks everyone,

On Fri, Nov 30, 2018 at 6:58 AM Paul Sokolovsky <paul.sokolovsky@...> wrote:
Hello Stefan,

On Fri, 30 Nov 2018 10:20:19 +0000
"Stefan Jaritz" <stefan@...> wrote:

[]

> Keep in mind when you are on the master branch that the API is
> changing from time to time. p.e. 2 days ago the uart_poll_out
> function changed and broke my demo project. :D

Can you elaborate on this? uart_poll_out() is one of the most stable
functions one can imagine, and we're making commitment to not touch it
with the upcoming refactors of UART APIs (which are required otherwise
to both make it more general and easier to use).

>
>
> Regards!
>
>
> Stefan

[]

--
Best Regards,
Paul

Linaro.org | Open source software for ARM SoCs
Follow Linaro: http://www.facebook.com/pages/Linaro
http://twitter.com/#!/linaroorg - http://www.linaro.org/linaro-blog



--
Gustavo


Re: Example of how use UART to communicate with a LTE modem #uart #stm32

Paul Sokolovsky
 

Hello Stefan,

On Fri, 30 Nov 2018 10:20:19 +0000
"Stefan Jaritz" <stefan@kokoontech.com> wrote:

[]

Keep in mind when you are on the master branch that the API is
changing from time to time. p.e. 2 days ago the uart_poll_out
function changed and broke my demo project. :D
Can you elaborate on this? uart_poll_out() is one of the most stable
functions one can imagine, and we're making commitment to not touch it
with the upcoming refactors of UART APIs (which are required otherwise
to both make it more general and easier to use).



Regards!


Stefan
[]

--
Best Regards,
Paul

Linaro.org | Open source software for ARM SoCs
Follow Linaro: http://www.facebook.com/pages/Linaro
http://twitter.com/#!/linaroorg - http://www.linaro.org/linaro-blog


Re: Example of how use UART to communicate with a LTE modem #uart #stm32

Stefan Jaritz
 

Hey Gustavo,

I had the same problem some moths ago. Some help to get into it:

1.) check how uarts work in ZephyrOS(poll/interrupt driven) https://github.com/zephyrproject-rtos/zephyr/tree/master/tests/drivers/uart/uart_basic_api

2.) maybe you need to setup the uart port, with different pins etc. Then you have to change the device tree. You can start with you test board and follow the includes till you reach the definition of the uart and its pins.

3.) Bluetooth stuff https://github.com/zephyrproject-rtos/zephyr/tree/master/samples/bluetooth

Keep in mind when you are on the master branch that the API is changing from time to time. p.e. 2 days ago the uart_poll_out function changed and broke my demo project. :D


Regards!


Stefan


On 29/11/2018 23:50, Gustavo FN wrote:

Hi everyone,

I am new with Zephyr OS and I have a STM32 nucleo l4rz5i board. I'm using the default UART2 port for console output and I would like to use uart1 to connect to a LTE modem, to be able to send data to an API over AT commands. Basically I need to know how to setup the UART1 port, be able to send commands and read the response from the LTE modem.

As far as I have seen, is no simple uart example in the sample section. So it is difficult for me to figure out how to take the initial steps. Please, has someone did it before and could share how it was done? All the best


Example of how use UART to communicate with a LTE modem #uart #stm32

Gustavo FN
 

Hi everyone,

I am new with Zephyr OS and I have a STM32 nucleo l4rz5i board. I'm using the default UART2 port for console output and I would like to use uart1 to connect to a LTE modem, to be able to send data to an API over AT commands.

Basically I need to know how to setup the UART1 port, be able to send commands and read the response from the LTE modem.

As far as I have seen, is no simple uart example in the sample section. So it is difficult for me to figure out how to take the initial steps. Please, has someone did it before and could share how it was done?

All the best


LL_ASSERT in event_common_prepare #ble

Phil Hipp
 

Hey,

I'm running Zephyr v1.13 on a custom nrf52840 board acting as an peripheral. I'm facing a LL_ASSERT in event_common_prepare at line 5649 after some time (peripheral already connected to a central peer). It seems that this issue already occurred (see https://github.com/zephyrproject-rtos/zephyr/issues/3287).

Does anybody got an idea about that?


I2S on Nordic #nrf52832

marcus
 
Edited

Hi,

Is there any way to use the I2S interface on a Nordic nRF with Zephyr?

Link to github issue: https://github.com/zephyrproject-rtos/zephyr/issues/11702


Re: NRF52840 Timer driver #nrf52840

Phil Hipp
 

Hey,

I've checked out this API, but k_timers only got a resolution in milliseconds. What I need is a timer with a resolution in microseconds. That's why I thought of using a timer peripheral of the nrf52840. The RTC timer of the nrf is used for systick and cannot be used for other purposes.


Re: NRF52840 Timer driver #nrf52840

Rodrigo Peixoto
 

Hi, Phil.
Have you tried to use the timer API (https://docs.zephyrproject.org/latest/kernel/timing/timers.html?highlight=timer)? Did you face issues? 
There is already an implementation for it (timer driver for NRF) as you can see at the link https://github.com/zephyrproject-rtos/zephyr/blob/master/drivers/timer/nrf_rtc_timer.c


Best regards,
Rodrigo Peixoto
Co-founder and Technical advisor

+55 (82) 98144-8585
http://ayna.tech | Skype: rodrigopex




Em seg, 19 de nov de 2018 às 07:56, Phil Hipp <finke@...> escreveu:

Any suggestions on this topic?


Re: Reconnect to a provisioned node in Mesh BLE #bluetoothmesh #ble #meshctl

Uilter Witte
 

I discovered what I forgot to do.

The provisioner, in my case the RPI, lost the connection with the network.
When it happens you just need to execute the command:
[meshctl]# connect [net_idx] [dst]                           //Connect to mesh network or node on network

Where [net_idx] is the number of the network that want to connect, what in my case is 0.

Thanks.

Em seg, 19 de nov de 2018 às 11:32, Uilter Witte <uilter.witte@...> escreveu:

Hi,

I'm working with Zephyr Project to study and build light solutions using Mesh BLE.
 
To proof the concept I'm using the following setup:
- 2 boards of Nordic with nRF52832 model PCA10040;
- Raspberry Pi Zero W with Bluez 5.50;
 
It worked without problems.
 
I'm using Zephyr Kernel v1.13.0 and Zephyr SDK 0.9.5.
 
My first objective is been able to provisioning and control the nodes through linux using the bluez.
Today I can do that, but I'm experiencing some problems in the reconnection phase of the node when I fully power it off.
 
How can I reconnect the node through bluez and control it again?
I'm not find any tips on internet or something like that.
 
Thank very much to tips or advice.
 
Regards,
Uilter Witte



--
--
Uilter Witte


COAP Client and server examples over BLE #nrf52-pca10040 #ble

swapnil <swapnil2007kadam@...>
 

Hello,

I have been trying to use COAP server and client examples over BLE for the last few days but not able to communicate between server and client. 

I will be grateful if I get help me with the following doubts. 

 I tried ipsp example from Bluetooth examples and it worked fine with the nrf52 dk.
 I thought of using the coap client and server from net examples with the two nrf52 DK, one for the client and another for Server.
 first, i compiled the client application with prj_bt.conf and after flashing it, bt shell opened. I followed the same procedure which i followed for the ipsp example and i was able to ping the client from Linux host.
 furthermore, I flashed coap server in another nrf52 DK. As there is no shell configured in conf file, nothing was on a screen.
 To get an access to the Bluetooth i configured bt shell for the server as well, but with that, i wasn't able to turn on the advertisement. 

  • What procedure needs to be followed to establish a BLE connection with these two devices? what configuration is needed to establish a connection between client and server?
  • how can I send a GET request to the server as only bt shell is present on the screen? and how one can see resources present on the server?

Thank you in advance.

regards,
Swapnil
 


Bluetooth: Mesh: APP key & Mesh initialisation delay related issue

vikrant8051 <vikrant8051@...>
 

Hi,

1) If we, (provision -> unprovision -> provision) the Bluetooth Mesh Node which is based on onoff_level_lighting_vnd_app then in case of some arbitrary available Model APP key not get save on SoC persistent storage during "any" reprovision event.

After reboot we have to reassign APP key to things get work.

2) Still facing Mesh initialisation delay. This is because of some recent commits.

There could be problem in commits which are merged after 
 46386522142e546c6e028db0f560c6db25a02d06 

Thank You !!




Reconnect to a provisioned node in Mesh BLE #bluetoothmesh #ble #meshctl

Uilter Witte
 

Hi,

I'm working with Zephyr Project to study and build light solutions using Mesh BLE.
 
To proof the concept I'm using the following setup:
- 2 boards of Nordic with nRF52832 model PCA10040;
- Raspberry Pi Zero W with Bluez 5.50;
 
It worked without problems.
 
I'm using Zephyr Kernel v1.13.0 and Zephyr SDK 0.9.5.
 
My first objective is been able to provisioning and control the nodes through linux using the bluez.
Today I can do that, but I'm experiencing some problems in the reconnection phase of the node when I fully power it off.
 
How can I reconnect the node through bluez and control it again?
I'm not find any tips on internet or something like that.
 
Thank very much to tips or advice.
 
Regards,
Uilter Witte


Re: Testing connection with long connection intervals and slave latency #ble #nrf52840

Phil Hipp
 

Thanks, I#ll give this a try.


Power Management with minimum residency smaller than 1s #nrf52840

Phil Hipp
 

Hey everybody,

I'm currently working on the OS controlled power management (CONFIG_PM_CONTROL_OS) on the nrf52840. We need the OS to switch to Low Power when it's idle for around 100ms, but the minimum residency that can be configured is 1s.

Is there any possibility to lower the minimum residency per configuration?


Re: Testing connection with long connection intervals and slave latency #ble #nrf52840

Vinayak Kariappa
 

Hi,

There is no public interface to the controller to do so, but there is this internal ISR context radio_active_callback
that can be configured to execute on every BLE radio event enable and disable at the end of the event. You could give a semaphore in that ISR callback and take actions in a thread.

Regards,
Vinayak


On Mon, Nov 19, 2018 at 11:57 AM Phil Hipp <finke@...> wrote:
Any suggestions on this topic?


Re: Testing connection with long connection intervals and slave latency #ble #nrf52840

Phil Hipp
 

Any suggestions on this topic?


Re: NRF52840 Timer driver #nrf52840

Phil Hipp
 

Any suggestions on this topic?


Re: Firmware Updates via I2C/SPI

Marti Bolivar <marti@...>
 

Hi Evan,

On Thu, Nov 15, 2018 at 10:36 AM Evan Gates <evan.gates@gmail.com> wrote:

I have an STM32F091VCH6 running Zephyr 1.12 with mcuboot 1.2.0. I have
another processor running linux with connections to the STM over both
I2C and SPI. I want to be able to send firmware upgrades from linux
over I2C or SPI.

Is there an existing way to do this? In my quick searches I didn't
find anything.
You will need some code which can write to the MCUboot slot 1 (not
slot 0, where you run out of) on flash based on data received from I2C
or SPI. I don't think there is any code for this in Zephyr, but
nothing is preventing it.


I see that zephyr has a Device Firmware Upgrade subsystem. As far as I
can tell both this subsystem and the dfu-util to use it are designed
for use over USB. Is there an existing solution to use DFU and
dfu-util over I2C/SPI? If not would it be difficult to write a
driver/interface for it?
The underlying APIs in <dfu/flash_img.h> and <dfu/mcuboot.h> are
agnostic to the transport. You can use any protocol you like,
including I2C and SPI. My company uses TCP and UDP for this, for
example.

To clear slot 1, use boot_erase_img_bank().

You then need to set up a struct flash_img_context (using
flash_img_init() after obtaining a pointer to your flash device with
device_get_binding()), then call flash_img_buffered_write() in your
I2C or SPI handlers as you receive the new image data.

When you are done getting the image data, use boot_request_upgrade()
to mark slot 1 as bootable on the next reset, then perform the reset
itself. We use sys_reboot(SYS_REBOOT_WARM) from <misc/reboot.h> for
that.


Would it be better to use the Non Volatile Storage subsystem to write
to the flash manually? Just start a thread that reads in from I2C/SPI
and writes to the correct place in flash?
The above description is how I would set that up. NVS is not relevant
to this. Nor is mcumgr (unless you want to implement an I2C or SPI
transport for that protocol). You'll need to dig around in the
menuconfig to enable these APIs.

Hope this helps,
Marti


Thanks,
Evan


1481 - 1500 of 2694