Skip to content

Commit cfc9180

Browse files
Fix memory corruption introducted in FreeRTOS port (#556)
To remove compiler warning the valid core macro was modified to only check that the core passed in was < # of total cores. Unfortunately there are parts of the FreeRTOS code where the passed in core # is -1. The upstream catches this and returns FALSE, but my hacked version returned TRUE. This caused interesting memory corruption errors and crashes when the current task block[-1] was updated. Undo the change and fix the 1 spot where a warning happens instead. Undo the forced compiler -O0 for port.c, it was only masking the fault.
1 parent 88d213a commit cfc9180

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

libraries/FreeRTOS/src/port.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
// Port.c seems to leave interrupts disabled occasionally when built w/anything other than -O0
2-
3-
#pragma GCC optimize ("O0")
41
#include "../lib/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2040/port.c"

0 commit comments

Comments
 (0)