Compiling binary fails with additional libraries #2294
-
Currently building an arcade style controller for a rhythm game, Sound Voltex: Exceed Gear. Using the Joystick and PicoEncoder library I've got all the base functionality coded and tested. I'm starting to expand it's capabilities and offload these additions to core1. Whenever I include another library such as Adafruit_SSD1306.h or Adafruit_NeoPixel.h and call their respective constructors I get same compile/upload error.
I have separate sketches using each of the libraries separately, so I know they work with board profile and I've started integrating the code line-by-line to try to determine the fault and the binary fails to upload/compile despite Output messaging. I can comment out highlighted line in the screenshot and the code compiles perfectly. Does anyone have any idea's as what maybe going on? or something that I might have missed? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
The message below:
Is an upload one, and not related to the application you're compiling. It means that Windows wasn't able to talk to the USB serial port and hence couldn't get into upload mode on the Pico. Either the Pico itself has crashed or has IRQs disabled so that USB comms are dead, or Windows doesn't know about the port (missing INF, see Zadig in the docs). The important thing is that the code you are compiling and trying to upload has no effect on the upload. Only what was on the Pico when you tried to reset it (i.e. the prior app has crashed, not this one). Since you say it was working before, then most likely the Pico has crashed. You could hook up a PicoProbe to verify this. If the Adafruit_Neopixel constructor tries to access any other object (i.e. SPI, Serial1/2, I2C, etc.) , that's not legal since there is no guarantee on the ordering of global object constructors. Like you said, you could try moving the creation to
|
Beta Was this translation helpful? Give feedback.
-
Short answer, try using NeoPixel_Connect. In the object definition you specify which PIO. So I took my query to the You could start by checking the return value from the encoder being method. If that's negative, then calling update afterwards on an Encoder that wasn't properly initialized will block indefinitely with interrupts disabled, which would be consistent with what you are seeing. I can add a protection in the code to avoid this. It would still not work, but at least it wouldn't hang forever. |
Beta Was this translation helpful? Give feedback.
Short answer, try using NeoPixel_Connect. In the object definition you specify which PIO.
So I took my query to the
PicoEncoder
git repo. So apparently the issue is a conflict over both libraries (NeoPixel or PicoEncoder) trying to claim PIO0. It is a bit over my head but the developer did offer a work around. Still don't know if it will conflict with multi-core, but this was his interim solution.You could start by checking the return value from the encoder being method. If that's negative, then calling update afterwards on an Encoder that wasn't properly initialized will block indefinitely with interrupts disabled, which would be consistent with what you are seeing. I can add a protection…