cpu: Moved stdio_init() prior to periph_init() for ARM targets#11367
cpu: Moved stdio_init() prior to periph_init() for ARM targets#11367kaspar030 merged 2 commits intoRIOT-OS:masterfrom
Conversation
dylad
left a comment
There was a problem hiding this comment.
Missing changes in cpu/saml21/cpu.c
|
@dylad: Thanks for pointing that out. The latest fixup should address this :-) |
|
@maribu |
Done. Thanks for spotting that! |
|
@kaspar030 @MrKevinWeiss @smlng @aabadie @basilfx |
|
I will add it to the list! |
|
@dylad: Thanks for pointing that out. I rebased and added the call to |
|
@maribu Wow so fast thanks ! |
|
ping |
|
Hmmm, I am a bit busy now. I'll set a reminder for tomorrow morning. |
|
@dylad: May I squash and rebase to solve the merge conflict? |
|
@maribu I'm fine with that. |
|
Tested on boards labeled above, I flashed default, asked for help, it replied. There have been some issues after the very first flash but a reset after seemed to fix all problems. I was not able to reproduce any issues after so it may be just the initial connection (a lot of fresh boards with manufacture firmware on them) |
|
I guess some work on kinetis cpus are still needed. |
|
maybe @fjmolinas could help us with Kinetis there ? |
|
Looks like Kinetis is just missing the include for stdio_base.h |
Done
Yes, I don't know why I forgot that :-/ |
fjmolinas
left a comment
There was a problem hiding this comment.
ACK on my side.
Work on all (tested) platforms.
Changes look good for untested platforms (ezr32wg and lm4f120)
kinetis-ea shared the same code with others kinetis.
I think it is time to go.
Agree, ACK on my side too.
|
This'll make not using stdio a bit more difficult. Before, not using the newlib module was enough to disable stdio. Now we'll have to add guards at multiple points. Given the time this was waiting, I'm OK with dealing with that when we get there. ;) |
Why not just overwrite |
|
@fjmolinas Sorry, I don't have the board at my disposal any more. @smlng I believe you've ordered one S9KEAZ128 board for you haven't you? |
That's a good idea. Anyhow, unrelated! |
|
Merge? |
|
This breaks stdio on esp32 & esp8266 😞 msp430, fe310, atmega, mips… was forgotten by this PR too, I'd assume stdio is broken there too now. |
|
If I remeber correctly, only the ESP32, the ESP8266, and RISC-V is also using newlib. I'll create PRs eith fixes for those three tonight. |
- This guarantees that DEBUG() is available early in boot process - Forgotten in RIOT-OS#11367, fixes broken stdio
- This guarantees that DEBUG() is available early in boot process - Forgotten in RIOT-OS#11367, this fixes broken stdio
- This guarantees that DEBUG() is available early in boot process - Forgotten in RIOT-OS#11367, this fixes broken i stdio
|
OK, the PRs with the fixes are online |
Fixed bug introduced in RIOT-OS#11367
Fixed bug introduced in RIOT-OS#11367
|
OK, MIPS32 was the last user of newlib. That should be the last missing fix. |
- This guarantees that DEBUG() is available early in boot process - Forgotten in RIOT-OS#11367, this fixes broken stdio
- This guarantees that DEBUG() is available early in boot process - Forgotten in RIOT-OS#11367, this fixes broken stdio
- This guarantees that DEBUG() is available early in boot process - Forgotten in RIOT-OS#11367, this fixes broken i stdio
Contribution description
In current RIOT master
stdio_init()is called via newlib's_init(), which is way too late during boot up to allowDEBUG()ing duringperiph_init(). This PR movesstdio_init()intocpu_init()just beforeperiph_init()is called.Testing procedure
Flash and run
examples/defaultand interact with the shell. Input and output should still work as expected.Boards using these CPUs:
cc2538(@dylad tested on firefly remotely on iotlab)cc26x0(@MrKevinWeiss tested on cc2650-launchpad)efm32(@MrKevinWeiss tested on slstk3402a)ezr32wglm4f120lpc1768(@MrKevinWeiss tested on mbed-lpc1768)nrf51(@dylad tested on nrf51dk remotely on iotlab)nrf52(@maribu tested withnrf42840dk)sam3samd21(@dylad tested on arduino-zero remotely on iotlab)saml1x(@dylad tested with SAML10-XPRO and SAML11-XPRO)saml21(@dylad tested with SAML21-XPRO)nucleo-f303re)nucleo-f767zi)b-l072z-lrwan1)frdm-kw41z,pba-d-01-kw2x)frdm-k64f)Boards with custom/weird boot up sequence:
msba2(@maribu)Issues/PRs references
Spun out of / partly replaces #10806