-
Notifications
You must be signed in to change notification settings - Fork 506
Freertosrp2350: use FreeRTOS macros in noInterrupts/interrupts when applicable. #2456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Freertosrp2350: use FreeRTOS macros in noInterrupts/interrupts when applicable. #2456
Conversation
|
Awesome work! A simple test I thought up while driving home this weekend runs perfectly with this, as well as the more involved malloc stress test. Great digging. Let me try this out on the RP2040 before merging, but right now it's looking great! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a chance to run this in the debugger to check and it's actually not correct. It's just disabling IRQ enable/disable completely. There is no taskENTER/EXIT_CRITICAL defined and the call is optimized out. You can load in GDB and look at the assembly, it's just a no-op.
FreeRTOS calls need to be defined extern "C" and this defines a weak C++ call with the same name (but different linkage due to the C++ name mangling).
Unfortunately that's not enough to actually get it to do anything. There's also no extern "C" taskEXIT_CRITICAL() call. It's a #define (of potentially another #define) in task.h. :(
|
If we look at RP2350 And, |
|
Oeps, missed the macro part. I've changed it now similar to other FreeRTOS macro calls. Als had a look with the debugger and it now really calls the FreeRTOS Thanks for your patience with me trying to find the way around in all this. There is a good reason I like to use Arduino-pico: It |
|
No worries, and I do appreciate your persistence! It's a subtle thing, and you might just have cracked it. Still puzzling me is how adjusting I traced this through and I was wrong about the
I'll throw some more tests at this on the 2040 and the 2350 and see where we end up. But so far basic sanity and code inspection seem good! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't break this in my own testing, and the change makes logical sense, too! Nice work!
f9ba639
into
earlephilhower:freertosrp2350
Pull in Raspberry Pi's custom RP2350 ARM and RISC-V ports for FreeRTOS. Basic tests run, but stress mutex test is failing in unique and interesting ways. * Add simplified switching test catching task swap problem * Freertosrp2350: use FreeRTOS macros in noInterrupts/interrupts when applicable. (#2456) * Use FreeRTOS macros in noInterrupts/interrupts when applicable. * Fixed calling taskEXIT_CRITICAL and taskENTER_CRITICAL --------- Co-authored-by: fietser28 <[email protected]>
Related to #2428.