|
I am seeing high host CPU use from QEMU with idle REPL console on both |
Replies: 3 comments
|
MicroPython is primarily for bare-metal, and there is no RTOS in the core. So probably it just spins as fast as the "CPU" can execute. Which will take up non-trivial amount of CPU on the host, when using an emulator. |
|
The QEMU port will spin in If you want to lower CPU time, you may achieve that by rewriting the console's UART interaction to be interrupt driven - and I guess you'll then need to implement your own version of |
|
thank you both. Now I understand current behavior is expected due to hot spins in UART read. |
The QEMU port will spin in
ports/qemu/mphalport.cregardless of the architecture, inmp_hal_stdin_rx_chrto be precise.If you want to lower CPU time, you may achieve that by rewriting the console's UART interaction to be interrupt driven - and I guess you'll then need to implement your own version of
MICROPY_INTERNAL_WFEfor both Arm and RV32 targets or the interpreter won't process timers/delayed events until there's an incoming keypress.