Skip to content

cpu/avr8: model kconfig#16929

Merged
maribu merged 26 commits intoRIOT-OS:masterfrom
leandrolanzieri:pr/cpu/avr8/model_kconfig
Nov 23, 2021
Merged

cpu/avr8: model kconfig#16929
maribu merged 26 commits intoRIOT-OS:masterfrom
leandrolanzieri:pr/cpu/avr8/model_kconfig

Conversation

@leandrolanzieri
Copy link
Copy Markdown
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
Copy Markdown
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 :-)

@leandrolanzieri leandrolanzieri requested a review from kYc0o as a code owner October 4, 2021 08:24
@github-actions github-actions bot added the Area: doc Area: Documentation label Oct 4, 2021
@fjmolinas
Copy link
Copy Markdown
Contributor

ping @maribu

Copy link
Copy Markdown
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
Copy Markdown
Contributor

This needs a rebase

@leandrolanzieri leandrolanzieri force-pushed the pr/cpu/avr8/model_kconfig branch from 899b27f to 90a7996 Compare November 1, 2021 08:58
@leandrolanzieri
Copy link
Copy Markdown
Contributor Author

Rebased

@MrKevinWeiss
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

Looks like everything is there, any objections?

@maribu maribu merged commit 68e1d29 into RIOT-OS:master Nov 23, 2021
@maribu
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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