-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Added LORA-E5 and RAK3172 lorawan modules #14859
Conversation
@hallard, thank you for your changes. |
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.
Very interesting!
(got only minor comments or questions)
targets/targets.json
Outdated
"MCU_STM32WL" | ||
], | ||
"public": false, | ||
"macros_add": [ |
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.
alignment issue
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.
fixed
/* Sets up radio switch position according to the radio mode */ | ||
#if defined (TARGET_LORA_E5) || defined (TARGET_RAK3172) |
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 think this list of define will not be "nice" when we will add again more targets? :-)
Proposition:
- create a new sub-directory here TARGET_NUCLEO_WL55JC with this current file inside
- you can the create TARGET_LORA_E5 and TARGET_RAK3172 with the specific file content
?
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.
Yeah don't like these define either. Subfolder is great, the deal is that I'm not a guru of cmake, so not sure how to tell which dir to include depending on target, I'll try that.
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.
We shouldn't have targets configuration in libraries - these should be hw agnostic.
Instead, you can propose a sw configuration to enable/disable features. This could be used by any target configuration (e.g through mbed_app.json).
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.
done, looks like it was easier than I thought
/* Sets up radio switch position according to the radio mode */ | ||
#if defined (TARGET_LORA_E5) || defined (TARGET_RAK3172) | ||
/* This configuration is for RAK3172 or LoRa-E5 modules */ | ||
/* Theese one use only HP mode the LP mode is not connected nor RF Switch ctrl3 */ |
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.
typo issues
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.
could you precise what do you want me to fix?
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.
done
#if defined (TARGET_LORA_E5) || defined (TARGET_RAK3172) | ||
/* This configuration is for RAK3172 or LoRa-E5 modules */ | ||
/* Theese one use only HP mode the LP mode is not connected nor RF Switch ctrl3 */ | ||
/* Added to avoid declarion in sample code for lorawan example with these mmodules */ |
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.
typo
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.
same as above
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.
done
// I2C signals aliases | ||
I2C_SDA = PA_15, | ||
I2C_SCL = PB_15, | ||
|
||
// SPI signals aliases | ||
SPI_CS = PB_9, | ||
SPI_MOSI = PA_10, | ||
SPI_MISO = PB_14, | ||
SPI_SCK = PB_13, | ||
|
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.
Use #define (or remove if not useful)
See https://github.com/ARMmbed/mbed-os/blob/master/hal/include/hal/PinNameAliases.h#L171
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.
ok will do
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.
done
LED1 = PB_5, | ||
LED2 = PB_10, | ||
|
||
BUTTON1 = PA_0, |
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.
Not sure there is LED and button?
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.
on my board (and SEEED ones) there are but I can add them in override section of the project
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 understand.
Maybe you could create a third target for your specific HW ?
@MarceloSalazar
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.
yeah, later :-)
*/ | ||
#ifndef MBED_PERIPHERALNAMES_H | ||
#define MBED_PERIPHERALNAMES_H | ||
|
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.
As you want, but I think we can move this file at TARGET_STM32WL level to be common for all ?
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.
absolutely, once gain, need knowledge of CMake, will try.
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.
are you ok to move 3 files PeripheralNames.c
PeripheralPins.h
system_clock.c
to TARGET_STM32WL and keep only PinNames.h
in target folder?
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.
- PeripheralPins.c : no, specific for each target (you can manually disable or not a pin, you can add comment, etc...)
- PeripheralNames.h : yes
- system_clock.c: why not, as SetSysClock is weak
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.
ok done
About Travis error, it seems that you need to rebase on the latest master |
FYI @ludoch-stm |
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.
Note this isn't considered an officially support board with valid board ID.
You can add Mbed OS support following the guidelines for Custom and community boards
Pull request has been modified.
@MarceloSalazar does this means that this PR has no chance to be merged? These 2 modules are not really a board but just a module to be put on custom/pro boards. Boards made with this module can be used as custom boards of course but target is always a STM32WL one. The Difference with STM32WL55 is that these one are single core STM32WLE5. |
@hallard I'm afraid we can't accept this PR as new target as it's not considered an officially supported board. You may still want to contribute with changes in Mbed OS to let us configure specific features in libraries and support custom boards/modules. Please check the docs for enabling custom boards. @jeromecoutant let us know if you have some ideas on how support custom boards based on ST MCUs. |
OK... @hallard keep all patches except the 2 directories:
In targets.json, keep only "MCU_STM32WLe5xC" definition. I will save the missing files in a ST mbed repo soon. |
Here is the new repo : https://github.com/ARMmbed/stm32customtargets Feel free to make PR there as well! @ARMmbed/team-st-mcd |
Awesome, already done that but on my work computer, will finish all by monday, nice work. By the way, just curious, where I need to put the weak function for rf swtich configuration for these 2 boards? |
Closed, as discussed on this thread, now added into #14872 and custom target will be created into |
Summary of changes
Added new lorawan modules with STM32WL, LoRa-E5 and RAK3172 targets
ARMmbed/mbed-os-example-lorawan#232
Impact of changes
Migration actions required
Documentation
You can now use 2 new targets available in targets list
LORA_E5
RAK3172
Pull request type
Test results
Reviewers
@jeromecoutant @ARMmbed/team-st-mcd