smittytone / RP2040-FreeRTOS

Raspberry Pi RP2040 FreeRTOS baseline development project
https://blog.smittytone.net/2022/02/24/how-to-use-freertos-with-the-raspberry-pi-pico/
MIT License
110 stars 40 forks source link

App-Timers OOM #2

Closed hepoun closed 2 years ago

hepoun commented 2 years ago

Hi, it seems App-Timers gets OOM after running slightly over 3 hours ... I left Pico running and when I got back there was no blinky but shiny :-)

[DEBUG] Timer fired. ID: 0, LED: on
[DEBUG] Timer fired. ID: 255, LED: off
[DEBUG] Timer fired. ID: 0, LED: on

*** PANIC ***

Out of memory

After I changed LED_OFFTIMER approach from "create many-times" to "create once, (re)start many-times"_ the problem disappeared. I guess deleting the LED_OFF_TIMER in its callback should resolve the issue too.

smittytone commented 2 years ago

I’m impressed you left it running for three hours, but thank you for doing so. I will implement the second fix.

smittytone commented 2 years ago

Updated. Ran for five hours w/o panics. Will merge it in.