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

provide support for the ST S2LP 802.15.4 Radio #16086

Closed
wants to merge 3 commits into from

Conversation

nikooiko
Copy link
Contributor

@nikooiko nikooiko commented May 12, 2019

Hello everyone, in this PR the target is to provide support for the ST S2LP 802.15.4 Radio.

It's a work in progress but it's at a working state and can be the base for the enhancements/upgrades discussion.

Included in this merge request:

  • Driver for the S2LP 802.15.4 radio
  • The expansion of the ST external support library with the x-cube-subg1 expansion package, written by ST Microelectronics.
  • The definition of the x_nucleo_s2868a1 expansion module.

Current TODO list:

  • Support MTU > 127 bytes. Currently the driver works only with short MTU=127 bytes, but based on datasheet, the device should support MTU up to 65535 with basic packet format.
  • Correctly configure radio Rx State to optimize power consumption (Currently draws around 8mA but can be optimized with LDC and Rx Sniff to operate with lower consumption).
  • Rework Rx Thread main function (s2lp_rx) to simplify and avoid unneeded operations.
  • Implement s2lp_set_channel and s2lp_get_channel_count functions.
  • Add data rate configuration option (currently operates at 38.4Kbps).
  • Add frequency band configuration option (currently operates at 868Mhz).
  • BUG: There is a case where the TX operation locks because IRQ_TX_DATA_SENT is not correctly sampled (missed by the polling operation).

Possible changes:

  • The radio supports HW filter and HW auto-ack mechanisms. Is there any interest in implementing them?
  • X cube subg1 software expects little-endian architectures. Should be patched to also provide support for big-endian architectures?
  • The current driver only supports S2LP radio but can be expanded to also support the ST SPIRIT1 802.15.4 radio.
  • The current driver works with a static config for the radio params. Should be upgraded to be configurable through Kconfig workflow? Is there any interest in this?
  • Replace basic packet format with the 802.15.4 packet format?

Signed-off-by: Nikos Oikonomou [email protected]

@zephyrbot
Copy link
Collaborator

zephyrbot commented May 12, 2019

EDIT (@erwango): I've cleaned zephyrbot comments here as they don't apply anymore (lib has been moved to hal_st module) and zephyrbot would have left them as is (due to change of behavior). I did this to avoid confusion during the review, but I can re-instantiate them if requested.

@nikooiko nikooiko force-pushed the st-subg1-s2lp branch 4 times, most recently from f423df7 to a0d5dea Compare May 12, 2019 21:08
@erwango erwango added the platform: STM32 ST Micro STM32 label May 13, 2019
@nikooiko nikooiko force-pushed the st-subg1-s2lp branch 2 times, most recently from aa6af36 to 37d8e91 Compare May 13, 2019 09:50
Copy link
Member

@erwango erwango left a comment

Choose a reason for hiding this comment

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

Thanks for this work.
For a start, I will let others commenting on the code part, and I will focus on the license statement.
We need to ensure the license of the files you extracted from the package is compatible with use in Zephyr.
I will nack this change until it is proven we're safe on that side, but it will (should) not prevent others to review the other parts of the change meanwhile.

ext/hal/st/stm32cube_subg1/README Outdated Show resolved Hide resolved
Copy link
Contributor

@dbkinder dbkinder left a comment

Choose a reason for hiding this comment

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

Doc is OK so far (with one correction). Is a usage example coming later?

- RoHS compliant


More information about X-NUCLEO-S2868A1 can be found here:
Copy link
Contributor

Choose a reason for hiding this comment

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

This renders better without the bullet point:

More information about X-NUCLEO-S2868A1 can be found in the
`X-NUCLEO-S2868A1 data sheet`_.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is resolved

@nikooiko
Copy link
Contributor Author

With the provided overlay files we can execute the net > echo server/client samples. It doesn't need to showcase anything different than any other 802.15.4 device.

Of course, if you believe that a custom sample is required I can either provide a new net-based example (similar to echo), or a custom low-level sample with CONFIG_IEEE802154_RAW_MODE enabled. If you prefer the latter, I could provide a stress test sample to evaluate the performance of the radio and the provided driver.


&spi1 {
status = "ok";
cs-gpios = <&gpioa 1 (GPIO_DIR_OUT|GPIO_INT_ACTIVE_LOW)>;
Copy link
Member

Choose a reason for hiding this comment

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

Regarding this shield part, can you follow what's on going with:
#14057

Particularly, I'd like you to use new gpio-map scheme described here:
#15637

* SPDX-License-Identifier: Apache-2.0
*/

&spi1 {
Copy link
Member

Choose a reason for hiding this comment

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

would be arduino_spi

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so it will be arduino_spi: &spi1?

Copy link
Member

Choose a reason for hiding this comment

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

Shield overlays should refer to generic nodes label, such as arduino_spi.
These alternate labels (overridding nodes in dts grammar) are defined in boards, cf nucleo_f429zi.dts.
This allows shield to be compatible with various boards that would have a different definition of arduino_spi.

@@ -0,0 +1,14 @@
CONFIG_GPIO=y
Copy link
Member

Choose a reason for hiding this comment

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

Once again, please follow up on https://github.com/zephyrproject-rtos/zephyr/pull/14057/commits
shield overlays would now sit under boards/shields, so they are not tight to a sample

@erwango
Copy link
Member

erwango commented May 17, 2019

recheck

Copy link
Contributor

@dbkinder dbkinder left a comment

Choose a reason for hiding this comment

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

+1 for docs

@nashif nashif changed the title St subg1 s2lp provide support for the ST S2LP 802.15.4 Radio May 29, 2019
@erwango
Copy link
Member

erwango commented Jun 27, 2019

@nikooiko, you'll find in https://www.st.com/en/embedded-software/x-cube-subg1.html a 3.1.1 version of the package that includes BSD-3 zephyr compatible License. Please use this package.
Also, due to move of ext\ components to zephyr modules, you'll need to push part of your changes in following git repo: https://www.st.com/en/embedded-software/x-cube-subg1.html

Thanks

@nikooiko
Copy link
Contributor Author

@erwango thanks for the ping!
I'll change them when I find the time.

@erwango
Copy link
Member

erwango commented Sep 18, 2019

@nikooiko , any plan for this work?

@nikooiko
Copy link
Contributor Author

@nikooiko , any plan for this work?

Sorry for the inactivity. I've been too busy with other things and I haven't found the time to work with this driver. Hopefully, a colleague of mine will start working on this radio so he might have the time to continue the driver.

@erwango
Copy link
Member

erwango commented Sep 19, 2019

@nikooiko, thanks for the feedback. We're in the process of cleaning up the PR base. I'm tagging the PR as "stale", it might also be closed later on. But don't worry, it can still be re-opened, and I'll be happy to continue the review.

@erwango
Copy link
Member

erwango commented Feb 10, 2021

@nikooiko CI is still failed ... but hal update step is passed! Some CI checks to fix and you should be done (with this part ;-))

@erwango
Copy link
Member

erwango commented Feb 16, 2021

@nikooiko Seems you're out of luck with IC, this timeit is not related with your change. You can have a try to rebase and force push to see if this is getting better.
Regarding the driver part, it would be nice if @tbursztyka or @jukkar could have a look.

@nikooiko
Copy link
Contributor Author

@nikooiko Seems you're out of luck with IC, this timeit is not related with your change. You can have a try to rebase and force push to see if this is getting better.
Regarding the driver part, it would be nice if @tbursztyka or @jukkar could have a look.

Guys here is some feedback about the driver's state/progress:

As I mentioned above I investigated replacing basic packet format with 802.15.4, but in the end, I found no reason to do so.

I tried to use the echo_client/echo_server samples but the nodes were unable to communicate so I'll need to investigate it further. At the same time I started working with a custom sample that uses 802.15.4 raw communication (s2868a1 sample) to stress test and showcase the radio operation.

In parallel my next target is to implement the s2lp_set_channel and s2lp_get_channel_count functions.

As I'm still working on this driver, any feedback would be much appreciated to produce a better result.

@erwango erwango assigned jukkar and unassigned erwango Feb 16, 2021
@erwango erwango removed the platform: STM32 ST Micro STM32 label Feb 16, 2021
@mbolivar-nordic mbolivar-nordic removed their request for review February 23, 2021 23:41
st: update to latest ST package revision '44d5d70'.

Includes ST S2LP Library.

Signed-off-by: Nikos Oikonomou <[email protected]>
@nikooiko nikooiko force-pushed the st-subg1-s2lp branch 2 times, most recently from 59495f4 to 646389f Compare March 25, 2021 16:09
Added driver for the s2lp radio modules

Signed-off-by: Nikos Oikonomou <[email protected]>
Added a new shield for the x_nucleo_s2868a1 expansion module

Signed-off-by: Nikos Oikonomou <[email protected]>
@galak galak removed this from the v2.6.0 milestone May 5, 2021
@nikooiko
Copy link
Contributor Author

Guys, unfortunately, I was again forced to pause the development of this request. Until I have the time to continue with it or someone else steps up I'm closing this pull request.

@nikooiko nikooiko closed this May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants