Replies: 4 comments 6 replies
-
You're definitely right that almost nobody forces the second core to run realtime. I think mostly this is because they only added the disabling of watchdogs per-core mid last year, so previously you HAD to run just straight assembly on cpu1. If you're looking to just run regular ESP-IDF code (not Arduino and not straight assembly), you can just spawn a task on cpu1, use More info and my code on this thread of mine: https://esp32.com/viewtopic.php?t=17628 Edit: FYI this prevents you from running any other tasks on that core, so make it an infinite loop. It also probably breaks built in timer functions since it can't switch tasks to sync up with the RTC. |
Beta Was this translation helpful? Give feedback.
-
Disabling permanently interrupt on core1 will lead to core0 to crash in loop if you do anything useful like running BT or WIFI. Read this: https://hackaday.io/project/170365-blueretro/log/189836-esp32-rtos-bare-metal-best-of-both-worlds |
Beta Was this translation helpful? Give feedback.
-
@mfp20 If you read the blog post I link to in previous reply you will see that my conclusion on removing FreeRTOS from Core 1 are mixed. I'm not sure it's worth the trouble. What really help is stalling Core0 & disable Core1 interrupt (less than 300ms if running BT) while you do your critical stuff and then release both once done. |
Beta Was this translation helpful? Give feedback.
-
ISR are slow on ESP32 you can hook up via _xt_intexc_hooks to bypass some of the overhead but at best you save maybe 0.3 or 0.4 us on your 1.5-2 us delay. (See Line 56 in 9e6259b On a busy loop looking at a GPIO pin I get around a delay of 300-500ns to flip another GPIO. In any case I understand your frustration but in most case I would simply pair the Wireless MCU with a PIC or AVR to do the low level stuff. I haven't done so for BlueRetro only to avoid adding additional latency and keeping it easy to build for DIY crowd. I wish I could help more but I got very little free time and much of it goes to BlueRetro. |
Beta Was this translation helpful? Give feedback.
-
First thing first: congratulations for the project both for the tech and the emotional side of the story. I've been reading your logs waiting for the next old gaming system you'd name in text, and I didn't hear about since I was a kid... it took good memories out of my heart.
I got to your project searching for a way to set core1 free of FreeRTOS, and it looks like you are the only guy that is doing something useful with Mr. Free Core One. About 4 more guys produced some previous art, but those were just proofs of concept and nothing really usable.
Getting to the point: I was wondering if you are available to make an independent project out of your unique know-how. Something like an esp-idf template with an hellocore1 'void main(argc, argv)' ready to be filled with custom code to run 'uninterrupted' on core1. It would probably help many people. I have spare time to help but ... I don't have your knowledge. I've been banging my head on esp32 twice in the past 4 years; a few months each time; and I've never been able to make an hardware timer handler ticking faster than 4us. On old AVRs I was able to get less than 1us! I'm pretty disappointed with esp32 sold as "microcontroller". It's good for IoT, not for "controlling" :P
Let me know if we can arrange something.
Thanks and keep going!
Beta Was this translation helpful? Give feedback.
All reactions