board: arduino-mega2560: use uart_stdio#3426
Conversation
7c44626 to
b715d95
Compare
|
|
@ReneHerthel can you test this? I can give it a try tomorrow if Rene is not on it then. |
|
Someone said there was a problem with strings longer than "help". ;) |
|
Really :-) ? |
|
Still no success on mega2560. Seems to be the same problem like described in #3187. From tests/shell I get: |
tests/periph_gpio/main.c
Outdated
|
PR looks reasonable as far as I can evaluate this. The Atmega has the same problems than before. On the stm32f4discovery everything seems to be fine |
|
@PeterKietzmann could you try not using pyterm? Maybe pyterm sends the characters too fast... edit or try a very low baudrate, e.g. 9600? |
|
@kaspar030 with minicom @38400 baud it looks fine. With pyterm @9600 baud it looks also fine. Pyterm @38400 baud is still "buggy" |
|
Well, our current design issues one interrupt per character, which might be too much for the little AVR. I'll change to 9600 for now, until we come up with a more efficient solution. |
|
@PeterKietzmann Could you try one thing: Add Maybe the UART has a buffer, so reading in a loop might fix the issue. |
|
The datasheet states the Atmel has a two-byte buffer, so this might actually help. |
|
@PeterKietzmann Sorry, wrong flag, correct is |
|
@PeterKietzmann hey, thanks for letting me know! |
|
:) |
|
@kaspar030 sorry, I don't want to get into the datasheet right now. When exactly is this flag set? Calling the callback until the flag is unset brings no inputs to pyterm anymore. Again, with minicom 38400 baud worked. In general I'd be also fine with a default of 9600 baud on that platform. |
|
@PeterKietzmann about this discussion. You AT'ed me. |
|
@PeterKietzmann Sorry again, my logic was wrong. Please try again with |
|
@9600 sorry. I didn't realize what I did at first :-), sorry for the interruption. |
|
@kaspar030 the your idea seems reasonable to me but still if have the problem, that longer strings don't work. E.g. |
|
@PeterKietzmann Ok, thanks for trying! Let's set to 9600baud for now. |
|
|
@PeterKietzmann Could you take another look? |
|
With master on default on arduino-mega2560 I get output, but input (shell) isn't working. With the current state of this PR, I get neither input nor output. |
|
Hm, too bad. I remember this was working in @PeterKietzmann's tests. We had to lower the baudrate to 9600 baud, but still.... Unfortunately I don't have a board to test. |
|
Ah, didn't read about the baudrate. |
|
With 9600 baud it's working indeed. |
|
But the baudrate should be changed within the third commit?!
@OlegHahm is this still current? |
|
As I said, with 9600 baud it's working, yes. |
|
Nice. Question would be, why is there no output at higher baudrate with this PR? Anyways, would you guys ACK this? |
No, sorry, I was imprecise. This has been a case of PEBCAK: I called pyterm manually with the wrong baudrate.
ACK - slow shell is better than no shell. |
|
:-) @OlegHahm I agree. IIRC with other terminal programs (e.g. minicom) the higher baud rate worked, but not in pyterm. Anyway, I didn't re-test this PR but ACK for the state from some weeks ago |
|
Wait! Now you made me curious and I reverted the last commit. Still working. With 115200 baud and pyterm. Edit: Just realized that the baudrate is 38400 then. |
|
@PeterKietzmann Do you think you could quickly test with 38400 and 115200 baud? fast shell is better than slow shell. :) |
|
115200 is not working. |
|
I still get the output, but shell isn't working. |
|
So I revert the 9600 baud commit? Whatever you're more likely to ACK. |
|
Will do, moment |
|
I see the same problems with 38400 baud as before. IMO you should not revert that commit |
|
@OlegHahm pleas try |
|
Works like charm: |
|
Hm. Do you have an original arduino board or is yours also from Funduino? |
|
How do I figuret that out? Mine has printed SainSmart on the PCB. |
|
Well, seems to be just an other supplier. Anyway, @ReneHerthel and me both have the Mega2560 by Funduino and both of us experienced problems with shell examples when initialized at 38400 baud. Is this reason enough to merge it with 9600 baud per default? Maybe one could add a comment in the peripheral configuration or elsewhere |
|
I'm fine with 9600 baud. ACK |
|
And go |
…t_stdio board: arduino-mega2560: use uart_stdio
This removes uart0 support and makes the port use shared uart_stdio code instead.
I don't remember where, but someone reported this patch doesn't work correctly. I don't have the board, so I can't debug. Volunteers?
(I marked it "waiting for other PR" as this breaks all tests that use uart0 without #3402)