8000 boards/nucleo64: Add Compile Warning about LED0 when using SPI by crasbe · Pull Request #21338 · RIOT-OS/RIOT · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

boards/nucleo64: Add Compile Warning about LED0 when using SPI #21338

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

Merged
merged 1 commit into from
Apr 2, 2025

Conversation

crasbe
Copy link
Contributor
@crasbe crasbe commented Mar 29, 2025

Contribution description

The issue #21336 by @tanneberger raised the issue that the buildsystem will quietly disable LED0 when using periph_spi. While this is unavoidable, it is unfortunate that this is done quietly.

Therefore this PR adds a red warning when using periph_spi to notify the user about this behavior.
Further documentation will be added in #21337, because the boards/common/nucleo64/doc.md does not exist yet where this information would belong to.

During the development of this PR I noticed that periph_init_led0 got added to DISABLE_MODULE three times. While this doesn't hurt anything, it doesn't help anything either. Since I wanted to avoid that the warning is printed three times as well, I added a check to only add it once.

Testing procedure

Compile an application of your choice for a Nucleo64 board of your choice, enabling periph_spi.

cbuec@W11nMate:~/RIOTstuff/riot-nucleo64-spi-led/RIOT$ USEMODULE+=periph_spi BOARD=nucleo-f446re make -C tests/sys/shell
make: Entering directory '/home/cbuec/RIOTstuff/riot-nucleo64-spi-led/RIOT/tests/sys/shell'
Warning: Using periph_spi will disable LED0 due to pin conflicts.
Building application "tests_shell" for "nucleo-f446re" with CPU "stm32".

"make" -C /home/cbuec/RIOTstuff/riot-nucleo64-spi-led/RIOT/pkg/cmsis/
"make" -C /home/cbuec/RIOTstuff/riot-nucleo64-spi-led/RIOT/boards
...

image

Issues/PRs references

Fixes #21336.

@crasbe crasbe added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Mar 29, 2025
@crasbe crasbe requested a review from aabadie as a code owner March 29, 2025 23:44
@github-actions github-actions bot added the Area: boards Area: Board ports label Mar 29, 2025
@riot-ci
Copy link
riot-ci commented Mar 29, 2025

Murdock results

✔️ PASSED

a74927f boards/nucleo64: add compile warning about LED0 when using SPI

Success Failures Total Runtime
10287 0 10287 14m:43s

Artifacts

Copy link
Contributor
@mguetschow mguetschow left a comment

Choose a reason for hiding this comment

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

Thanks!

@mguetschow< 8000 /a> mguetschow added this pull request to the merge queue Mar 31, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 31, 2025
@mguetschow mguetschow added this pull request to the merge queue Mar 31, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 31, 2025
@crasbe crasbe added this pull request to the merge queue Mar 31, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 31, 2025
@crasbe crasbe added this pull request to the merge queue Apr 1, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 1, 2025
@crasbe
Copy link
Contributor Author
crasbe commented Apr 1, 2025

The CI was unhappy because the warning was printed to stdout. It tried to interpret the warning and obviously failed.

@mguetschow suggested to print the warning to stderr, that's what the fixup now does.

One thing that remains is that the warning will be printed a lot for commands like info-boards-supported and I'm unsure how to avoid it:

cbuec@W11nMate:~/RIOTstuff/riot-nucleo64-spi-led/RIOT$ make -C tests/drivers/enc28j60 info-boards-supported
make: Entering directory '/home/cbuec/RIOTstuff/riot-nucleo64-spi-led/RIOT/tests/drivers/enc28j60'
Warning: Using periph_spi on Nucleo64 boards will disable LED0 due to pin conflicts.
Warning: Using periph_spi on Nucleo64 boards will disable LED0 due to pin conflicts.
Warning: Using periph_spi on Nucleo64 boards will disable LED0 due to pin conflicts.
Warning: Using periph_spi on Nucleo64 boards will disable LED0 due to pin conflicts.
Warning: Using periph_spi on Nucleo64 boards will disable LED0 due to pin conflicts.
Warning: Using periph_spi on Nucleo64 boards will disable LED0 due to pin conflicts.
Warning: Using periph_spi on Nucleo64 boards will disable LED0 due to pin conflicts.
Warning: Using periph_spi on Nucleo64 boards will disable LED0 due to pin conflicts.
Warning: Using periph_spi on Nucleo64 boards will disable LED0 due to pin conflicts.
Warning: Using periph_spi on Nucleo64 boards will disable LED0 due to pin conflicts.
Warning: Using periph_spi on Nucleo64 boards will disable LED0 due to pin conflicts.
Warning: Using periph_spi on Nucleo64 boards will disable LED0 due to pin conflicts.
Warning: Using periph_spi on Nucleo64 boards will disable LED0 due to pin conflicts.
Warning: Using periph_spi on Nucleo64 boards will disable LED0 due to pin conflicts.
Warning: Using periph_spi on Nucleo64 boards will disable LED0 due to pin conflicts.
Warning: Using periph_spi on Nucleo64 boards will disable LED0 due to pin conflicts.
Warning: Using periph_spi on Nucleo64 boards will disable LED0 due to pin conflicts.
Warning: Using periph_spi on Nucleo64 boards will disable LED0 due to pin conflicts.
Warning: Using periph_spi on Nucleo64 boards will disable LED0 due to pin conflicts.
Warning: Using periph_spi on Nucleo64 boards will disable LED0 due to pin conflicts.
Warning: Using periph_spi on Nucleo64 boards will disable LED0 due to pin conflicts.
Warning: Using periph_spi on Nucleo64 boards will disable LED0 due to pin conflicts.
Warning: Using periph_spi on Nucleo64 boards will disable LED0 due to pin conflicts.
Warning: Using periph_spi on Nucleo64 boards will disable LED0 due to pin conflicts.
acd52832 adafruit-clue adafruit-grand-central-m4-express adafruit-itsybitsy-m4 adafruit-itsybitsy-nrf52 adafruit-metro-m4-express adafruit-pybadge airfy-beacon arduino-due arduino-duemilanove arduino-leonardo arduino-mega2560 arduino-mkr1000 arduino-mkrfox1200 arduino-mkrwan1300 arduino-mkrzero arduino-nano arduino-nano-33-ble arduino-nano-33-ble-sense arduino-nano-33-iot arduino-uno arduino-zero atmega1284p atmega256rfr2-xpro atmega328p atmega328p-xplained-mini atmega8 atxmega-a1-xplained atxmega-a1u-xpro atxmega-a3bu-xplained avr-rss2 avsextrem b-l072z-lrwan1 b-l475e-iot01a bastwan blackpill-stm32f103c8 blackpill-stm32f103cb bluepill-stm32f030c8 bluepill-stm32f103c8 bluepill-stm32f103cb cc2538dk derfmega128 derfmega256 dwm1001 e104-bt5010a-tb e104-bt5011a-tb ek-lm4f120xl esp32-ethernet-kit-v1_0 esp32-ethernet-kit-v1_1 esp32-ethernet-kit-v1_2 esp32-heltec-lora32-v2 esp32-mh-et-live-minikit esp32-olimex-evb esp32-ttgo-t-beam esp32-wemos-lolin-d32-pro esp32-wroom-32 esp32-wrover-kit esp32c3-devkit esp32c3-wemos-mini esp32s2-devkit esp32s2-lilygo-ttgo-t8 esp32s2-wemos-mini esp32s3-box esp32s3-devkit esp32s3-pros3 esp32s3-usb-otg esp32s3-wt32-sc01-plus esp8266-esp-12x esp8266-olimex-mod esp8266-sparkfun-thing feather-m0 feather-m0-lora feather-m0-wifi feather-nrf52840 feather-nrf52840-sense firefly frdm-k22f frdm-k64f frdm-kw41z gd32vf103c-start generic-cc2538-cc2592-dk hamilton hifive1 hifive1b i-nucleo-lrwan1 ikea-tradfri im880b iotlab-a8-m3 iotlab-m3 limifrog-v1 lobaro-lorabox lora-e5-dev lsn50 maple-mini mcb2388 mega-xplained microbit-v2 microduino-corerf msb-430h msba2 msbiot mulle native native64 nrf51dk nrf52840-mdk nrf52840dk nrf52840dongle nrf52dk nrf5340dk-app nrf9160dk nucleo-c031c6 nucleo-f030r8 nucleo-f031k6 nucleo-f042k6 nucleo-f070rb nucleo-f072rb nucleo-f091rc nucleo-f103rb nucleo-f207zg nucleo-f302r8 nucleo-f303k8 nucleo-f303re nucleo-f303ze nucleo-f334r8 nucleo-f401re nucleo-f410rb nucleo-f411re nucleo-f412zg nucleo-f413zh nucleo-f429zi nucleo-f439zi nucleo-f446re nucleo-f446ze nucleo-f746zg nucleo-f767zi nucleo-g070rb nucleo-g071rb nucleo-g431rb nucleo-g474re nucleo-l011k4 nucleo-l031k6 nucleo-l053r8 nucleo-l073rz nucleo-l152re nucleo-l412kb nucleo-l432kc nucleo-l433rc nucleo-l452re nucleo-l476rg nucleo-l496zg nucleo-l4r5zi nucleo-l552ze-q nucleo-wl55jc nz32-sc151 olimex-msp430-h1611 olimex-msp430-h2618 olimexino-stm32 omote openlabs-kw41z-mini openlabs-kw41z-mini-256kib openmote-b openmote-cc2538 p-l496g-cell02 p-nucleo-wb55 particle-argon particle-boron particle-xenon pba-d-01-kw2x phynode-kw41z pinetime pyboard qn9080dk reel remote-pa remote-reva remote-revb rpi-pico rpi-pico-w ruuvitag samd10-xmini samd20-xpro samd21-xpro same51-curiosity-nano same54-xpro saml10-xpro saml11-xpro saml21-xpro samr21-xpro samr30-xpro samr34-xpro seeedstudio-gd32 seeedstudio-xiao-esp32c3 seeedstudio-xiao-nrf52840 seeeduino_xiao sensebox_samd21 serpente sipeed-longan-nano sipeed-longan-nano-tft slstk3400a slstk3401a slstk3402a slstk3701a sltb001a sltb009a slwstk6000b-slwrb4150a slwstk6000b-slwrb4162a slwstk6220a sodaq-autonomo sodaq-explorer sodaq-one sodaq-sara-aff sodaq-sara-sff spark-core stk3200 stk3600 stk3700 stm32f030f4-demo stm32f0discovery stm32f3discovery stm32f429i-disc1 stm32f429i-disco stm32f469i-disco stm32f4discovery stm32f723e-disco stm32f746g-disco stm32f7508-dk stm32l0538-disco stm32l496g-disco telosb ublox-c030-u201 udoo usb-kw41z waveshare-nrf52840-eval-kit weact-f401cc weact-f401ce weac
8000
t-f411ce wemos-zero xg23-pk6068a yarm yunjia-nrf51822 z1 zigduino
make: Leaving directory '/home/cbuec/RIOTstuff/riot-nucleo64-spi-led/RIOT/tests/drivers/enc28j60'

I added the "Nucleo64" remark so that it's a bit more obvious what causes the warning.

@mguetschow
Copy link
Contributor

One thing that remains is that the warning will be printed a lot for commands like info-boards-supported and I'm unsure how to avoid it

Reminds me of this printout for PSA Crypto having the same issue.

ifneq (,$(filter psa_crypto,$(USEMODULE)))
$(shell $(COLOR_ECHO) "$(COLOR_YELLOW) You are going to use the PSA Crypto module,"\
"which is only partly implemented and not yet thouroughly tested.\n"\
"Please do not use this module in production, as it may introduce"\
"security issues!$(COLOR_RESET)" 1>&2)
endif

I'd say fixing this is an exercise for a potential follow-up PR. Please squash!

@crasbe
Copy link
Contributor Author
crasbe commented Apr 1, 2025

It would be possible to exclude the warning for $(MAKECMDGOALS) = info-boards-supported and other targets, but that would probably become a long list. Or the other possibility would be to set a list of goals that the warning should be printed 🤔

Also it would be possible to exclude the CI by checking $(RIOT_CI_BUILD).

@crasbe crasbe force-pushed the pr/nucleo64-spiled-warning branch from e026b75 to a74927f Compare April 1, 2025 12:42
@maribu maribu enabled auto-merge April 2, 2025 09:17
@maribu maribu added this pull request to the merge queue Apr 2, 2025
Merged via the queue into RIOT-OS:master with commit 1f3a693 Apr 2, 2025
26 checks passed
@crasbe
Copy link
Contributor Author
crasbe commented Apr 2, 2025

Thanks for helping with the CI errors :)

@crasbe crasbe deleted the pr/nucleo64-spiled-warning branch April 2, 2025 12:35
@mguetschow mguetschow added this to the Release 2025.04 milestone Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR 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.

nucleo-f446re problem with using the led and spi at the same time
5 participants
0