How to change the baudrate of repl on uart0 #18519
Replies: 10 comments 1 reply
-
|
Without changing beforehand REPL to UART, it works here with: This dupterm enables REPL on UART. |
Beta Was this translation helpful? Give feedback.
-
|
Hi Robert, |
Beta Was this translation helpful? Give feedback.
-
|
Also no result with an original uf2 for the sparkfun_thingplus |
Beta Was this translation helpful? Give feedback.
-
|
The bootloader file system is NOT identical to the MicroPython file system. The only file that can be loaded to the bootloader files system is the UF2 firmware file, and doing that it will be copied to flash. |
Beta Was this translation helpful? Give feedback.
-
|
If you can build a custom firmware then you can try these:
|
Beta Was this translation helpful? Give feedback.
-
|
I'm sorry guys , but baudrate stays at 115200 :-( |
Beta Was this translation helpful? Give feedback.
-
|
Hi Robert , |
Beta Was this translation helpful? Give feedback.
-
|
There will be a way. I will go back to the supermarket method and see how one can get rid of the output corruption. It looks like a buffer overflow. |
Beta Was this translation helpful? Give feedback.
-
|
So the initial approach still works for me, and I can avoid the corruption by setting the txbuf option of machine.UART() to a larger value. setting timeout and timeout_char should do the same, but they do not. I have to investigate that further. Until then, if you know how many bytes are sent by the board in bursts, you can set the buffer accordingly. The largest accepted value is 32766. If you do not get serial output, then there may be a problem with the connection, signal levels or signal polarity.
|
Beta Was this translation helpful? Give feedback.
-
|
Ok, this works:
$ diff uart.c-4800 uart.c
53d52
< uart_init(uart_default, PICO_DEFAULT_UART_BAUD_RATE); // set to 4800
You get MY-PICO by: $ cd boards
$ cp -r RPI_PICO MY-PICOMY-PICO is not defined in the Pico-sdk, but Now we will get REPL at /dev/ttyUSB0 with 4800 baud. $ tio -b 4800 /dev/ttyUSB0
[23:57:23.830] tio v2.7
[23:57:23.830] Press ctrl-t q to quit
[23:57:23.832] Connected
>>>
MPY: soft reboot
MicroPython v1.27.0-preview.317.g9999553aae.kaki5 on 2025-12-06; Raspberry Pi Pico with RP2040
Type "help()" for more information.
>>> |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi ,
I changed the repl to uart0 and have connected a terminal to it.
The default baudrate is 115200 , but I want to change it to 4800 since my terminal can't go higher for now.
I've seen an answer like this ,
change/edit boot.py to :
import os, machine
os.dupterm(machine.UART(0, 4800), 1)
( I hereby assume that boot.py has to be written on the flash when in bootmode ?)
but this doesn't do the trick , baudrate stays at 115200.
I also tried to change baudrate in machine_uart.c , also with no result.
Can someone help me on this.
Kind regards,
Ronny
Beta Was this translation helpful? Give feedback.
All reactions