
Reduce RP2040 Power With Dormant Mode and Clock Gating
Cut RP2040 current by gating unused clocks with the CLOCKS sleep-enable registers and entering dormant mode, then wake on a GPIO edge with pico-extras.
Tag
362 posts

Cut RP2040 current by gating unused clocks with the CLOCKS sleep-enable registers and entering dormant mode, then wake on a GPIO edge with pico-extras.

Send vendor and standard USB control requests from a Linux 6.12 driver with usb_control_msg and the safer usb_control_msg_recv and usb_control_msg_send helpers.

Move large buffers between FreeRTOS tasks and ISRs without copying them: a fixed buffer pool, a queue of small descriptors and a strict one-owner rule.

Send and receive bulk data from a Linux 6.12 USB driver with usb_bulk_msg: pipes, DMA-safe buffers, timeouts, short transfers and how to recover from a stall.

Use unnamed POSIX semaphores in a shared mapping with sem_init and pshared set to 1 to build a bounded producer and consumer buffer between forked processes.

Build the smallest working Linux 6.12 USB driver: an id_table, probe and disconnect callbacks, per-interface state, and the module_usb_driver registration.

Enter ESP32 deep sleep with esp_deep_sleep_start, wake on a timer and an ext0 GPIO, keep a counter in RTC memory, and read the wake-up cause on boot.

Send data from an interrupt to a task with xQueueSendFromISR: the woken-task flag, portYIELD_FROM_ISR, interrupt priority rules and a full-queue policy.

Synchronize unrelated processes with named POSIX semaphores: sem_open, sem_wait, sem_post, a ping and pong example, sem_timedwait and sem_unlink on Linux 6.12.

Put an STM32F4 into Stop mode with HAL_PWR_EnterSTOPMode, wake it with an RTC alarm every minute, and restore the clocks that Stop switches off.

Read the oldest FreeRTOS queue item without removing it using xQueuePeek, and pair it with xQueueOverwrite to share a latest-value status between tasks.

Replace a busy main loop with __WFI so a Cortex-M sleeps until the next interrupt, and close the lost-wakeup race with a PRIMASK guard.