Skip to content
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

Closed
wants to merge 20 commits into from
Closed

Conversation

hallard
Copy link
Contributor

@hallard hallard commented Jul 1, 2021

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

[] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[x] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[x] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers

@jeromecoutant @ARMmbed/team-st-mcd

@ciarmcom
Copy link
Member

ciarmcom commented Jul 1, 2021

@hallard, thank you for your changes.
@jeromecoutant @ARMmbed/mbed-os-connectivity @ARMmbed/team-st-mcd @ARMmbed/mbed-os-maintainers please review.

Copy link
Collaborator

@jeromecoutant jeromecoutant left a 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)

"MCU_STM32WL"
],
"public": false,
"macros_add": [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alignment issue

Copy link
Contributor Author

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)
Copy link
Collaborator

@jeromecoutant jeromecoutant Jul 2, 2021

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
    ?

Copy link
Contributor Author

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.

Copy link

@MarceloSalazar MarceloSalazar Jul 2, 2021

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).

Copy link
Contributor Author

@hallard hallard Jul 2, 2021

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 */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo issues

Copy link
Contributor Author

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?

Copy link
Contributor Author

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 */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines 106 to 115
// 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,

Copy link
Collaborator

@jeromecoutant jeromecoutant Jul 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok will do

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Comment on lines 117 to 120
LED1 = PB_5,
LED2 = PB_10,

BUTTON1 = PA_0,
Copy link
Collaborator

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?

Copy link
Contributor Author

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

Copy link
Collaborator

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

Copy link
Contributor Author

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

Copy link
Collaborator

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 ?

Copy link
Contributor Author

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.

Copy link
Contributor Author

@hallard hallard Jul 2, 2021

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?

Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok done

@jeromecoutant
Copy link
Collaborator

About Travis error, it seems that you need to rebase on the latest master
@0xc0170

@jeromecoutant
Copy link
Collaborator

FYI @ludoch-stm

Copy link

@MarceloSalazar MarceloSalazar left a 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

@mergify mergify bot dismissed MarceloSalazar’s stale review July 2, 2021 10:17

Pull request has been modified.

@hallard
Copy link
Contributor Author

hallard commented Jul 2, 2021

@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.

image
image

@MarceloSalazar
Copy link

@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.

@jeromecoutant
Copy link
Collaborator

OK...

@hallard keep all patches except the 2 directories:

  • targets/TARGET_STM/TARGET_STM32WL/TARGET_STM32WLE5xC/TARGET_LORA_E5
  • targets/TARGET_STM/TARGET_STM32WL/TARGET_STM32WLE5xC/TARGET_RAK3172

In targets.json, keep only "MCU_STM32WLe5xC" definition.

I will save the missing files in a ST mbed repo soon.

@jeromecoutant
Copy link
Collaborator

Here is the new repo : https://github.com/ARMmbed/stm32customtargets

Feel free to make PR there as well!

@ARMmbed/team-st-mcd

@hallard
Copy link
Contributor Author

hallard commented Jul 3, 2021

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?

@hallard
Copy link
Contributor Author

hallard commented Jul 5, 2021

Closed, as discussed on this thread, now added into #14872 and custom target will be created into
https://github.com/ARMmbed/stm32customtargets as asked by @MarceloSalazar and @jeromecoutant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants