-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft: Add LoRa Basics Modem radio drivers and LoRaWAN stack #77495
base: main
Are you sure you want to change the base?
Conversation
The following west manifest projects have been modified in this Pull Request:
Note: This message is automatically posted and updated by the Manifest GitHub Action. |
Hi, @Salamandar, did you have chance to test this with CONFIG_PM? When I enable it, join requests always fail. still investigating this issue... Any idea what the issue could be? P.S. |
d74b021
to
abbb834
Compare
Hi @Salamandar I’m not sure if this is the best place to discuss build failures, but I wanted to share these with you. If there’s a more appropriate forum or person for this, please let me know. here are errors: when I build your pull request: Probably you know, but anyway: disable wdt: got error: zephyr/modules/lora_basics_modem/app_helpers/smtc_hal_zephyr/smtc_hal_watchdog.c:57: undefined reference to `__device_dts_ord_115' workaround for now.
disabling all region supports: compiling is ok but
Ill share the quick workaround solution shortly |
7330245
to
4caafc9
Compare
…b org) This project will be used in the next commits. Signed-off-by: Félix Piédallu <[email protected]>
bcb80a0
to
16fdee2
Compare
Ah yeah, that's "expected". The code in the samples and |
f129e6c
to
a899b07
Compare
Add the module, subsys, drivers for LoRa Basics Modem. Add Salamandar (Félix Piédallu) to its maintainers. Signed-off-by: Félix Piédallu <[email protected]>
This module provides: * The cmake files for LoRa Basics Modem * The "HAL" described here: https://github.com/Lora-net/SWL2001/blob/master/lbm_lib/PORTING_GUIDE.md * Reimplementations of the logging functions in smtc_modem_hal_dbg_trace.h Signed-off-by: Félix Piédallu <[email protected]>
Those drivers are actually device tree bindings, and HAL/BSP as described in https://github.com/Lora-net/SWL2001/blob/master/lbm_lib/PORTING_GUIDE.md Signed-off-by: Félix Piédallu <[email protected]>
Those shields are sold by Semtech and are arduino compatible. Signed-off-by: Félix Piédallu <[email protected]>
ping_pong is an automatic ping-pong example between two LBM boards ping_shell is a manual ping-like example between two LBM boards Signed-off-by: Félix Piédallu <[email protected]>
This stack is based on the lora_basics_modem external module. It provides configuration for LBM as well as a standalone "main" LBM thread that needs to be manually started. Signed-off-by: Félix Piédallu <[email protected]>
a899b07
to
154d61e
Compare
@KajbaM, forgive the ping! |
@ndrs-pst I work at IRNAS and will submit a review. This is more or less a continuation of our work by Semtech, so we might have some additional insight. Hopefully, this gets merged, so we can all benefit :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some general comments and suggestions.
Other maintainers should leave comments about more Zephyr-specific topics.
If this is merged, you will then have 2 LoRaWAN stacks in Zephyr - LBM and LoRaMAC-Node.
Since LBM is the new and supported one, could LoRaMAC-Node
be removed? It should be trivial to implement the Zephyr LoRa and LoRaWAN APIs on top of LBM.
Thoughts?
boards/shields/semtech_lr11xxmb1xxs/semtech_lr11xxmb1xxs_common.dtsi
Outdated
Show resolved
Hide resolved
LOG_WRN("Resetting the MCU"); | ||
k_sleep(K_SECONDS(1)); /* Sleep a bit so logs are printed. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOG_WRN("Resetting the MCU"); | |
k_sleep(K_SECONDS(1)); /* Sleep a bit so logs are printed. */ | |
LOG_WRN("Resetting the MCU"); | |
LOG_PANIC(); |
Use LOG_PANIC
to flush the logs.
/* FIXME: That whole storage bit should be revamped to something more generic, | ||
* that would remove the whole read-erase-write logics and leverage the zephyr flash stack. | ||
* Maybe split the flash in half, one with contexts and one with store-and-forward. | ||
* Maybe remove the store-and-forward circularfs backend and just use NVS. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the storage code bellow seems very experimental.
Maybe remove it for now and only have the user-callback option?
I think the Zephyr community should help out here with suggestions on how to implement this in the best way.
if (smtc_modem_is_irq_flag_pending()) { | ||
continue; | ||
} | ||
LOG_INF("Sleeping for %dms", sleep_time_ms); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOG_INF("Sleeping for %dms", sleep_time_ms); | |
LOG_DBG("Sleeping for at most %dms", sleep_time_ms); |
So that logs are less spammy.
config LORA_BASICS_MODEM_NUMBER_OF_STACKS | ||
int "Number of LoRa Basics Modem stacks (only 1 is supported for now)" | ||
default 1 | ||
help | ||
Number of stacks to be used by the modem library. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since 1 is the only valid value, this should not be user-assignable:
config LORA_BASICS_MODEM_NUMBER_OF_STACKS | |
int "Number of LoRa Basics Modem stacks (only 1 is supported for now)" | |
default 1 | |
help | |
Number of stacks to be used by the modem library. | |
config LORA_BASICS_MODEM_NUMBER_OF_STACKS | |
int | |
default 1 # only 1 is supported for now | |
help | |
Number of stacks to be used by the modem library. |
{ | ||
LOG_INF("===== SX126x TX CW example ====="); | ||
|
||
apps_common_lr11xx_system_init(context); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You use apps_common_
functions here, but there is no apps_common
module.
…nly. Some are used in public headers, so left as project-wide compile_defines
Enable wifi/gnss libraries if LR1110 or LR1120, instead of disabling if LR1121.
This pull request adds support for the Semtech transceivers with the "radio drivers", and for the LoRaWAN stack, both provided by the LoRa Basics Modem project (https://github.com/Lora-net/SWL2001)
This PR adds:
compatible
with-new
, but what's the guideline on that ?module
.lora_lbm
and subsyslorawan_lbm
, to differentiate from the loramac-node implementations.app_helpers
code inmodules/lora_basics_modem
for portability purpose, but this should be cleaned up.EDIT: I splitted this PR in half : this PR contains only code that was written with zephyr in mind. The samples that still need porting are in https://github.com/salamandar/zephyr/tree/lbm_samples