I’m using a Pico 2 (actually a Pimoroni Pico 2 Plus) and the C/C++ SDK 2.0.0. Programming via VSCode and using the Pico Extension.
I’ve got a massive project (around 20k lines of code) using both cores, with communication between them via a queue system for note messages and then some variables that are written by one core, and read by another (not ideal, but I’ve yet to get to replacing with an Atomic value/when I tried a semaphore on the RP2040 before (SDK1.5.0~) it’s didn’t really improve issues).
I’ve got a strange issue that I believe stems from memory management/cache in the multicore setup.
Core 1 has 2 arrays of structs (containing 2 unsigned 8 bit values and a bool, along with some setter getter functions) currently with an array size of 32 entries each.
I’ve found that if I reduce the size of this array to 8 entries each, my code stops working properly (it’s a synth, so the other core that produces audio starts to lag and the audio comes out all slowed and glitchy).
I’m guessing this is down to everything memory related moving when I change this array size, but the array doesn’t related to the Core 2 code directly at all? So it’s weird.
Unrelated issue, but could also be related, I have a bunch of delays and printf’s on the cores during start up (to serial print firmware numbers and startup routines) and if I remove them, the cores don’t be have as expected, so I’m guessing there’s something up with my core synchronicity.
Any help/pointers/things I’ve missed would be massively appreciated.
I’ve got a massive project (around 20k lines of code) using both cores, with communication between them via a queue system for note messages and then some variables that are written by one core, and read by another (not ideal, but I’ve yet to get to replacing with an Atomic value/when I tried a semaphore on the RP2040 before (SDK1.5.0~) it’s didn’t really improve issues).
I’ve got a strange issue that I believe stems from memory management/cache in the multicore setup.
Core 1 has 2 arrays of structs (containing 2 unsigned 8 bit values and a bool, along with some setter getter functions) currently with an array size of 32 entries each.
I’ve found that if I reduce the size of this array to 8 entries each, my code stops working properly (it’s a synth, so the other core that produces audio starts to lag and the audio comes out all slowed and glitchy).
I’m guessing this is down to everything memory related moving when I change this array size, but the array doesn’t related to the Core 2 code directly at all? So it’s weird.
Unrelated issue, but could also be related, I have a bunch of delays and printf’s on the cores during start up (to serial print firmware numbers and startup routines) and if I remove them, the cores don’t be have as expected, so I’m guessing there’s something up with my core synchronicity.
Any help/pointers/things I’ve missed would be massively appreciated.
Statistics: Posted by Neo_nmik — Mon Dec 30, 2024 8:52 pm