ARMmbed / mbed-os

Arm Mbed OS is a platform operating system designed for the internet of things
https://mbed.com
Other
4.66k stars 2.97k forks source link

Support for LoRaWAN 1.1 on MCU_STM32WL #14775

Closed niondir closed 2 years ago

niondir commented 3 years ago

Description of defect

We need to use LoRaWAN 1.1 in a commercial project. We have our own board based on MCU_STM32WL. Sadly the target is not supported in the branch.

I guess the solution is to just rebase the branch onto the current master (or my current revision).

There are at least some conflicts during rebasing. I would kindly ask the maintainer of the feature-lorawan-1-1 Branch to perform a rebase to enable STM32WL support.

@rvolosatovs @kivaisan ?

Target(s) affected by this defect ?

"MCU_STM32WLE5xC" : {
        "inherits" : [
            "MCU_STM32WL"
        ],
        "extra_labels_add": [
            "STM32WLE5xC"
        ],
        "macros_add": [
            "STM32WLE5xx"
        ],
        "mbed_rom_start": "0x8000000",
        "mbed_rom_size": "0x40000",
        "mbed_ram_start": "0x20000000",
        "mbed_ram_size": "0x10000",
        "bootloader_supported": true
    },

Toolchain(s) (name and version) displaying this defect ?

Any

What version of Mbed-os are you using (tag or sha) ?

https://github.com/ARMmbed/mbed-os/#c73413893fb98aaaeda74513c981ac68adc8645d

What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

$ mbed --version 1.10.5

How is this defect reproduced ?

Compile the feature-lorawan-1-1 with the target listed above.

kivaisan commented 3 years ago

Hi @Niondir , sorry but I'm no longer working on mbed/lora. @pan- , @paul-szczepanek-arm can you help on this?

0xc0170 commented 3 years ago

@ARMmbed/mbed-os-connectivity can you rebase the branch?

I am looking at the changes on the feature branch. The conflicts might be in unittests (we updated unittests to modern CMake). The rest of changes are in lorawan code, not much changed in the last releases.

rvolosatovs commented 3 years ago

Not working on LoRaWAN anymore either, sorry!

paul-szczepanek-arm commented 3 years ago

Just a headsup that I'm working on rebasing the branch - most conflicts are caused by the unit testing overhaul. I still have to sort out the added tests.

jeromecoutant commented 3 years ago

FYI @ludoch-stm

paul-szczepanek-arm commented 3 years ago

I'm sorry to say this turned out to be a too long a job. The conflicts created are too complex to resolve without knowing the meaning of the code. I cannot do this without having this prioritised and scheduled by my superiors.

The original author of the code could possibly manually reapply the collapsed changes onto a new feature branch but that is not something I can do without first understanding the changes - which is not something I can do in my spare time.

(The aborted attempt https://github.com/paul-szczepanek-arm/mbed-os/pull/68)

niondir commented 3 years ago

@paul-szczepanek-arm Thanks for the effort and estimation.

We will needs this for a project with the "Deutsche Bahn" where we want to control the station clocks and sync time via LoRaWAN Broadcast. (see german page: https://www.deutschebahn.com/de/Digitalisierung/technologie/digitaler_alltag/lorawan-3232292)

If there is a way to prioritize this ticket it would help us very much.

0xc0170 commented 3 years ago

We will needs this for a project with the "Deutsche Bahn" where we want to control the station clocks and sync time via LoRaWAN Broadcast. (see german page: https://www.deutschebahn.com/de/Digitalisierung/technologie/digitaler_alltag/lorawan-3232292

That sounds interesting! There are english pages (I did not know about their effort) https://www.deutschebahn.com/en/Digitalization/technology/innovations/lorawan-3520294 and https://www.deutschebahn.com/en/Digitalization/technology/New-Technology/internet_of_things-3520354

@Niondir You can take feature lorawan branch and apply there MCU_STM32WL - it should be way easier as the feature branch was postponed and it's now out of date unfortunately with master. Applying specific target code should unblock your work in the meanwhile. Or would you be able to help rebasing feature lorawan changes to the latest master ?

niondir commented 3 years ago

Yes, moving the MCU_STM32WL to the LoRa branch will probably be easier. I will have a look.

hallard commented 3 years ago

Very interested by this one also Remembering developed Deutsche Bah paxcounter hardware prototype with Klaus, should have some PCB somewhere in my office, that's funny

niondir commented 3 years ago

A little update on my efforts.

I added STM32WL support to the LoRaWAN 1.1 branch and can compile my code now.

Next steps:

In case everything works fine, I would create a PR with my code.

I had to do some extra work, to make the STM32WL working on the lorawan-1-1 branch:

- Update mbedtls
- Update devices_key
- Update storage/kvstore
- Add platform/FEATURE_EXPERIMENTAL_API
- Add TARGET_STM32WL

All mentioned updates are not from the latest master, but from the revision my project is build on: d147abc3e556c58e5e343d34b729bc2192e18bd3

hallard commented 3 years ago

@niondir, this is great stuff, any chance to test your changes or do we need to wait the PR?

niondir commented 3 years ago

Sure there is a chance, but I actually need to move it to GitHub. I will let you know once it's available. I'm also looking forward for Feedback.

niondir commented 2 years ago

Since a lot of features are missing, we will most likely switch to https://github.com/Lora-net/LoRaMac-node

There are sample implementations for the STM32WL: https://github.com/TheThingsIndustries/generic-node-se/tree/develop/Software/app

For using LoRaWAN 1.1 with mbed-os I would suggest to integrate the external LoRaMac-node repository using a thin wrapper (needs to be written).

niondir commented 2 years ago

I provided my PR. I have to note that I was able to Join TTN but uplinks only worked in rare random cases. I did not invested much time in debugging since we are now planning to use the LoRaMac-node stack.

0xc0170 commented 2 years ago

As stated earlier, the branch was developed some time ago with different team who is no longer involved.

For using LoRaWAN 1.1 with mbed-os I would suggest to integrate the external LoRaMac-node repository using a thin wrapper (needs to be written).

It might be better to do so. Thanks for the suggestion. The feature branch won't be updated (reasons provided above). I'll close this issue as "won't fix".

hallard commented 2 years ago

integration of loramac node would be awesome, Is there any plan on that in mbed team ?

0xc0170 commented 2 years ago

integration of loramac node would be awesome, Is there any plan on that in mbed team ?

No plans for this.

hallard commented 2 years ago

So just to be sure, LoRaWAN support on mbed will stay "as his" with no update ? We moved to mbed because it's simple and easy, but if LoRaWAN support isn't done anymore it's not usefull for us because it's our main target.