← index #16611Issue #4207
Off-topic · high · value 0.167
QUERY · ISSUE

[feature request] being able to change UART(0) speed without recompiling.

openby 0wwafaopened 2025-01-19updated 2025-02-27
enhancementport-esp32

Description

As a followup to https://github.com/micropython/micropython/issues/6862

I propose to find a way to change URAT(0) speed globally or momentarily.

Globally: a simple entry in a configuration file would be nice.

Programmatically:

something like:

micropython. repl_stop()

Then:
uart = machine.UART(0,921600)

uart.write("Hello 921600 World!")

micropython. repl_restart()

Code Size

Probably small.

Implementation

I hope the MicroPython maintainers or community will implement this feature

Code of Conduct

Yes, I agree

CANDIDATE · ISSUE

[NUCLEO_H743ZI] changing CPU frequency does not work as expected

openby rolandvsopened 2018-10-03updated 2023-10-24
port-stm32

With the latest release 1.9.4 tested but also in 1.9.3 (just to be sure) I use machine.freq() to set the CPU frequency to a low frequency. Setting it to something other than 400MHz (machine.freq(200000000)) the REPL interface via the ST-LINK (real UART, no USB) will not work (garbled, not responsive).

Using REPL via USB will still work. However something like setting the frequency to 10_000_000 (10MHz) of the CPU will give no reply on the UART (expected), but the USB is dead also. After a while RED/BLUE led turn on (Fault) and the USB REPL was just able to say some last words "
can'can'can't change freq". After this only the RED led is on.

This could be considered a feature as the clock for USB is derived from another PLL and the clock for the used UART probably uses the same as for the CPU (need to check) and changes accordingly.

It makes it a bit hard to throttle the CPU speed as other peripherals will also suffer from the change.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied