Skip to content

Kconfig: Add CPU and Board common symbols#13715

Merged
aabadie merged 5 commits intoRIOT-OS:masterfrom
leandrolanzieri:pr/kconfig/add_cpu_board_common_symbols
Apr 8, 2020
Merged

Kconfig: Add CPU and Board common symbols#13715
aabadie merged 5 commits intoRIOT-OS:masterfrom
leandrolanzieri:pr/kconfig/add_cpu_board_common_symbols

Conversation

@leandrolanzieri
Copy link
Copy Markdown
Contributor

@leandrolanzieri leandrolanzieri commented Mar 25, 2020

Contribution description

This adds the definitions of common symbols to Kconfig which should be defined for every board/cpu combination, which would somehow mirror the variables we are currently defining in Makefile.features files:

  • BOARD
  • CPU
  • CPU_MODEL
  • CPU_SERIES
  • CPU_FAMILY
  • CPU_ARCH

Now the main Kconfig file will also search for symbols on the currently selected BOARD and CPU.

Also, this changes the file which is included in the build system to one that is generated every time (out.config).

This was originally part of #13404, @jia200x suggested to split it.

Testing procedure

With any board selected, run make menuconfig. Using the search function (/) you should be able to find these hidden symbols. Check that they are displayed correctly.

Edit: As this also changes the Makefile to use out.config, make sure that tests/kconfig still works as expected.

Issues/PRs references

#13404

@leandrolanzieri leandrolanzieri added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation TF: Config Marks issues and PRs related to the work of the Configuration Task Force Area: Kconfig Area: Kconfig integration labels Mar 25, 2020
@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Apr 8, 2020

@leandrolanzieri, this one needs a rebase :)

@aabadie aabadie self-assigned this Apr 8, 2020
@leandrolanzieri leandrolanzieri force-pushed the pr/kconfig/add_cpu_board_common_symbols branch from 9e451b2 to f43eeb4 Compare April 8, 2020 08:45
@leandrolanzieri
Copy link
Copy Markdown
Contributor Author

@aabadie rebased!

@leandrolanzieri
Copy link
Copy Markdown
Contributor Author

I edited the description mentioning that tests/kconfig should also be tested, given the change on the Makefile.

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Apr 8, 2020

Tested the latest version of this PR and this is what I get when running make BOARD=arduino-zero -C examples/hello_world menuconfig:

image

Here is what I get for native:

image

Is it what is expected ?

@leandrolanzieri
Copy link
Copy Markdown
Contributor Author

Is it what is expected ?

Yes, symbols should not have values assigned yet. This is just declaring them. Then each Board/CPU assigns the proper value (like in #13404).

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Apr 8, 2020

I also ran tests/kconfig and it's working.

Details
make -C tests/kconfig/ all test --no-print-directory 
Merged configuration '/work/riot/RIOT-review/tests/kconfig/app.config'
No change to '/work/riot/RIOT-review/tests/kconfig/bin/native/generated/merged.config'
Building application "tests_kconfig" for "native" with MCU "native".

"make" -C /work/riot/RIOT-review/boards/native
"make" -C /work/riot/RIOT-review/boards/native/drivers
"make" -C /work/riot/RIOT-review/core
"make" -C /work/riot/RIOT-review/cpu/native
"make" -C /work/riot/RIOT-review/cpu/native/periph
"make" -C /work/riot/RIOT-review/cpu/native/stdio_native
"make" -C /work/riot/RIOT-review/cpu/native/vfs
"make" -C /work/riot/RIOT-review/drivers
"make" -C /work/riot/RIOT-review/drivers/periph_common
"make" -C /work/riot/RIOT-review/sys
"make" -C /work/riot/RIOT-review/sys/auto_init
"make" -C /work/riot/RIOT-review/sys/test_utils/interactive_sync
   text	   data	    bss	    dec	    hex	filename
  25086	    572	  47728	  73386	  11eaa	/work/riot/RIOT-review/tests/kconfig/bin/native/tests_kconfig.elf
r
Merged configuration '/work/riot/RIOT-review/tests/kconfig/app.config'
No change to '/work/riot/RIOT-review/tests/kconfig/bin/native/generated/merged.config'
/work/riot/RIOT-review/tests/kconfig/bin/native/tests_kconfig.elf  
RIOT native interrupts/signals initialized.
LED_RED_OFF
LED_GREEN_ON
RIOT native board initialized.
RIOT native hardware initialization complete.

Help: Press s to start test, r to print it is ready
READY
s
START
main(): This is RIOT! (Version: 2020.04-devel-2007-gf43ee-review_kconfig_boards)
Message 1 defined in app.config file
MSG_2 is active

Copy link
Copy Markdown
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

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

ACK

@aabadie aabadie added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Apr 8, 2020
@leandrolanzieri leandrolanzieri added this to the Release 2020.04 milestone Apr 8, 2020
@leandrolanzieri
Copy link
Copy Markdown
Contributor Author

The usb_minimal example is failing. I will investigate

@leandrolanzieri
Copy link
Copy Markdown
Contributor Author

@aabadie I was missing a before the &: separator in kconfig.mk. Also I'm piggybacking a commit not to run Kconfig on usb_minimal by default.

'merged.config' may not always be present (e.g. when no files to merge
are present). In order to always have an up-to-date configuration file
'out.config' will be generated mirroring the content of 'autoconf.h'.
This is the file that the build system will include to read the current
configuration symbols.
The symbols used to define a CPU are:
- CPU
- CPU_MODEL
- CPU_FAMILY
- CPU_ARCH
@leandrolanzieri leandrolanzieri force-pushed the pr/kconfig/add_cpu_board_common_symbols branch from 24bfaa3 to 89bea02 Compare April 8, 2020 15:37
@aabadie aabadie merged commit 9f78132 into RIOT-OS:master Apr 8, 2020
@leandrolanzieri leandrolanzieri deleted the pr/kconfig/add_cpu_board_common_symbols branch April 8, 2020 17:19
@leandrolanzieri
Copy link
Copy Markdown
Contributor Author

Thanks @aabadie for reviewing and testing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Kconfig Area: Kconfig integration CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR TF: Config Marks issues and PRs related to the work of the Configuration Task Force Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants