sekigon-gonnoc / Pico-PIO-USB

USB host/device implementation using PIO of raspberry pi pico (RP2040).
MIT License
1.35k stars 144 forks source link

🪲[BUG] pico_multicore always linked in Pico-PIO-USB library even when multicore functionality isn’t needed #146

Open abv opened 2 weeks ago

abv commented 2 weeks ago

Describe the bug you encountered:

The pico_multicore library is always linked to the Pico-PIO-USB library in CMakeLists.txt, even if multicore functionality is not required by the project. This causes unnecessary complications, especially in projects where flash operations require the system to avoid the complexities of multicore execution. As far as I can tell, while pico_multicore is used in some of the examples, it is not needed for the library to build, and can be left out of CMakeLists.txt. If I'm wrong and it is needed, I'd love to know why. I'm new to the pico and microcontrollers in general and am trying to learn as much as possible by understanding the code of my project's dependencies.

What did you expect to happen instead?

In my case, I ran into an issue where pico_flash_bank_write() from the pico-sdk failed simply from the inclusion of pico_multicore. I expected this write operation to work.

What actually happened in your case?

Flash operations did not work until I either commented out pico_multicore or added PICO_FLASH_ASSUME_CORE1_SAFE=1

Additional information

Environment details:

•   Platform: Raspberry Pi Pico W
•   SDK: Pico SDK 2.0
•   Libraries used: Pico-PIO-USB 0.6.1, TinyUSB, BTstack, etc.

kbladewht commented 1 day ago

I meet similar issue with you ,but I do need mul-core, but I don't understand why using core1 but flash didn't work to me. I used qmk environment, is there a way to allow flash write ? btw, in qmk library there is not [PICO_FLASH_ASSUME_CORE1_SAFE=1 found here