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

west.yml: Add hal gigadevice #38658

Closed

Conversation

nandojve
Copy link
Member

This add modules/hal/gigadevice with three firmware libraries:

  • GD32E103 ARM (Cortex-M4F)
  • GD32F403 ARM (Cortex-M4F)
  • GD32VF103 RISC-V (Nucleisys Bumblebee core)

Signed-off-by: Gerson Fernando Budke gerson.budke@atl-electronics.com

@github-actions
Copy link

github-actions bot commented Sep 19, 2021

The following west manifest projects have been modified in this Pull Request:

Name Old Revision New Revision Diff
hal_gigadevice N/A zephyrproject-rtos/hal_gigadevice@ce323de (main) N/A

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@nandojve nandojve added the DNM This PR should not be merged (Do Not Merge) label Sep 22, 2021
@nandojve nandojve changed the title west.yml: Add hal gigadevice [DNM] west.yml: Add hal gigadevice Sep 22, 2021
Copy link
Member

@gmarull gmarull 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 effort, overall LGTM. I think that HAL should be compiled in a more efficient manner, as it is done, e.g. by STM32:

# create a library and include sources as needed, e.g.
zephyr_sources(standard_peripheral/Source/gd32e10x_adc.c)
# should become
zephyr_library_sources_ifdef(CONFIG_USE_GD32_HAL_ADC standard_peripheral/Source/gd32e10x_adc.c)

west.yml Outdated Show resolved Hide resolved
@nandojve nandojve force-pushed the gd32_zephyr_hal_gigadevice branch from dfef522 to 27858b6 Compare September 24, 2021 01:18
@nandojve nandojve requested a review from nashif as a code owner September 24, 2021 01:18
@github-actions github-actions bot removed the DNM This PR should not be merged (Do Not Merge) label Sep 24, 2021
@nandojve nandojve force-pushed the gd32_zephyr_hal_gigadevice branch from 27858b6 to e759c67 Compare September 24, 2021 01:24
@nandojve nandojve requested a review from gmarull September 24, 2021 02:46
@nandojve nandojve force-pushed the gd32_zephyr_hal_gigadevice branch 4 times, most recently from f1f1db3 to 703f6ed Compare September 25, 2021 20:23
@nandojve nandojve requested a review from gmarull September 25, 2021 20:26
@cfriedt cfriedt added the DNM This PR should not be merged (Do Not Merge) label Sep 29, 2021
@cfriedt cfriedt changed the title [DNM] west.yml: Add hal gigadevice west.yml: Add hal gigadevice Sep 29, 2021
@nandojve nandojve force-pushed the gd32_zephyr_hal_gigadevice branch from 703f6ed to 93be130 Compare October 2, 2021 16:57
@github-actions github-actions bot removed the DNM This PR should not be merged (Do Not Merge) label Oct 2, 2021
@nandojve
Copy link
Member Author

nandojve commented Oct 2, 2021

rebase

@nandojve nandojve added the DNM This PR should not be merged (Do Not Merge) label Oct 2, 2021
@nandojve nandojve force-pushed the gd32_zephyr_hal_gigadevice branch 2 times, most recently from fac351c to 3ef908e Compare October 18, 2021 23:59
Copy link
Collaborator

@tejlmand tejlmand left a comment

Choose a reason for hiding this comment

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

Some minor nits observed that you can address if you like.

Also please reply to this:
#38658 (comment)

Could you update the commit message, currently it states:

west.yml: Add gigadevice hal

This add modules/hal/gigadevice with three firmware libraries:

  • GD32E10X ARM (Cortex-M4F)
  • GD32F403 ARM (Cortex-M4F)
  • GD32VF103 RISC-V (Nucleisys Bumblebee core)

but with your latest push, this commit does a lot more than just updating west.yml

modules/hal_gigadevice/CMakeLists.txt Outdated Show resolved Hide resolved
modules/hal_gigadevice/CMakeLists.txt Outdated Show resolved Hide resolved
modules/hal_gigadevice/CMakeLists.txt Outdated Show resolved Hide resolved
@nandojve nandojve force-pushed the gd32_zephyr_hal_gigadevice branch from 3ef908e to 6559679 Compare October 19, 2021 12:13
@nandojve
Copy link
Member Author

Hi @tejlmand ,

Thank you for your comments.

but with your latest push, this commit does a lot more than just updating west.yml

You are right, I split commit to distinguish both details. Since review started a lot of changes were made, including move rules from module to zephyr. If it is required, I can move rules commit to #38661.

@tejlmand
Copy link
Collaborator

You are right, I split commit to distinguish both details. Since review started a lot of changes were made, including move rules from module to zephyr.

Yes, this is common to happen as PR evolves.
Exactly why I usually take a second look at the commit message (those are important during bisect)

Having two commits is fine as long as the code is still bisectable, which seems to be the case in this PR, as the manifest commit is first commit.

If it is required, I can move rules commit to #38661.

No need, I think it is fine as it is.

Copy link
Collaborator

@tejlmand tejlmand left a comment

Choose a reason for hiding this comment

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

Actually I was wrong on this, the PR is not bisectable.

If trying to bisect, the first commit fails as the glue code is not present with the new Zephyr module, so please squash the commits into a single commit..

Error seen:

Parsing /projects/github/ncs/zephyr/Kconfig
/projects/github/ncs/zephyr/scripts/kconfig/kconfig.py: build/Kconfig/Kconfig.modules:8: Could not open '/projects/github/ncs/zephyr/' (in 'osource "$(ZEPHYR_HAL_GIGADEVICE_KCONFIG)"') (EISDIR: Is a directory)
CMake Error at /projects/github/ncs/zephyr/cmake/kconfig.cmake:269 (message):
  command failed with return code: 1
Call Stack (most recent call first):
  /projects/github/ncs/zephyr/cmake/app/boilerplate.cmake:542 (include)
  /projects/github/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
  /projects/github/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:60 (include_boilerplate)
  CMakeLists.txt:5 (find_package)


-- Configuring incomplete, errors occurred!

@nandojve nandojve force-pushed the gd32_zephyr_hal_gigadevice branch from 6559679 to 4a5369a Compare October 19, 2021 13:44
@nandojve
Copy link
Member Author

If trying to bisect, the first commit fails as the glue code is not present with the new Zephyr module, so please squash the commits into a single commit..

Done!

Below didn't pass CI because CONFIG_SOC_SERIES_GD32F403 is not yet defined.

if(CONFIG_SOC_SERIES_GD32F403)
  set(gd32_soc_uc GD32F403)
  set(gd32_soc_lc gd32f403)
endif()

I initially added only the test condition for gd32_soc_uc to ensure no one will use without proper defines. The entry should be added on each SoC series from now. It has been a lot of back and forward but result has become very good.
Thank you all for the tips!

@tejlmand
Copy link
Collaborator

Below didn't pass CI because CONFIG_SOC_SERIES_GD32F403 is not yet defined.

That doesn't sound right, cause in CMake CONFIG_SOC_SERIES_GD32F403 will just be an undefined var and resolve to FALSE when not available in Kconfig yet.

Something else must have been causing the error.

@nandojve
Copy link
Member Author

Below didn't pass CI because CONFIG_SOC_SERIES_GD32F403 is not yet defined.

That doesn't sound right, cause in CMake CONFIG_SOC_SERIES_GD32F403 will just be an undefined var and resolve to FALSE when not available in Kconfig yet.

Something else must have been causing the error.

I probably express myself wrongly, The error was just a compliance check, it not occurred at buildkite. When I told CI, I mean not 100% green on all checks.

@nandojve nandojve force-pushed the gd32_zephyr_hal_gigadevice branch from 4a5369a to 0d5ad8f Compare October 19, 2021 18:26
@nandojve
Copy link
Member Author

Hi @tejlmand ,

It seems everything is green again. I checked that library is Ok with current configs.
Can you revisit and look at CMakeLists.txt ?

modules/hal_gigadevice/CMakeLists.txt Outdated Show resolved Hide resolved
@tejlmand
Copy link
Collaborator

I probably express myself wrongly, The error was just a compliance check, it not occurred at buildkite. When I told CI, I mean not 100% green on all checks.

yep, I see the error in the compliance check.

In that case, I would actually recommend that this PR becomes part of #38661
Of course it's always nice if PRs with multiple commits can be split into independent pieces, but it seems that this PR and #38661 are closely coupled.

@nandojve
Copy link
Member Author

I probably express myself wrongly, The error was just a compliance check, it not occurred at buildkite. When I told CI, I mean not 100% green on all checks.

yep, I see the error in the compliance check.

In that case, I would actually recommend that this PR becomes part of #38661 Of course it's always nice if PRs with multiple commits can be split into independent pieces, but it seems that this PR and #38661 are closely coupled.

After a lot of changes a more robust rules for this SoC were achieved. I afraid that if we join both PRs we may loose test conditions. For instance, The Fatal condition has been checked with/without CONFIG_SOC_SERIES_GD32xxx and passes on both cases. Since we are testing this PR and #38661 we cover both situations.

modules/hal_gigadevice/Kconfig Show resolved Hide resolved
modules/hal_gigadevice/CMakeLists.txt Show resolved Hide resolved
modules/hal_gigadevice/CMakeLists.txt Show resolved Hide resolved
modules/hal_gigadevice/CMakeLists.txt Outdated Show resolved Hide resolved
This add access to modules/hal/gigadevice with three firmware
libraries by updating west.yaml file:

 - GD32E10X ARM (Cortex-M4F)
 - GD32F403 ARM (Cortex-M4F)
 - GD32VF103 RISC-V (Nucleisys Bumblebee core)

It introduce module/hal_gigadevice, which contains all Cmake
and Kconfig rules to build GigaDevice SoCs into zephyr main
tree.

Signed-off-by: Gerson Fernando Budke <gerson.budke@atl-electronics.com>
@nandojve nandojve force-pushed the gd32_zephyr_hal_gigadevice branch from 0d5ad8f to 43ce67b Compare October 21, 2021 12:05
@nandojve
Copy link
Member Author

I agreed that this PR became essential part of #38661. We already covered the edge cases. I'll close here and keep it only at #38661.
Thank you for all contributions.

@nandojve nandojve closed this Oct 21, 2021
@nandojve nandojve deleted the gd32_zephyr_hal_gigadevice branch October 21, 2021 16:45
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