-
Notifications
You must be signed in to change notification settings - Fork 2k
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
boards/common/stm32: Fix LED configuration #18568
Conversation
@krzysztof-cabaj: Could you give this another test? It is important to check with the macros, rather than via |
Luckily, #18415 didn't make it into the release :) |
@maribu - what exactly should I test? Simple program with |
Yes. I do believe that e.g. with this diff --git a/examples/hello-world/main.c b/examples/hello-world/main.c
index f51bf8c0a0..84b88c8fb2 100644
--- a/examples/hello-world/main.c
+++ b/examples/hello-world/main.c
@@ -21,10 +21,14 @@
#include <stdio.h>
+#include "board.h"
+
int main(void)
{
puts("Hello World!");
+ LED0_ON;
+
printf("You are running RIOT on a(n) %s board.\n", RIOT_BOARD);
printf("This board features a(n) %s MCU.\n", RIOT_MCU); The STM32 disco board with inverted LED will have the LED0 off, instead of of with |
@maribu Thanks for clarification. I conduct tests during weekend and describe results ASAP. |
@maribu I use simple program as in you response, only with RIOT / master (commit 7fce013) stm32f469i-disco OK (1 on, 3 off) maribu / boards/common/stm32 (commit 73ad5f6) stm32f469i-disco FAILED (1 off, 3 on) maribu / master (commit 1066195) I looked at Nucleo-L552ZE-Q board documentation and in my opinion this particular board do not invert LEDs - see section 6.5, page 22. |
If I understand correctly, this breaks behavior for the stm32f4691-disco (it worked correctly when LEDs was configured as not inverted). But it does fix the issue for the Nucleo-L552Z by inverting all LEDs for the Nulceo-144 boards. However, the documentation of that Nucleo indicates it should actually be not inverted. Does the setting the LED via the |
73ad5f6
to
42eb33f
Compare
The LEDs on the Now all should be correct in this PR. |
I checked current version of this PR on stm32f469i-disco and now my simple program which use However, I have some doubts concerning "naming conversion". For me - inverted LED means that it is ON when we have signal 0/LOW and OFF when we have 1/HIGH signal. But looking at STM docs and current |
42eb33f
to
1324c5f
Compare
The inverted and non-inverted `LED<num>_ON` and `LED<num>_OFF` macros are swapped. This didn't reveal in testing as the `LED<num>_IS_INVERTED` macros where not properly evaluated, due to a typo in the check. This fixes both.
1324c5f
to
77270e2
Compare
Ah, that was the issue :) |
Thx for testing and confirming :) |
Thx everyone! |
Contribution description
The inverted and non-inverted
LED<num>_ON
andLED<num>_OFF
macros are swapped. This didn't reveal in testing as theLED<num>_IS_INVERTED
macros where not properly evaluated, due to a typo in the check. This fixes both.Testing procedure
I noticed the issues when flashing
examples/saul
on a Nucleo-F767ZI and all LEDs went up like on a xmas treeIssues/PRs references
Regression introduced by #18415