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

modules: hal_silabs: Add Proprietary TRX example #49

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

zohavas
Copy link
Contributor

@zohavas zohavas commented Dec 15, 2023

Add Proprietary TRX example to show SiliconLabs radio board capabilities.

examples/proprietary_trx/src/main.c Outdated Show resolved Hide resolved
examples/proprietary_trx/src/app_process.h Outdated Show resolved Hide resolved
examples/proprietary_trx/src/app_rail.c Outdated Show resolved Hide resolved
examples/proprietary_trx/src/app_rail.c Outdated Show resolved Hide resolved
examples/proprietary_trx/src/app_rail.c Outdated Show resolved Hide resolved
examples/proprietary_trx/src/app_cli.c Outdated Show resolved Hide resolved
examples/proprietary_trx/src/app_rail.c Outdated Show resolved Hide resolved
examples/proprietary_trx/src/app_rail.c Outdated Show resolved Hide resolved
examples/proprietary_trx/src/app_rail.c Outdated Show resolved Hide resolved
examples/proprietary_trx/src/app_rail.c Outdated Show resolved Hide resolved
Copy link
Member

@fkokosinski fkokosinski left a comment

Choose a reason for hiding this comment

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

Hi! Unfortunately the HAL repo is not the right place to add examples. We should add them in main Zephyr repo instead.

@jerome-pouiller
Copy link
Collaborator

Hi! Unfortunately the HAL repo is not the right place to add examples. We should add them in main Zephyr repo instead.

This exemple only work with Silabs specific API. I don't think it makes sense to place it in Zephyr repo, do you?

However, I believe it makes sense to publish it somewhere. Do you think it should be published on an external repository?

Note Espressif already publish examples with their HAL:
https://github.com/zephyrproject-rtos/hal_espressif/tree/zephyr/examples

@fkokosinski
Copy link
Member

Note Espressif already publish examples with their HAL: https://github.com/zephyrproject-rtos/hal_espressif/tree/zephyr/examples

Hi! You're right indeed, and we should be fine with hosting these samples here in the SiLabs HAL then :) Thanks for pointing that out.

@fkokosinski fkokosinski self-requested a review January 8, 2024 13:23
examples/proprietary_trx/CMakeLists.txt Outdated Show resolved Hide resolved
examples/proprietary_trx/README.rst Outdated Show resolved Hide resolved
examples/proprietary_trx/README.rst Outdated Show resolved Hide resolved
examples/proprietary_trx/README.rst Outdated Show resolved Hide resolved
examples/proprietary_trx/prj.conf Outdated Show resolved Hide resolved
examples/proprietary_trx/src/app_rail.c Outdated Show resolved Hide resolved
examples/proprietary_trx/src/app_rail.c Outdated Show resolved Hide resolved
examples/proprietary_trx/src/app_rail.h Outdated Show resolved Hide resolved
@zohavas zohavas force-pushed the add_example_radio_trx branch 2 times, most recently from f9876a9 to 527d38d Compare January 16, 2024 11:07
examples/proprietary_trx/CMakeLists.txt Outdated Show resolved Hide resolved
examples/proprietary_trx/CMakeLists.txt Outdated Show resolved Hide resolved
}
if (s_obj.events & EVENT_RADIO_ERROR) {
smf_set_state(SMF_CTX(&s_obj), &radio_states[ERROR]);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe if two events raise in the same iteration, one of them will be ignored. The occurrence of the bug will depends of the execution time of the functions declared in radio_states.
BTW, if we miss the EVENT_RADIO_SENT event, we won't be able to send anything anymore.

examples/proprietary_trx/src/app_rail.h Outdated Show resolved Hide resolved
examples/proprietary_trx/README.rst Outdated Show resolved Hide resolved
examples/proprietary_trx/src/app_rail.c Outdated Show resolved Hide resolved
examples/proprietary_trx/src/app_rail.c Outdated Show resolved Hide resolved
examples/proprietary_trx/src/app_rail.c Show resolved Hide resolved
examples/proprietary_trx/src/main.c Outdated Show resolved Hide resolved
examples/proprietary_trx/src/main.c Outdated Show resolved Hide resolved
@zohavas zohavas force-pushed the add_example_radio_trx branch 3 times, most recently from 5541cd5 to 576b290 Compare January 23, 2024 15:49
@zohavas zohavas force-pushed the add_example_radio_trx branch 3 times, most recently from 7463b7b to ee150d9 Compare January 29, 2024 14:32
Copy link
Collaborator

@jerome-pouiller jerome-pouiller left a comment

Choose a reason for hiding this comment

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

Hello @zohavas.

Usually I tried to give all my comments in the two first version of a PR. Unfortunately, some of my comments are still related to code existing since the first version. I am sorry about that, I know it is not convenient.

examples/proprietary_trx/src/app_gpio.c Outdated Show resolved Hide resolved
examples/proprietary_trx/src/app_gpio.c Outdated Show resolved Hide resolved
examples/proprietary_trx/src/app_rail.c Outdated Show resolved Hide resolved
examples/proprietary_trx/src/app_rail.c Show resolved Hide resolved
examples/proprietary_trx/src/app_rail.c Show resolved Hide resolved
examples/proprietary_trx/src/app_rail.c Outdated Show resolved Hide resolved
examples/proprietary_trx/src/main.c Outdated Show resolved Hide resolved
examples/proprietary_trx/src/app_process.h Outdated Show resolved Hide resolved
examples/proprietary_trx/src/main.c Outdated Show resolved Hide resolved
examples/proprietary_trx/src/app_gpio.c Outdated Show resolved Hide resolved
@zohavas zohavas force-pushed the add_example_radio_trx branch 2 times, most recently from 5cec2c7 to 34580b1 Compare January 29, 2024 16:42
examples/proprietary_trx/README.rst Outdated Show resolved Hide resolved
examples/proprietary_trx/README.rst Outdated Show resolved Hide resolved
examples/proprietary_trx/README.rst Outdated Show resolved Hide resolved
examples/proprietary_trx/README.rst Outdated Show resolved Hide resolved
examples/proprietary_trx/src/app_cli.c Outdated Show resolved Hide resolved
examples/proprietary_trx/src/app_gpio.c Show resolved Hide resolved
examples/proprietary_trx/src/app_gpio.c Outdated Show resolved Hide resolved
examples/proprietary_trx/src/main.h Outdated Show resolved Hide resolved
@zohavas zohavas force-pushed the add_example_radio_trx branch from 34580b1 to cfced72 Compare January 31, 2024 13:04
examples/proprietary_trx/src/app_gpio.c Outdated Show resolved Hide resolved
examples/proprietary_trx/src/app_gpio.c Outdated Show resolved Hide resolved
examples/proprietary_trx/src/app_gpio.c Outdated Show resolved Hide resolved
examples/proprietary_trx/src/app_cli.c Outdated Show resolved Hide resolved
@zohavas zohavas force-pushed the add_example_radio_trx branch 2 times, most recently from a0b3eaa to ac3b80a Compare February 1, 2024 09:43
Copy link
Collaborator

@jerome-pouiller jerome-pouiller left a comment

Choose a reason for hiding this comment

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

I am still dubious about the state machine, autogen files, etc... However, I don't see major issues we could fix without changing the whole design.

@zohavas
Copy link
Contributor Author

zohavas commented Feb 1, 2024

@fkokosinski we are almost ready, we need to validate some things with our legal department. Please wait with the merge until we are ready, thank you.

Add Proprietary TRX example to show SiliconLabs radio board capabilities.

Signed-off-by: Zoltan Havas <zoltan.havas@silabs.com>
@zohavas zohavas force-pushed the add_example_radio_trx branch from ac3b80a to ebc2b4d Compare February 16, 2024 11:38
@zohavas
Copy link
Contributor Author

zohavas commented Feb 16, 2024

@fkokosinski thank you for waiting, we are ready with the requested legal validation, the merge can go, thank you for your help!

@fkokosinski
Copy link
Member

@fkokosinski thank you for waiting, we are ready with the requested legal validation, the merge can go, thank you for your help!

Thanks for the ping. Please note that Zephyr is currently in a feature freeze, meaning we shouldn't be merging anything until it ends on February 23rd. I would also prefer to have 2 ACKs on the PR to Zephyr before moving with this to be sure that these changes will be pulled into Zephyr.

Copy link
Contributor

@nordicjm nordicjm left a comment

Choose a reason for hiding this comment

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

Samples should not be in hal repositories, this was never agreed with tsc

Copy link
Member

@jhedberg jhedberg left a comment

Choose a reason for hiding this comment

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

Samples should not be in hal repositories, this was never agreed with tsc

Indeed. I'm trying to find a suitable place where this could potentially land in the main tree, and the closest I've found so far would be under samples/boards there.


.. code-block:: bash

west build -p always -b efr32bg22_brd4184a
Copy link
Member

Choose a reason for hiding this comment

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

This should IMO include two prior steps:

west update hal_silabs
west blobs fetch hal_silabs

jerome-pouiller added a commit to jerome-pouiller/zephyr-silabs that referenced this pull request Sep 19, 2024
This introduce an example of use of Rail library in Zephyr.

This is a reboot of PR[1]. Compared to the original PR, this version:
  - remove some files imported from Simplicity Studio. Only
    radio_config.[ch] are kept.
  - drop the useless Finite State Machine

For now only two boards (based xg22 and xg24) are supported. I hope to
add support for all the Series-2 boards in the future.

Note Zephyr does not allow to host samples application in HALs. Samples
specific to one board and using non-standard APIs are not very welcomed
in the main repo. So, the Silabs downstream is probably the best (the
only) place to provide publish it.

[1]: zephyrproject-rtos/hal_silabs#49
jerome-pouiller added a commit to jerome-pouiller/zephyr-silabs that referenced this pull request Sep 19, 2024
This introduce an example of use of Rail library in Zephyr.

This is a reboot of PR[1]. Compared to the original PR, this version:
  - remove some files imported from Simplicity Studio. Only
    radio_config.[ch] are kept.
  - drop the useless Finite State Machine

For now only two boards (based xg22 and xg24) are supported. I hope to
add support for all the Series-2 boards in the future.

Note Zephyr does not allow to host samples application in HALs. Samples
specific to one board and using non-standard APIs are not very welcomed
in the main repo. So, the Silabs downstream is probably the best (the
only) place to provide publish it.

[1]: zephyrproject-rtos/hal_silabs#49

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
jerome-pouiller added a commit to jerome-pouiller/zephyr-silabs that referenced this pull request Sep 19, 2024
This introduce an example of use of Rail library in Zephyr.

This is a reboot of PR[1]. Compared to the original PR, this version:
  - remove some files imported from Simplicity Studio. Only
    radio_config.[ch] are kept.
  - drop the useless Finite State Machine

For now only two boards (based xg22 and xg24) are supported. I hope to
add support for all the Series-2 boards in the future.

Note Zephyr does not allow to host samples application in HALs. Samples
specific to one board and using non-standard APIs are not very welcomed
in the main repo. So, the Silabs downstream is probably the best (the
only) place to provide publish it.

[1]: zephyrproject-rtos/hal_silabs#49

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
jerome-pouiller added a commit to jerome-pouiller/zephyr-silabs that referenced this pull request Oct 10, 2024
This introduce an example of use of Rail library in Zephyr.

This is a reboot of PR[1]. Compared to the original PR, this version:
  - remove some files imported from Simplicity Studio. Only
    radio_config.[ch] are kept.
  - drop the useless Finite State Machine

For now only two boards (based xg22 and xg24) are supported. I hope to
add support for all the Series-2 boards in the future.

Note Zephyr does not allow to host samples application in HALs. Samples
specific to one board and using non-standard APIs are not very welcomed
in the main repo. So, the Silabs downstream is probably the best (the
only) place to provide publish it.

[1]: zephyrproject-rtos/hal_silabs#49

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
jerome-pouiller added a commit to jerome-pouiller/zephyr-silabs that referenced this pull request Oct 10, 2024
This introduce an example of use of Rail library in Zephyr.

This is a reboot of PR[1]. Compared to the original PR, this version:
  - remove some files imported from Simplicity Studio. Only
    radio_config.[ch] are kept.
  - drop the useless Finite State Machine

[1]: zephyrproject-rtos/hal_silabs#49

For now only two boards (based xg22 and xg24) are supported. I hope to
add support for all the Series-2 boards in the future.

Note Zephyr does not allow to host samples application in HALs. Samples
specific to one board and using non-standard APIs are not very welcomed
in the main repo. So, the Silabs downstream is probably the best (the
only) place to provide publish it.

Also note that files generated by Simplicity Studio (rail_config.*) ends
lines with \r. To pass Zephyr compliance, this patch imports these files
with \r removed:

    sed -i 's/\r//g' */rail_config.[hc]

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
jerome-pouiller added a commit to jerome-pouiller/zephyr-silabs that referenced this pull request Oct 14, 2024
This introduce an example of use of Rail library in Zephyr.

This is a reboot of PR[1]. Compared to the original PR, this version:
  - remove some files imported from Simplicity Studio. Only
    radio_config.[ch] are kept.
  - drop the useless Finite State Machine

[1]: zephyrproject-rtos/hal_silabs#49

For now only two boards (based xg22 and xg24) are supported. I hope to
add support for all the Series-2 boards in the future.

Note Zephyr does not allow to host samples application in HALs. Samples
specific to one board and using non-standard APIs are not very welcomed
in the main repo. So, the Silabs downstream is probably the best (the
only) place to provide publish it.

Also note that files generated by Simplicity Studio (rail_config.*) ends
lines with \r. To pass Zephyr compliance, this patch imports these files
with \r removed:

    sed -i 's/\r//g' */rail_config.[hc]

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
jerome-pouiller added a commit to jerome-pouiller/zephyr-silabs that referenced this pull request Oct 14, 2024
This introduce an example of use of Rail library in Zephyr.

This is a reboot of PR[1]. Compared to the original PR, this version:
  - remove some files imported from Simplicity Studio. Only
    radio_config.[ch] are kept.
  - drop the useless Finite State Machine

[1]: zephyrproject-rtos/hal_silabs#49

For now only two boards (based xg22 and xg24) are supported. I hope to
add support for all the Series-2 boards in the future.

Note Zephyr does not allow to host samples application in HALs. Samples
specific to one board and using non-standard APIs are not very welcomed
in the main repo. So, the Silabs downstream is probably the best (the
only) place to provide publish it.

Also note that files generated by Simplicity Studio (rail_config.*) ends
lines with \r. To pass Zephyr compliance, this patch imports these files
with \r removed:

    sed -i 's/\r//g' */rail_config.[hc]

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
jerome-pouiller added a commit to jerome-pouiller/zephyr-silabs that referenced this pull request Oct 14, 2024
This introduce an example of use of Rail library in Zephyr.

This is a reboot of PR[1]. Compared to the original PR, this version:
  - remove some files imported from Simplicity Studio. Only
    radio_config.[ch] are kept.
  - drop the useless Finite State Machine

[1]: zephyrproject-rtos/hal_silabs#49

For now only two boards (based xg22 and xg24) are supported. I hope to
add support for all the Series-2 boards in the future.

Note Zephyr does not allow to host samples application in HALs. Samples
specific to one board and using non-standard APIs are not very welcomed
in the main repo. So, the Silabs downstream is probably the best (the
only) place to provide publish it.

Also note that files generated by Simplicity Studio (rail_config.*) ends
lines with \r. To pass Zephyr compliance, this patch imports these files
with \r removed:

    sed -i 's/\r//g' */rail_config.[hc]

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
jerome-pouiller added a commit to SiliconLabsSoftware/zephyr-silabs that referenced this pull request Oct 14, 2024
This introduce an example of use of Rail library in Zephyr.

This is a reboot of PR[1]. Compared to the original PR, this version:
  - remove some files imported from Simplicity Studio. Only
    radio_config.[ch] are kept.
  - drop the useless Finite State Machine

[1]: zephyrproject-rtos/hal_silabs#49

For now only two boards (based xg22 and xg24) are supported. I hope to
add support for all the Series-2 boards in the future.

Note Zephyr does not allow to host samples application in HALs. Samples
specific to one board and using non-standard APIs are not very welcomed
in the main repo. So, the Silabs downstream is probably the best (the
only) place to provide publish it.

Also note that files generated by Simplicity Studio (rail_config.*) ends
lines with \r. To pass Zephyr compliance, this patch imports these files
with \r removed:

    sed -i 's/\r//g' */rail_config.[hc]

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
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.

5 participants