TheThingsIndustries / generic-node-se

Generic Node Sensor Edition
https://www.genericnode.com
Other
109 stars 31 forks source link

FW development platform #42

Closed elsalahy closed 3 years ago

elsalahy commented 4 years ago

Summary:

This issue is to discuss possible platforms and environments that we could investigate/develop around the ST node FW.

Actions will be taken based on this discussion and separate issues will be opened and linked to this issue.

elsalahy commented 4 years ago

Currently here is the landscape:

Tools/platforms provided by ST for the STM32WL chip

  1. Baremetal They provide everything as most MCU vendors do and this essentially includes:

    • An adapted LMN LW stack
    • Dual Bank LoRaWAN FUOTA
  2. FreeRTOS ST provides the MCU port layer which allows for basic functionality but most essentially no LW stack support or FUOTA.

They also might add Mbed OS support port layer similar to the FreeRTOS one with no LW stack support (not confirmed and there is no SW around it at all and can be long after the initial release)

Current FW development

What we can explore (proper analysis of advantages and disadvantages will follow in another comment)

We can use these platform in multiple ways:

  1. Adapt the stack to function in one or two threads and have the application layer in another one or two threads.
  2. Complete integration of the stack into the platforms similar to what Jan did with Mbed OS (not recommended due to maintenance cost)
  3. Wait for vendor/ enthusiasts to adapt any of the platforms and use the most useful port.
elsalahy commented 4 years ago

CC: @johanstokking and @wienke ^

azerimaker commented 4 years ago

Considering some of the feedbacks from our inner circle, especially Kris from Tlera Corp, having unofficial Arduino support would also be very appealing for some users. I think we should consider that too.

There's already a wrapper Arduino library and LoRaWAN stack available with bootloader function for the STM32L4 family and porting it to STM32WL would not be so hard. Even Lacuna guys also have the same approach. We can even ask our inner circle to port it for us.

elsalahy commented 4 years ago

I think we should implement the best platform that fits customer needs and we can leave the Arduino platform implementation to the enthusiasts and the device adapters.

No production worthy device was shipped with Arduino code and it is in fact considered a beginners tool and most professionals don't appreciate the Arduino libs.

johanstokking commented 4 years ago

I also think that Arduino support is a nice-to-have, but shouldn't be our own bet.

@elsalahy can you comment on the advantages and disadvantages of FreeRTOS, ThreadX and Mbed OS?

In any case, we can use LMN, right?

elsalahy commented 4 years ago

@johanstokking yes we will base it on LMN and will keep any eye on the the design of the basic modem (official Sub GHz support planned by end of September/middle of October) as it might be better in terms of OS integration.

Will post a summary of the advantages and disadvantages and an implementation proposal for each possible platform within this week!

elsalahy commented 4 years ago

Platforms proposals:

  1. FreeRTOS + LMN LoRaWAN Stack

Relevant technical background:

Proposed FreeRTOS implementation:

Advantages:

Disadvantages:

elsalahy commented 4 years ago

Platforms proposals:

  1. MbedOS + LMN LoRaWAN Stack

Relevant background:

Proposed Mbed OS implementation:

Advantages:

Disadvantages:

elsalahy commented 4 years ago

Platforms proposals:

  1. Azure RTOS(ThreadX) + LMN LoRaWAN Stack

Relevant background:

Proposed Azure RTOS (ThreadX) implementation:

Advantages:

Disadvantages:

elsalahy commented 4 years ago

@johanstokking what do you think, did I miss any points. Let me know and I can add them.

I think we mainly need an OS to make it simple for anyone to build an application and expand on the vision of a generic device.

I think we should pick this up in a call after we detailed all the options and advantages/disadvantages in this issue.

johanstokking commented 4 years ago

Indeed I feel like this is more a marketing decision than a technical decision.

Going with a cloud provider "branded" RTOS is opening and closing doors at the same time. Note that I would consider Mbed OS also a "cloud provider's RTOS": Arm is increasingly positioning Mbed OS as a client for Pelion.

My current preference, but that's entirely intuitive, is going with FreeRTOS for low footprint, compatibility, neutrality and community.

elsalahy commented 3 years ago

With DB results, we have very few reasons to build and maintain an integration with Mbed OS. Here is my current proposal:

TheThingsBot commented 3 years ago

This issue has been mentioned on Discuss The Things Industries. There might be relevant details there:

https://discuss.thethingsindustries.com/t/rtos-for-generic-node-do-we-want-need-it-noob-questions/384/2

elsalahy commented 3 years ago

Working on #79 and #81 (FreeRTOS)

Closing the issue and it can be used as a reference for relevant pull requests.

TheThingsBot commented 3 years ago

This issue has been mentioned on Discuss The Things Industries. There might be relevant details there:

https://discuss.thethingsindustries.com/t/gnse-supported-platforms-official-and-community/583/2