Date   

Re: [TCP/MQTT] Connection issue

lairdjm
 

Hi,

We actually encountered the same issue, not with this driver but with a different modem based upon this driver, from what I remember (it has been a long time since I last investigated) it seemed as if each reconnect incremented the memory address of the buffers so something wasn’t getting cleaned up, I didn’t look into if this was the networking stack or the driver however. This was on Zephyr 1.14, it was also using MQTT but not that specific sample.

Thanks,

Jamie

 

> I found where something is wrong.

> Indeed in net_context_get function, I saw that I reached CONFIG_NET_MAX_CONTEXTS (equal to 10 in my prj.conf).
> For your information, I use UBLOX sara r4 driver (on zephyr 1.14.1 as I mentionned in my previous mail) and I wonder if contexts are well managed in this revision, especially when socket is closed ?

 


Re: [TCP/MQTT] Connection issue

Michael Scott
 

Hello Guillaume,


On 12/11/19 11:19 AM, Guillaume Paquet wrote:
Hello Zephyr Community,

I found where something is wrong.
Indeed in net_context_get function, I saw that I reached CONFIG_NET_MAX_CONTEXTS (equal to 10 in my prj.conf).
For your information, I use UBLOX sara r4 driver (on zephyr 1.14.1 as I mentionned in my previous mail) and I wonder if contexts are well managed in this revision, especially when socket is closed ?

There could certainly be a bug in the socket offloading layer for UBLOX Sara R4 (I'm the maintainer for the current modem layer in Zephyr):
https://github.com/zephyrproject-rtos/zephyr/blob/master/drivers/modem/ublox-sara-r4.c


Can you open an issue here:

https://github.com/zephyrproject-rtos/zephyr/issues


Please include as much information as you can (from this email series):
- Zephyr version: 1.14.1

- Sample used: samples/net/mqtt_publisher

- Firmware version on SARA R4 modem

- etc


And add me as "Assignee"


Thanks!


- Mike



Thanks in advance for your help

Best Regards,

Guillaume

De : devel@... <devel@...> de la part de Guillaume Paquet via Lists.Zephyrproject.Org <guillaume.paquet=stimio.fr@...>
Envoyé : mercredi 11 décembre 2019 16:24
À : Guillaume Paquet <guillaume.paquet@...>; devel@... <devel@...>
Cc : devel@... <devel@...>
Objet : Re: [Zephyr-devel] [TCP/MQTT] Connection issue
 

And just to add some precision, I work on zephyr 1.14.1.

 

Rgds

 

Guillaume

 

De : devel@... <devel@...> De la part de Guillaume Paquet via Lists.Zephyrproject.Org
Envoyé : mercredi 11 décembre 2019 13:50
À : devel@...
Cc : devel@...
Objet : [Zephyr-devel] [TCP/MQTT] Connection issue

 

Hello Zephyr community,

 

I contact you because I have an issue when I run mqtt_publisher example

https://docs.zephyrproject.org/1.13.0/samples/net/mqtt_publisher/README.html

 

I have the following issue when I have multiple mqtt connection/disconnection (through tcp transport_connect function)

[try_to_connect:233] mqtt_connect: -2 <ERROR>

 

I have this issue after 10 connection/disconnection. The eleventh one is always failing.

As I said you I saw that this is failing when I try to run mqtt_transport_connect(client); in client_connect.

 

My configuration is the following one :

  • MQTT (not secured)
  • TCP/IPv4
  • Broker on external server (not any issue on this one)

 

If you have any idea to help me

 

Thanks in advance

 

Best Regards

 

Guillaume

 

   www.stimio.fr

Guillaume  PAQUET – IoT Engineer

guillaume.paquet@...  -  02 40 18 50 91

1 Avenue Professeur Jean Rouxel – ZAC Fleuriaye

44470 CARQUEFOU – FRANCE                

 

-- 
Michael Scott
Embedded Software Engineer at Foundries.io
"microPlatforms™ for Connected Products"
E: mike@...
W: https://www.foundries.io


Re: [TCP/MQTT] Connection issue

Guillaume Paquet
 

Hello Zephyr Community,

I found where something is wrong.
Indeed in net_context_get function, I saw that I reached CONFIG_NET_MAX_CONTEXTS (equal to 10 in my prj.conf).
For your information, I use UBLOX sara r4 driver (on zephyr 1.14.1 as I mentionned in my previous mail) and I wonder if contexts are well managed in this revision, especially when socket is closed ? 

Thanks in advance for your help

Best Regards,

Guillaume

De : devel@... <devel@...> de la part de Guillaume Paquet via Lists.Zephyrproject.Org <guillaume.paquet=stimio.fr@...>
Envoyé : mercredi 11 décembre 2019 16:24
À : Guillaume Paquet <guillaume.paquet@...>; devel@... <devel@...>
Cc : devel@... <devel@...>
Objet : Re: [Zephyr-devel] [TCP/MQTT] Connection issue
 

And just to add some precision, I work on zephyr 1.14.1.

 

Rgds

 

Guillaume

 

De : devel@... <devel@...> De la part de Guillaume Paquet via Lists.Zephyrproject.Org
Envoyé : mercredi 11 décembre 2019 13:50
À : devel@...
Cc : devel@...
Objet : [Zephyr-devel] [TCP/MQTT] Connection issue

 

Hello Zephyr community,

 

I contact you because I have an issue when I run mqtt_publisher example

https://docs.zephyrproject.org/1.13.0/samples/net/mqtt_publisher/README.html

 

I have the following issue when I have multiple mqtt connection/disconnection (through tcp transport_connect function)

[try_to_connect:233] mqtt_connect: -2 <ERROR>

 

I have this issue after 10 connection/disconnection. The eleventh one is always failing.

As I said you I saw that this is failing when I try to run mqtt_transport_connect(client); in client_connect.

 

My configuration is the following one :

  • MQTT (not secured)
  • TCP/IPv4
  • Broker on external server (not any issue on this one)

 

If you have any idea to help me

 

Thanks in advance

 

Best Regards

 

Guillaume

 

   www.stimio.fr

Guillaume  PAQUET – IoT Engineer

guillaume.paquet@...  -  02 40 18 50 91

1 Avenue Professeur Jean Rouxel – ZAC Fleuriaye

44470 CARQUEFOU – FRANCE                

 


Re: [TCP/MQTT] Connection issue

Guillaume Paquet
 

And just to add some precision, I work on zephyr 1.14.1.

 

Rgds

 

Guillaume

 

De : devel@... <devel@...> De la part de Guillaume Paquet via Lists.Zephyrproject.Org
Envoyé : mercredi 11 décembre 2019 13:50
À : devel@...
Cc : devel@...
Objet : [Zephyr-devel] [TCP/MQTT] Connection issue

 

Hello Zephyr community,

 

I contact you because I have an issue when I run mqtt_publisher example

https://docs.zephyrproject.org/1.13.0/samples/net/mqtt_publisher/README.html

 

I have the following issue when I have multiple mqtt connection/disconnection (through tcp transport_connect function)

[try_to_connect:233] mqtt_connect: -2 <ERROR>

 

I have this issue after 10 connection/disconnection. The eleventh one is always failing.

As I said you I saw that this is failing when I try to run mqtt_transport_connect(client); in client_connect.

 

My configuration is the following one :

  • MQTT (not secured)
  • TCP/IPv4
  • Broker on external server (not any issue on this one)

 

If you have any idea to help me

 

Thanks in advance

 

Best Regards

 

Guillaume

 

   www.stimio.fr

Guillaume  PAQUET – IoT Engineer

guillaume.paquet@...  -  02 40 18 50 91

1 Avenue Professeur Jean Rouxel – ZAC Fleuriaye

44470 CARQUEFOU – FRANCE                

 


[TCP/MQTT] Connection issue

Guillaume Paquet
 

Hello Zephyr community,

 

I contact you because I have an issue when I run mqtt_publisher example

https://docs.zephyrproject.org/1.13.0/samples/net/mqtt_publisher/README.html

 

I have the following issue when I have multiple mqtt connection/disconnection (through tcp transport_connect function)

[try_to_connect:233] mqtt_connect: -2 <ERROR>

 

I have this issue after 10 connection/disconnection. The eleventh one is always failing.

As I said you I saw that this is failing when I try to run mqtt_transport_connect(client); in client_connect.

 

My configuration is the following one :

  • MQTT (not secured)
  • TCP/IPv4
  • Broker on external server (not any issue on this one)

 

If you have any idea to help me

 

Thanks in advance

 

Best Regards

 

Guillaume

 

   www.stimio.fr

Guillaume  PAQUET – IoT Engineer

guillaume.paquet@...  -  02 40 18 50 91

1 Avenue Professeur Jean Rouxel – ZAC Fleuriaye

44470 CARQUEFOU – FRANCE                

 


Re: Managing/structuring multi image/binary projects for (OTA updatable products etc)

Sebastian Boe
 

See https://github.com/zephyrproject-rtos/zephyr/pull/13672#issuecomment-550203475

________________________________________
From: Marc Reilly <marc.reilly@gmail.com>
Sent: Tuesday, December 10, 2019 5:58 PM
To: Bøe, Sebastian
Cc: Bolivar, Marti; devel@lists.zephyrproject.org
Subject: Re: [Zephyr-devel] Managing/structuring multi image/binary projects for (OTA updatable products etc)


Hi,

The multi-image approach in NCS will not make it's way into mainline Zephyr because
it was not accepted upstream unfortunately.

Is there some record of the rationale behind this? (eg PR #).
I'm wondering that if its rejected from mainline zephyr for reasons like 'out of scope' etc then maybe there is some existing consensus for alternative ways - or if it was due to lack of demand then maybe that can be reappraised... But that's a lot of "maybes" and "wonderings".

Thanks again!

Cheers
Marc


Re: Managing/structuring multi image/binary projects for (OTA updatable products etc)

Marc Reilly
 


Hi,

The multi-image approach in NCS will not make it's way into mainline Zephyr because
it was not accepted upstream unfortunately.

Is there some record of the rationale behind this? (eg PR #).
I'm wondering that if its rejected from mainline zephyr for reasons like 'out of scope' etc then maybe there is some existing consensus for alternative ways - or if it was due to lack of demand then maybe that can be reappraised... But that's a lot of "maybes" and "wonderings".

Thanks again!

Cheers
Marc



 


Upcoming Event: Zephyr Project: APIs - Tue, 12/10/2019 9:00am-10:00am, Please RSVP #cal-reminder

devel@lists.zephyrproject.org Calendar <devel@...>
 

Reminder: Zephyr Project: APIs

When: Tuesday, 10 December 2019, 9:00am to 10:00am, (GMT-08:00) America/Los Angeles

Where:https://zoom.us/j/177647878

An RSVP is requested. Click here to RSVP

Organizer: devel@...

Description: Join from PC, Mac, Linux, iOS or Android: https://zoom.us/j/177647878

Or iPhone one-tap :
    US: +16465588656,,177647878# or +16699006833,,177647878# 
Or Telephone:
    Dial(for higher quality, dial a number based on your current location): 
        US: +1 646 558 8656 or +1 669 900 6833 or +1 855 880 1246 (Toll Free) or +1 877 369 0926 (Toll Free)
    Meeting ID: 177 647 878
    International numbers available: https://zoom.us/zoomconference?m=ioAR9GK1OE5LkN1ojt-heTCl7yPcJrhY


 Live meeting minutes: https://docs.google.com/document/d/1lv-8B5QE2m4FjBcvfqAXFIgQfW5oz6306zJ7GIZIWCk/edit?usp=sharing


Re: Managing/structuring multi image/binary projects for (OTA updatable products etc)

Sebastian Boe
 

The multi-image approach in NCS will not make it's way into mainline Zephyr because
it was not accepted upstream unfortunately.

________________________________________
From: Marc Reilly <marc.reilly@gmail.com>
Sent: Tuesday, December 10, 2019 4:25 PM
To: Bolivar, Marti
Cc: Bøe, Sebastian; devel@lists.zephyrproject.org
Subject: Re: [Zephyr-devel] Managing/structuring multi image/binary projects for (OTA updatable products etc)

Hi Marti, Sebastian, list

Thanks for the ideas, my replies are inline below.


Hi, I see you are using nrf.

Signing, building, and hex merging of multiple images in a single west command is supported
out-of-the box with the nRF Connect SDK, which uses a patched Zephyr.

This led me to find the "multiple images" documentation for the NCS Zephyr (https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/application/index.html#building-and-configuring-multiple-images) ...


So if not using vanilla Zephyr is an option then see:

https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/nrf9160/http_application_update/README.html#http-application-update-sample
https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_multi_image.html
I second Sebastian's suggestion to look at nRF Connect SDK (NCS).
It has useful features for building OTA binaries for nRF devices.


.. it looks like the NCS capabilities will do what I wanted with regard to building a bootloader + app in one go. I haven't had time to look at it properly, but it seems like the strategy is to make the bootloader an extra output of the primary 'app' project (ie extra targets in the app project cmake).
This is a different approach than what I was thinking of. I was envisaging that the bootloader and app were treated as more isolated projects, and were configured and glued together by another higher level _something_.

Traditionally, I tend away from relying too much on vendor 'BSP's for the long term, they've tend to stagnate or diverge too much from mainline as time goes on.

Does anyone know if there are any plans to bring NCS's 'multi-image' functionality into mainline zephyr?

--snip--


-----

West seems like the ideal tool to use for this, it boils down to a manifest repo (for project & dependencies checkout), and then a series of commands to build the various artifacts and merge & sign them. For example:

west init -m git@gitlab.com:SomeManifestRepo.git
west build --board=theboard -d build-mcuboot -s mcuboot/boot/zephyr -- -DBOARD_ROOT=/abs/path/to/app
west build --board=theboard -d build-app -s app -- -DBOARD_ROOT=/abs/path/to/app
west sign ...

However, it would be nice to be able to glue this all together with
some script etc to simplify the extra elements of the west commands
('theboard' 'BOARD_ROOT') etc.
No matter what you choose to use (mainline or NCS), though, you can
always tell 'west build' your default board like this:

west config build.board theboard

https://docs.zephyrproject.org/latest/guides/west/build-flash-debug.html#configuration-options

The build.board value will be used if you don't provide --board
(provided BOARD is also unset in the calling environment).


This is useful to know, thanks !


I thought about your BOARD_ROOT question. I've gotten other similar
requests recently, and I agree it would be useful, so I've proposed a
new "build.cmake-args" config option:

https://github.com/zephyrproject-rtos/zephyr/pull/21251

With the patch from #21251, you can save your BOARD_ROOT like this:

west config build.cmake-args -- -DBOARD_ROOT=/abs/path/to/app

Your one-time setup work would then be:

west init -m git@gitlab.com/SomeManifestRepo.git<http://git@gitlab.com/SomeManifestRepo.git>
west update
west config build.board theboard
west config build.cmake-args -- -DBOARD_ROOT=/abs/path/to/app

Note that plain 'west config var val' sets configuration options locally
(just for your west installation). See the --global and --system options
in the 'west config' documentation for alternatives.

# build and flash
west build -d build-mcuboot -s mcuboot/boot/zephyr
west build -d build-app -s app
west sign ...

And here is where I become unsure of how this glue script/(c)makefile/etc fits into the topology of the project.. The natural place for the script to run from is the west installation folder itself (ie, the parent folder of all the subprojects) however the natural place for it to 'live' is in the 'manifest-repo'.

Alternatives:
- copy 'glue' script into west installation folder ?
- west commands ? in the manifest repo, or maybe another common lib etc.
I hope the above is what you're looking for.


I think what I was envisaging was something to glue together the above commands (and keep some separation between the specific 'app' and the bootloader), I thought this would be 'west', but maybe not.. to take this approach would mean having to invoke the build/sign/whatever commands from the 'west installation' folder, and it would only be available from the manifest repo folder.


Note 'west build' can only compile one Zephyr application at a time.
The NCS can build application and mcuboot binaries at once out of the
box, for reference.

Please test and comment in the PR if you get a chance.

Done!, thanks.

Cheers
Marc


Re: Why the default MAC address is not shown in the host when using hciconfig command in linux #hci #ble #nrf52 #nrf52840

Johan Hedberg
 

Hi Venkatesh,

On 10. Dec 2019, at 15.18, Venkatesh Dyagala <venkatesh.dyagala@ivativ.com> wrote:
Now when we insert into linux PC and when i check the device using the hciconfig command the MAC address of the dongle is 00:00:00:00:00:00
But when we used bluetoothctl show command a 6byte MAC address is shown.
hciconfig uses a legacy ioctl kernel interface which is only able to retrieve the public address of a controller. nRF controllers do not come with any public address by default, which is why you only see zeroes. What controllers do need is an identity address, and that can be either a public address or a static random address. It’s the latter that gets automatically set by bluetoothd and what bluetoothctl shows you. bluetoothctl is a D-Bus client that simply shows the “Address” property of the Adapter object. That needs to be combined with the “AddressType” property to know that type of address it is (in your case it would be “random”).

Johan


Re: Managing/structuring multi image/binary projects for (OTA updatable products etc)

Marc Reilly
 

Hi Marti, Sebastian, list

Thanks for the ideas, my replies are inline below.


> Hi, I see you are using nrf.
>
> Signing, building, and hex merging of multiple images in a single west command is supported
> out-of-the box with the nRF Connect SDK, which uses a patched Zephyr.



 
> So if not using vanilla Zephyr is an option then see:
>
> https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/nrf9160/http_application_update/README.html#http-application-update-sample
> https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_multi_image.html

I second Sebastian's suggestion to look at nRF Connect SDK (NCS).
It has useful features for building OTA binaries for nRF devices.


 .. it looks like the NCS capabilities will do what I wanted with regard to building a bootloader + app in one go. I haven't had time to look at it properly, but it seems like the strategy is to make the bootloader an extra output of the primary 'app' project (ie extra targets in the app project cmake).
This is a different approach than what I was thinking of. I was envisaging that the bootloader and app were treated as more isolated projects, and were configured and glued together by another higher level _something_.

Traditionally, I tend away from relying too much on vendor 'BSP's for the long term, they've tend to stagnate or diverge too much from mainline as time goes on.
 
Does anyone know if there are any plans to bring NCS's 'multi-image' functionality into mainline zephyr?

--snip--


> -----
>
> West seems like the ideal tool to use for this, it boils down to a manifest repo (for project & dependencies checkout), and then a series of commands to build the various artifacts and merge & sign them. For example:
>
> west init -m git@...:SomeManifestRepo.git
> west build --board=theboard -d build-mcuboot -s mcuboot/boot/zephyr -- -DBOARD_ROOT=/abs/path/to/app
> west build --board=theboard -d build-app -s app -- -DBOARD_ROOT=/abs/path/to/app
> west sign ...
>
> However, it would be nice to be able to glue this all together with
> some script etc to simplify the extra elements of the west commands
> ('theboard' 'BOARD_ROOT') etc.

No matter what you choose to use (mainline or NCS), though, you can
always tell 'west build' your default board like this:

  west config build.board theboard

https://docs.zephyrproject.org/latest/guides/west/build-flash-debug.html#configuration-options

The build.board value will be used if you don't provide --board
(provided BOARD is also unset in the calling environment).
 

This is useful to know, thanks !

 
I thought about your BOARD_ROOT question. I've gotten other similar
requests recently, and I agree it would be useful, so I've proposed a
new "build.cmake-args" config option:

  https://github.com/zephyrproject-rtos/zephyr/pull/21251

With the patch from #21251, you can save your BOARD_ROOT like this:

  west config build.cmake-args -- -DBOARD_ROOT=/abs/path/to/app

Your one-time setup work would then be:

  west init -m git@.../SomeManifestRepo.git
  west update
  west config build.board theboard
  west config build.cmake-args -- -DBOARD_ROOT=/abs/path/to/app

Note that plain 'west config var val' sets configuration options locally
(just for your west installation). See the --global and --system options
in the 'west config' documentation for alternatives.

  # build and flash
  west build -d build-mcuboot -s mcuboot/boot/zephyr
  west build -d build-app -s app
  west sign ...

> And here is where I become unsure of how this glue script/(c)makefile/etc fits into the topology of the project.. The natural place for the script to run from is the west installation folder itself (ie, the parent folder of all the subprojects) however the natural place for it to 'live' is in the 'manifest-repo'.
>
> Alternatives:
>  - copy 'glue' script into west installation folder ?
>  - west commands ? in the manifest repo, or maybe another common lib etc.

I hope the above is what you're looking for.


I think what I was envisaging was something to glue together the above commands (and keep some separation between the specific 'app' and the bootloader), I thought this would be 'west', but maybe not.. to take this approach would mean having to invoke the build/sign/whatever commands from the 'west installation' folder, and it would only be available from the manifest repo folder.
 

Note 'west build' can only compile one Zephyr application at a time.
The NCS can build application and mcuboot binaries at once out of the
box, for reference.

Please test and comment in the PR if you get a chance.

Done!, thanks.
 
Cheers
Marc


API meeting: Agenda

Carles Cufi
 

Hi all,

This week we will focus on API Changes and GPIO:

- Changing a stable API:
- https://github.com/zephyrproject-rtos/zephyr/pull/21013

- GPIO: Update on progress
- Look at the PRs with driver conversion (https://github.com/zephyrproject-rtos/zephyr/issues/18530)
- Check users of GPIO APIs: https://github.com/zephyrproject-rtos/zephyr/issues/20017
- Tips for converting users can be found here: https://github.com/zephyrproject-rtos/zephyr/issues/20017#issuecomment-549315497 (thanks Peter!)
- Any additional outstanding PRs to topic-gpio

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


Why the default MAC address is not shown in the host when using hciconfig command in linux #hci #ble #nrf52 #nrf52840

Venkatesh Dyagala
 

Hi,
We are willing to do the LE USB controller with the nrf52840 dongle
By looking into this case https://devzone.nordicsemi.com/f/nordic-q-a/46036/mac-address-ranges. I came to know that there will be random address loaded into the device in production of nrf52840 Dongle.
 
Then Make that as a controller followed this https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/nrf5x-support-within-the-zephyr-project-rtos and  https://docs.zephyrproject.org/latest/getting_started/index.html to compile and build an hex file. The respective build is done for the hci_usb.
 
The build is done and loaded to the dongle using nrfutil.
 
Now when we insert into linux PC and when i check the device using the hciconfig command the MAC address of the dongle is 00:00:00:00:00:00
But when we used bluetoothctl show command a 6byte MAC address is shown.
 
 
 
I can change the MAC address manually using hcitool commands. But my question is that
 
1-->The nordic assigned MAC address in production for every device. Why that MAC address cannot be seen when the dongle is acting as a controller. Why its showing all zeros ?
 
2--> The bluetoothctl is showing the MAC address of the device But it cannot be updated in the hciconfig ?
 
3--> If we have a MAC how we can burn it into the flash what was the memory locations ?
 
4--> The MAC that we seen using bluetoothctl show is zepher hardcoded ?
 
 

--

Thanks,
venkatesh


Re: Managing/structuring multi image/binary projects for (OTA updatable products etc)

Jan Kloetzke <jan@...>
 

Hi Marc,

On Mon, Dec 09, 2019 at 07:38:53AM -0800, Marc Reilly wrote:
Hi all,

I've been looking at making product(s) which can do OTA updates, and
how to structure the overall project.
A basic aim is to be able to checkout and build (assuming toolchain
and environment is setup) with minimal commands, and also minimal
manual 'configuration' changes required for a default build.
I'm not really feeling like I'm seeing a nice solution, so was
wondering if anyone else has overcome a similar situation, or anyone
has any ideas to progress.

Following, I've tried to summarize the problem & design as I see it to
make sure I'm on the right track, and then I've got a few example
commands to further illustrate where the problem is for me.

Any and all suggestions welcome.
We faced similar problems when we had to make an IVI system that uses
bare metal + FreeRTOS + Linux in one SoC and requires a consistent build
for all of them. In the end we created our own meta-tool:

https://bobbuildtool.dev/

Now, Zephyr already came up with the west tool which solves some of the
problems and drives many Zephyr use cases better than Bob could at the
moment. Nonetheless I created some demo recipes a couple of weeks ago to
show how a multi-application-build could look like:

https://github.com/jkloetzke/zephyr-example-recipes

Now, I'm perfectly aware that it creates another layer of complexity.
The recipes effectively replace west to drive the build. But Bob is
meant to solve many other problems too that are constantly coming up
with such more-than-one-image embedded systems: variants management,
reliable incremental building, reproducibility, toolchain setup, Jenkins
integration and automatic artifact caching. Also building and running
unit tests from the same sources on the host in one command was a
requirement for us. The goal is to always execute just one build
command:

$ git clone <project>
$ cd <project>
$ bob build <image>

and start working from there on:

... hack on the source ...
bob build <image>
bob build <unit-tests>
git commit/push/pull
... repeat ...

We're currently expanding the public-visible recipes. There is another
example which shows how FreeRTOS and Linux share some code are built
together as AMP system:

https://github.com/BobBuildTool/bob-example-embedded

If your product stays in the nRF+mcuboot+zephyr world then sticking to
the nRF Connect SDK may be easier. Otherwise Bob might be worth a look
IMHO.

Regards,
Jan


Cheers,
Marc

-----

Overview:
The product acheives OTA updates, at a general level, by:
- use mcuboot as the bootloader
- app implements SMP service (eg mcumgr/smp_svr example)
- initially program the product with a combination of the mcuboot + app
- further updates can be done OTA, the app handles transmission and copying of the new firmware image to a partition on flash, then resets. the bootloader checks the new firmware image does some partition 'accounting' and then boots the new image.

Typical project elements/dependencies:
- app for the product/device
- board files are defined in the 'app' repo
- common libs (eg for our GATT services which most our devices have)
- zephyr framework
- dependent modules (eg nordic_hal, segger)
- mcuboot
- (references the app board file)

This resembles either the T2 or T3 of west's documented tolopogies. [https://docs.zephyrproject.org/latest/guides/west/repo-tool.html#topologies-supported]

Build:
- We want 2 primary build artifacts:
- the app (configured as launched from a bootloader)
- bootloader mcuboot
- And then from this with can run a variety of commands to merge and/or sign the build artifacts.
- As a bonus, perhaps another app configuration to make dev/debug easier where the bootloader is not used.

-----

West seems like the ideal tool to use for this, it boils down to a manifest repo (for project & dependencies checkout), and then a series of commands to build the various artifacts and merge & sign them. For example:

west init -m git@gitlab.com:SomeManifestRepo.git
west build --board=theboard -d build-mcuboot -s mcuboot/boot/zephyr -- -DBOARD_ROOT=/abs/path/to/app
west build --board=theboard -d build-app -s app -- -DBOARD_ROOT=/abs/path/to/app
west sign ...

However, it would be nice to be able to glue this all together with some script etc to simplify the extra elements of the west commands ('theboard' 'BOARD_ROOT') etc. And here is where I become unsure of how this glue script/(c)makefile/etc fits into the topology of the project.. The natural place for the script to run from is the west installation folder itself (ie, the parent folder of all the subprojects) however the natural place for it to 'live' is in the 'manifest-repo'.

Alternatives:
- copy 'glue' script into west installation folder ?
- west commands ? in the manifest repo, or maybe another common lib etc.



Re: Firmware upgrade of hci_uart app by using bootloader in serial recovery mode #ble #hci #nrf52480 #uart

Bolivar, Marti
 

Hi Mayank,

I am surprised to say this doesn't appear to be covered in the MCUboot
documentation.

David, did I miss it somewhere?

Mayank: you need at least three pins connecting the i.MX and nRF chips:

- UART TX
- UART RX
- a "serial detect" GPIO

The i.MX chip also needs to be able to reset the nRF chip, e.g. with
another i.MX GPIO connected to the nRF reset pin.

(If you have already manufactured your PCB and don't have those required
features, then you're out of luck, I'm afraid. You'll have to use
something like the smp_svr app.)

You need to customize your MCUboot build for your board so the
bootloader reads your serial detect pin at reset and drops into serial
recovery mode if it is asserted. The mcumgr serial protocol is used to
do the update itself.

Assuming the mcuboot kconfig help is still accurate, you need to set
your MCUboot Kconfig knobs roughly like so:

CONFIG_MCUBOOT_SERIAL=y
CONFIG_BOOT_SERIAL_UART=y
CONFIG_BOOT_SERIAL_DETECT_PORT="GPIO_0" # or GPIO_1 if your pin is on that port
CONFIG_BOOT_SERIAL_DETECT_PIN=<your-custom-board's-serial-detect-pin-number>
CONFIG_BOOT_SERIAL_DETECT_PIN_VAL=<your-serial-detect-pin's-assert-logic-level>

Also make sure your zephyr,console chosen node in devicetree is the
nRF52840 UART you want to use, and that its TX/RX pins are set correctly
in DT as well.

Once configured in this way, you need to build and reflash MCUboot on the nRF.

On the i.MX side, to do an update, you need to do something like this:

1. assert the serial detect pin
2. reset the nRF SoC
3. use the mcumgr serial transport protocol to upload an update
firmware image
4. deassert the serial detect pin (this just needs to happen sometime
after mcuboot has read it out of reset)
5. use mcumgr to reset the nRF with serial detect deasserted,
to boot into the new image

You may find the west build + west sign + mcumgr command lines on this
page helpful:

https://docs.zephyrproject.org/latest/boards/arm/nrf52840_pca10059/doc/index.html#option-2-using-mcuboot-in-serial-recovery-mode

If you are running Linux and can get golang programs running on the
i.MX, you should be able to get mcumgr running and adapt the 'mcumgr ...
image upload' and 'mcumgr ... reset' lines from there.

Hope this helps!

"Mayank via Lists.Zephyrproject.Org"
<mayank7117=gmail.com@lists.zephyrproject.org> writes:

Hello,

I have nrf52840_pca10056 chip connected to imx6ul processor via uart (Both are embedded on my custom board) as shown in attached image.
I'm using mcuboot bootloader on nrf52840 chip, now i want to flash hci_uart app over UART by keeping mcuboot in serial recovery mode.

NOTE: I do not want to go with other way of upgrading the firmware (Using smp_svr application).

Q: So what i need to do to upgrade the firmware using bootloader's serial recovery mode ?

(I do not have any physical access to the pin for nrf52840 chip).


Re: Managing/structuring multi image/binary projects for (OTA updatable products etc)

Bolivar, Marti
 

Sorry for the double-post, but I realized that the latter half of my
inline responses might be easy to ignore, so I'm going to hang a lantern
on them with this email:

"Bolivar, Marti via Lists.Zephyrproject.Org"
<marti.bolivar=nordicsemi.no@lists.zephyrproject.org> writes:
From: devel@lists.zephyrproject.org <devel@lists.zephyrproject.org> on behalf of Marc Reilly via Lists.Zephyrproject.Org <marc.reilly=gmail.com@lists.zephyrproject.org>
However, it would be nice to be able to glue this all together with
some script etc to simplify the extra elements of the west commands
('theboard' 'BOARD_ROOT') etc.
No matter what you choose to use (mainline or NCS), though, you can
always tell 'west build' your default board like this:

west config build.board theboard

https://docs.zephyrproject.org/latest/guides/west/build-flash-debug.html#configuration-options

The build.board value will be used if you don't provide --board
(provided BOARD is also unset in the calling environment).

I thought about your BOARD_ROOT question. I've gotten other similar
requests recently, and I agree it would be useful, so I've proposed a
new "build.cmake-args" config option:

https://github.com/zephyrproject-rtos/zephyr/pull/21251

With the patch from #21251, you can save your BOARD_ROOT like this:

west config build.cmake-args -- -DBOARD_ROOT=/abs/path/to/app

Your one-time setup work would then be:

west init -m git@gitlab.com/SomeManifestRepo.git
west update
west config build.board theboard
west config build.cmake-args -- -DBOARD_ROOT=/abs/path/to/app

Note that plain 'west config var val' sets configuration options locally
(just for your west installation). See the --global and --system options
in the 'west config' documentation for alternatives.

# build and flash
west build -d build-mcuboot -s mcuboot/boot/zephyr
west build -d build-app -s app
west sign ...
Please make sure you see this part ^^.

Martí


Re: Managing/structuring multi image/binary projects for (OTA updatable products etc)

Bolivar, Marti
 

Hello Marc,

"Sebastian Boe via Lists.Zephyrproject.Org"
<Sebastian.Boe=nordicsemi.no@lists.zephyrproject.org> writes:

Hi, I see you are using nrf.

Signing, building, and hex merging of multiple images in a single west command is supported
out-of-the box with the nRF Connect SDK, which uses a patched Zephyr.

So if not using vanilla Zephyr is an option then see:

https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/nrf9160/http_application_update/README.html#http-application-update-sample
https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_multi_image.html
I second Sebastian's suggestion to look at nRF Connect SDK (NCS).
It has useful features for building OTA binaries for nRF devices.


________________________________________
From: devel@lists.zephyrproject.org <devel@lists.zephyrproject.org> on behalf of Marc Reilly via Lists.Zephyrproject.Org <marc.reilly=gmail.com@lists.zephyrproject.org>
Sent: Monday, December 9, 2019 4:38 PM
To: devel@lists.zephyrproject.org
Cc: devel@lists.zephyrproject.org
Subject: [Zephyr-devel] Managing/structuring multi image/binary projects for (OTA updatable products etc)

Hi all,

I've been looking at making product(s) which can do OTA updates, and how to structure the overall project.
A basic aim is to be able to checkout and build (assuming toolchain and environment is setup) with minimal commands, and also minimal manual 'configuration' changes required for a default build.
I'm not really feeling like I'm seeing a nice solution, so was wondering if anyone else has overcome a similar situation, or anyone has any ideas to progress.

Following, I've tried to summarize the problem & design as I see it to make sure I'm on the right track, and then I've got a few example commands to further illustrate where the problem is for me.

Any and all suggestions welcome.

Cheers,
Marc

-----

Overview:
The product acheives OTA updates, at a general level, by:
- use mcuboot as the bootloader
- app implements SMP service (eg mcumgr/smp_svr example)
- initially program the product with a combination of the mcuboot + app
- further updates can be done OTA, the app handles transmission and copying of the new firmware image to a partition on flash, then resets. the bootloader checks the new firmware image does some partition 'accounting' and then boots the new image.

Typical project elements/dependencies:
- app for the product/device
- board files are defined in the 'app' repo
- common libs (eg for our GATT services which most our devices have)
- zephyr framework
- dependent modules (eg nordic_hal, segger)
- mcuboot
- (references the app board file)

This resembles either the T2 or T3 of west's documented tolopogies. [https://docs.zephyrproject.org/latest/guides/west/repo-tool.html#topologies-supported]

Build:
- We want 2 primary build artifacts:
- the app (configured as launched from a bootloader)
- bootloader mcuboot
- And then from this with can run a variety of commands to merge and/or sign the build artifacts.
- As a bonus, perhaps another app configuration to make dev/debug easier where the bootloader is not used.

-----

West seems like the ideal tool to use for this, it boils down to a manifest repo (for project & dependencies checkout), and then a series of commands to build the various artifacts and merge & sign them. For example:

west init -m git@gitlab.com:SomeManifestRepo.git
west build --board=theboard -d build-mcuboot -s mcuboot/boot/zephyr -- -DBOARD_ROOT=/abs/path/to/app
west build --board=theboard -d build-app -s app -- -DBOARD_ROOT=/abs/path/to/app
west sign ...

However, it would be nice to be able to glue this all together with
some script etc to simplify the extra elements of the west commands
('theboard' 'BOARD_ROOT') etc.
No matter what you choose to use (mainline or NCS), though, you can
always tell 'west build' your default board like this:

west config build.board theboard

https://docs.zephyrproject.org/latest/guides/west/build-flash-debug.html#configuration-options

The build.board value will be used if you don't provide --board
(provided BOARD is also unset in the calling environment).

I thought about your BOARD_ROOT question. I've gotten other similar
requests recently, and I agree it would be useful, so I've proposed a
new "build.cmake-args" config option:

https://github.com/zephyrproject-rtos/zephyr/pull/21251

With the patch from #21251, you can save your BOARD_ROOT like this:

west config build.cmake-args -- -DBOARD_ROOT=/abs/path/to/app

Your one-time setup work would then be:

west init -m git@gitlab.com/SomeManifestRepo.git
west update
west config build.board theboard
west config build.cmake-args -- -DBOARD_ROOT=/abs/path/to/app

Note that plain 'west config var val' sets configuration options locally
(just for your west installation). See the --global and --system options
in the 'west config' documentation for alternatives.

# build and flash
west build -d build-mcuboot -s mcuboot/boot/zephyr
west build -d build-app -s app
west sign ...

And here is where I become unsure of how this glue script/(c)makefile/etc fits into the topology of the project.. The natural place for the script to run from is the west installation folder itself (ie, the parent folder of all the subprojects) however the natural place for it to 'live' is in the 'manifest-repo'.

Alternatives:
- copy 'glue' script into west installation folder ?
- west commands ? in the manifest repo, or maybe another common lib etc.
I hope the above is what you're looking for.

Note 'west build' can only compile one Zephyr application at a time.
The NCS can build application and mcuboot binaries at once out of the
box, for reference.

Please test and comment in the PR if you get a chance.

Thanks,
Martí





Re: Managing/structuring multi image/binary projects for (OTA updatable products etc)

Sebastian Boe
 

Hi, I see you are using nrf.

Signing, building, and hex merging of multiple images in a single west command is supported
out-of-the box with the nRF Connect SDK, which uses a patched Zephyr.

So if not using vanilla Zephyr is an option then see:

https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/nrf9160/http_application_update/README.html#http-application-update-sample
https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_multi_image.html

________________________________________
From: devel@lists.zephyrproject.org <devel@lists.zephyrproject.org> on behalf of Marc Reilly via Lists.Zephyrproject.Org <marc.reilly=gmail.com@lists.zephyrproject.org>
Sent: Monday, December 9, 2019 4:38 PM
To: devel@lists.zephyrproject.org
Cc: devel@lists.zephyrproject.org
Subject: [Zephyr-devel] Managing/structuring multi image/binary projects for (OTA updatable products etc)

Hi all,

I've been looking at making product(s) which can do OTA updates, and how to structure the overall project.
A basic aim is to be able to checkout and build (assuming toolchain and environment is setup) with minimal commands, and also minimal manual 'configuration' changes required for a default build.
I'm not really feeling like I'm seeing a nice solution, so was wondering if anyone else has overcome a similar situation, or anyone has any ideas to progress.

Following, I've tried to summarize the problem & design as I see it to make sure I'm on the right track, and then I've got a few example commands to further illustrate where the problem is for me.

Any and all suggestions welcome.

Cheers,
Marc

-----

Overview:
The product acheives OTA updates, at a general level, by:
- use mcuboot as the bootloader
- app implements SMP service (eg mcumgr/smp_svr example)
- initially program the product with a combination of the mcuboot + app
- further updates can be done OTA, the app handles transmission and copying of the new firmware image to a partition on flash, then resets. the bootloader checks the new firmware image does some partition 'accounting' and then boots the new image.

Typical project elements/dependencies:
- app for the product/device
- board files are defined in the 'app' repo
- common libs (eg for our GATT services which most our devices have)
- zephyr framework
- dependent modules (eg nordic_hal, segger)
- mcuboot
- (references the app board file)

This resembles either the T2 or T3 of west's documented tolopogies. [https://docs.zephyrproject.org/latest/guides/west/repo-tool.html#topologies-supported]

Build:
- We want 2 primary build artifacts:
- the app (configured as launched from a bootloader)
- bootloader mcuboot
- And then from this with can run a variety of commands to merge and/or sign the build artifacts.
- As a bonus, perhaps another app configuration to make dev/debug easier where the bootloader is not used.

-----

West seems like the ideal tool to use for this, it boils down to a manifest repo (for project & dependencies checkout), and then a series of commands to build the various artifacts and merge & sign them. For example:

west init -m git@gitlab.com:SomeManifestRepo.git
west build --board=theboard -d build-mcuboot -s mcuboot/boot/zephyr -- -DBOARD_ROOT=/abs/path/to/app
west build --board=theboard -d build-app -s app -- -DBOARD_ROOT=/abs/path/to/app
west sign ...

However, it would be nice to be able to glue this all together with some script etc to simplify the extra elements of the west commands ('theboard' 'BOARD_ROOT') etc. And here is where I become unsure of how this glue script/(c)makefile/etc fits into the topology of the project.. The natural place for the script to run from is the west installation folder itself (ie, the parent folder of all the subprojects) however the natural place for it to 'live' is in the 'manifest-repo'.

Alternatives:
- copy 'glue' script into west installation folder ?
- west commands ? in the manifest repo, or maybe another common lib etc.


Managing/structuring multi image/binary projects for (OTA updatable products etc)

Marc Reilly
 

Hi all,

I've been looking at making product(s) which can do OTA updates, and how to structure the overall project.
A basic aim is to be able to checkout and build (assuming toolchain and environment is setup) with minimal commands, and also minimal manual 'configuration' changes required for a default build.
I'm not really feeling like I'm seeing a nice solution, so was wondering if anyone else has overcome a similar situation, or anyone has any ideas to progress.

Following, I've tried to summarize the problem & design as I see it to make sure I'm on the right track, and then I've got a few example commands to further illustrate where the problem is for me.

Any and all suggestions welcome.

Cheers,
Marc

-----

Overview:
The product acheives OTA updates, at a general level, by:
 - use mcuboot as the bootloader
 - app implements SMP service (eg mcumgr/smp_svr example)
 - initially program the product with a combination of the mcuboot + app
 - further updates can be done OTA, the app handles transmission and copying of the new firmware image to a partition on flash, then resets. the bootloader checks the new firmware image does some partition 'accounting' and then boots the new image.

Typical project elements/dependencies:
 - app for the product/device
  - board files are defined in the 'app' repo
 - common libs (eg for our GATT services which most our devices have)
 - zephyr framework
  - dependent modules (eg nordic_hal, segger)
 - mcuboot
  - (references the app board file)

This resembles either the T2 or T3 of west's documented tolopogies. [https://docs.zephyrproject.org/latest/guides/west/repo-tool.html#topologies-supported]

Build:
 - We want 2 primary build artifacts:
   - the app (configured as launched from a bootloader)
   - bootloader mcuboot
 - And then from this with can run a variety of commands to merge and/or sign the build artifacts.
 - As a bonus, perhaps another app configuration to make dev/debug easier where the bootloader is not used.

-----

West seems like the ideal tool to use for this, it boils down to a manifest repo (for project & dependencies checkout), and then a series of commands to build the various artifacts and merge & sign them. For example:

west init -m git@...:SomeManifestRepo.git
west build --board=theboard -d build-mcuboot -s mcuboot/boot/zephyr -- -DBOARD_ROOT=/abs/path/to/app
west build --board=theboard -d build-app -s app -- -DBOARD_ROOT=/abs/path/to/app
west sign ...

However, it would be nice to be able to glue this all together with some script etc to simplify the extra elements of the west commands ('theboard' 'BOARD_ROOT') etc. And here is where I become unsure of how this glue script/(c)makefile/etc fits into the topology of the project.. The natural place for the script to run from is the west installation folder itself (ie, the parent folder of all the subprojects) however the natural place for it to 'live' is in the 'manifest-repo'.

Alternatives:
 - copy 'glue' script into west installation folder ?
 - west commands ? in the manifest repo, or maybe another common lib etc.


Firmware upgrade of hci_uart app by using bootloader in serial recovery mode #ble #hci #nrf52480 #uart

Mayank <mayank7117@...>
 

Hello,

I have nrf52840_pca10056 chip connected to imx6ul processor via uart (Both are embedded on my custom board) as shown in attached image.
I'm using mcuboot bootloader on nrf52840 chip, now i want to flash hci_uart app over UART by keeping mcuboot in serial recovery mode.

NOTE: I do not want to go with other way of upgrading the firmware (Using smp_svr application).

Q: So what i need to do to upgrade the firmware using bootloader's serial recovery mode ?

(I do not have any physical access to the pin for nrf52840 chip).

1361 - 1380 of 7934