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

cpu/avr8: model kconfig #16929

Merged
merged 26 commits into from
Nov 23, 2021
Merged

Conversation

leandrolanzieri
Copy link
Contributor

Contribution description

This models the Kconfig modules for all avr8-based CPUs and boards. I only included a subset of the enabled boards for CI testing, one per modelled CPU model. The complete list is:

  • arduino-duemilanove
  • arduino-leonardo
  • arduino-mega2560
  • arduino-nano
  • arduino-uno
  • atmega1284p
  • atmega256rfr2-xpro
  • atmega328p-xplained-mini
  • atmega328p
  • atxmega-a1-xplained
  • atxmega-a1u-xpro
  • atxmega-a3bu-xplained
  • avr-rss2
  • derfmega128
  • derfmega256
  • mega-xplained
  • microduino-corerf
  • zigduino

A note on driver modelling

This also includes some changes on the modelling of certain drivers. The idea is that platforms can select HAVE_ hidden symbols to indicate on-board hardware, and then drivers can use this information to change their default value (e.g. a sensor driver would enable itself if the platform has it and MODULE_SAUL_DEFAULT is selected). To deal with this default, without falling into this issue, the prompts are hidden. The approach has been discussed offline with @fjmolinas and @MrKevinWeiss, but of course open for discussion.

For examples of this see 00b61cc and 0f960c2.

Testing procedure

  • Green CI
  • Check the modelling and compare make info-modules list with and without TEST_KCONFIG=1, they should match.

Issues/PRs references

#16875

@leandrolanzieri leandrolanzieri added Type: new feature The issue requests / The PR implemements a new feature for RIOT Platform: AVR Platform: This PR/issue effects AVR-based platforms labels Oct 1, 2021
@github-actions github-actions bot added Area: boards Area: Board ports Area: CI Area: Continuous Integration of RIOT components Area: cpu Area: CPU/MCU ports Area: drivers Area: Device drivers Area: Kconfig Area: Kconfig integration Area: sys Area: System labels Oct 1, 2021
Copy link
Member

@maribu maribu left a comment

Choose a reason for hiding this comment

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

lgtm :-)

cpu/atmega_common/periph/Kconfig Outdated Show resolved Hide resolved
cpu/atmega_common/periph/Kconfig Show resolved Hide resolved
drivers/at30tse75x/Kconfig Outdated Show resolved Hide resolved
@github-actions github-actions bot added the Area: doc Area: Documentation label Oct 4, 2021
@fjmolinas
Copy link
Contributor

ping @maribu

Copy link
Member

@maribu maribu left a comment

Choose a reason for hiding this comment

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

ACK :-)

@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Oct 14, 2021
@benpicco
Copy link
Contributor

This needs a rebase

@leandrolanzieri
Copy link
Contributor Author

Rebased

@MrKevinWeiss
Copy link
Contributor

it seems the rebase introduced some differences, for one the make version of tests/driver_bq2429x now has periph_init_nvm periph_nvm modules and the kconfig is missing them (even though there is no difference in the binary)

@MrKevinWeiss
Copy link
Contributor

side note, maybe we should get murdock to run something like make clean -C $TEST && make info-modules -C $TEST > /tmp/no-kconfig && make clean -C $TEST && TEST_KCONFIG=1 make info-modules -C $TEST > /tmp/kconfig && diff /tmp/no-kconfig /tmp/kconfig with maybe a pkg variant too when something is failed to make the error a bit clearer?

@leandrolanzieri
Copy link
Contributor Author

it seems the rebase introduced some differences, for one the make version of tests/driver_bq2429x now has periph_init_nvm periph_nvm modules and the kconfig is missing them (even though there is no difference in the binary)

I added f41b8a2. AFAIU periph_nvm is needed when periph_cpuid.

@maribu
Copy link
Member

maribu commented Nov 1, 2021

Some background for the waspmote-pro issue: xtimer is not compatible with boards that do not have timers running at frequencies that can be converted to 1 MHz via shifting only, except for 32.768 kHz which also works.

The waspmote-pro pulls in the xtimer_on_ztimer module if xtimer is used, as ztimer can convert via ztimer_convert_frac arbitrary frequencies fast with good enough precision, or with ztimer_convert_muldiv64 arbitrary frequencies with high precision but slower.

If code includes xtimer.h without xtimer_on_ztimer used, it will check that the timer frequency is compatible with xtimer.

I think that the hard dependency on xtimer_on_ztimer (or ztimer_xtimer_compat would also be fine) is missing for the waspmote-pro in Kconfig. That dependency is only required if xtimer is used.

This introduces a Kconfig file for boards that cannot reach a timer frequency
compatible with xtimer. For those boards, in the case xtimer is pulled,
ztimer is used instead (as backend) with a compatibility module.
Modelled boards:

arduino-duemilanove
arduino-leonardo
arduino-mega2560
arduino-nano
arduino-uno
atmega1284p
atmega256rfr2-xpro
atmega328p-xplained-mini
atmega328p
atxmega-a1-xplained
atxmega-a1u-xpro
atxmega-a3bu-xplained
avr-rss2
derfmega128
derfmega256
mega-xplained
microduino-corerf
zigduino
@MrKevinWeiss
Copy link
Contributor

Looks like everything is there, any objections?

@maribu maribu merged commit 68e1d29 into RIOT-OS:master Nov 23, 2021
@maribu
Copy link
Member

maribu commented Nov 23, 2021

Phew. It would have been a pity if that had to go another round just because yet another merge conflict ...

@leandrolanzieri
Copy link
Contributor Author

Thanks everyone !

@leandrolanzieri leandrolanzieri deleted the pr/cpu/avr8/model_kconfig branch November 23, 2021 08:26
config MODULE_AT24MAC
bool "AT24MAC unique ID chip"
bool
prompt "AT24MAC unique ID chip" if !(MODULE_EUI_PROVIDER && HAVE_AT24MAC)
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems for the same54-xpro, MODULE_MTD would also bring in MODULE_AT24MAC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: arduino API Area: Arduino wrapper API Area: boards Area: Board ports Area: build system Area: Build system Area: CI Area: Continuous Integration of RIOT components Area: cpu Area: CPU/MCU ports Area: doc Area: Documentation Area: drivers Area: Device drivers Area: Kconfig Area: Kconfig integration Area: pkg Area: External package ports Area: sys Area: System Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: AVR Platform: This PR/issue effects AVR-based platforms Type: new feature The issue requests / The PR implemements a new feature for RIOT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants