-
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/arduino-atmega: fix issue with wrong port for LED0 #18245
Conversation
Aha! And I always thought the LED on my cheap clones was broken / misplaced :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK. Thanks for the fix!
seem strange to me (first look) to put non common defines into |
Thanks for rapid service! |
ef8df07
to
1e8c798
Compare
I totally agree (both)! |
Thanks for the fix! :) |
Can we add this commit to the 2022.04-branch? Should I make new PR directly into that branch? Currently examples/blinky did not work for arduino UNO and MEGA both in master nor 2022.04-branch. However, when this commit is added to 2022.04-branch everything works. Of course this is only workaround before problem with |
This could be backported, however, it does work in What is the |
I checked once again, and with this commit, with my @valentinpi could you test this PR on your board? |
The last change in I just tried again with |
Very strange situation. I double-checked everything and still I have different effects for master and 2022.04-branch code. Master - HEAD -> 32a1c22, 2022.04-branch - initially HEAD -> 657adb1 with cherry-picked 1e8c798. In such environment Code compiled from 2022.04-branch - this works (6 bytes/3 instructions smaller).
Code compiled from master
|
That's strange. I could not see any change to Can you delete the Could you also try with |
Well this is... Interesting. Testing out the following very simple firmware with my Arduino Nano: #include <ztimer.h>
int main(void) {
while (1) {
ztimer_sleep(ZTIMER_SEC, 1);
}
return 0;
} APPLICATION = beepy
RIOTBASE ?= ../RIOT
BOARD ?= arduino-nano
MAKEFLAGS += -j
DEVELHELP ?= 1
QUIET ?= 1
# See https://github.com/qmk/qmk_firmware/issues/17064
CFLAGS += -Wno-array-bounds
USEMODULE += ztimer
USEMODULE += ztimer_sec
include $(RIOTBASE)/Makefile.include Flashing via:
Yields a stack overflow:
This worked when I reported the problem. Regarding the LED: It is still not working for some strange reason. I have not tested the fix on my Arduino Uno. Also, I still cannot ping my small beeper. What I mean by that is that the following firmware does not function as expected: #include <periph/gpio.h>
int main(void) {
const gpio_t SPKR_PIN = GPIO_PIN(1, 1);
gpio_init(SPKR_PIN, GPIO_OUT);
gpio_set(SPKR_PIN);
while (1) {
}
return 0;
} Makefile and flashing commands as above. The beeper is connected to the pin D9, which is PB1. Maybe for some background: I just wanted to make a very small application that has a proximity sensor and this beeper, and when something gets close to it the beeper should beep. But the GPIO is not working as I expect it to. Regarding the parts: The beeper and the LED are both working when they are bridged to the 3.3V connection, so I suspect the HW is fine. |
Could you peovide the Is the RIOT welcome message printed, or does it get stuck during boot? |
Oh I provided the makefile. It is for both firmwares. The RIOT welcome message gets printed, I appended a small log. |
Yes, I clean manually
I try to do this further in the week. |
Did you test it using most recent |
I just ran I can reproduce the detected stack overflow and will investigate. I think the issue is that AVR doesn't have an ISR stack and the timer ISR victimizes the stack of the idle thread, which is too small. Unrelated to the issue at hand, but still worth pointing out: Using |
I also can reproduce the issue with PB1 not being set in the application from #18245 (comment) while it does work with the latest stable branch. I was able to reproduce with both an Arduino UNO as well with a custom ATmega1284P board that has a JTAG connector, so that debugging is hopefully relatively easy. |
@krzysztof-cabaj I tested the application with the |
Contribution description
valentinpi in Issue #18228 reports BUG with arduino UNO and NANO LED0.
Investigation of this bug reveals two independent problems:
Testing procedure
Compile and flash example/blinky for arduino uno or mega using current RIOT master - LED0 did not blink.
Switch to 2022.04-branch, apply this PR, compile and flash example/blinky for arduino uno or mega - LED0 should blink.
Issues/PRs references
Issue #18228