Replies: 2 comments 8 replies
-
The serial port doorbell method requires the Pico code to be running properly and not crashed. That's probably what is happening here, the code is crashing somewhere with your other pinout (w/o full source it's hard to really say, if you can make a small 1-screen sketch that repros the problem it would be much better). As a simple sanity test to ensure its not something physical on the PCB (i.e. 5V devices, noise on power when the pins are used w/real HW), can you run the PCB binary that always crashes on the breadboarded version while rewiring the pins on the breadboard to match the PCB? If that doesn't fail, I think it points to a PCB issue. If you have a debug header, it would be very instructive to hook up a Picoprobe and dump the CPU states. You can get full stack traces/etc. to tell you exactly where things are FWIW, the GPIO pins listed seem like they are safe to do regular GPIO from. But, if your sketch/libraries try to use HW interfaces like SPI or I2C then it's possible those PCB pins are not legal for the given HW. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the suggestion - but as I tried to watch the Digikey Picoprobe video again my eyes glazed over about halfway through. If someone could simplify the use of this tool I'd be all over it. To be honest, the reason many of us are able to play with the Pico is because you (brilliantly, I might add) provided support in the Arduino IDE which, warts and all, is where us hobbyists who aren't professional embedded developers feel comfortable. In addition to the learning curve for VSCode, OCD, and all - I'm not sure the Picoprobe would help debug my application because I'm already using both PIOs and I read that it uses a PIO for the SWD interface. And to be clear, the code snippet above which includes the SPI library is from the Adafruit SSD1306 library. I use I2C but not SPI, but I reckon the reason it's included is because she typically writes libraries that support multiple Adafruit products. I've also used the Arduino Mbed core, and it uses a file called pins_arduino.h to describe the configuration of all pins that are used. Does your core have anything similar that I should be modifying? Or how would I tell your core that I want to use pins 18-21 for GPIO rather than I2C or SPI? Or if some library I'm using is doing that how could if determine which one is doing it? I realize the Picoprobe might do that - but it would sure be nice if it was easier to use. I'll be happy to send you my entire code if you'd like to look at it. Thanks again for your help and time. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a Pico program that works fine on a breadboard, but for some unknown reason fails to upload correctly to my prototype PC board. Different Picos, obviously, but the only difference is four GPIOs used to read a BCD input that were changed from 10-11-12-13 on the breadboard to 18-19-20-21 on the PCB . It's worked in the past but today when I upload the correct code to the PCB the IDE gives the following errors:
Resetting COM24
Converting to uf2, output size: 172544, start address: 0x2000
Flashing K: (RPI-RP2)
Wrote 172544 bytes to K:/NEW.UF2
Error opening serial port 'COM24'. (Port not found)
After one attempt the Pico is unavailable as a serial device, Windows give the "last USB device has malfunctioned" error and the only way I can bring it back is to start it with the BOOTSEL button held down and drag-drop a uf2 file on the mass storage device, then the Pico resumes normal operation.
The weird part is, I can then upload the code for the breadboard to the PC board hardware and it will work fine, except for the function that requires the BCD data since it's looking at the wrong four GPIOs. I've put both into DiffChecker and confirmed that the only difference is the GPIO assignment and pinmode configurations - 5 removals and 5 additions and the only difference in those lines are the pin numbers:
This works: int BandInput[] = {10, 11, 12, 13};
This blows it up: int BandInput[] = {18, 19, 20, 21}; (and the associated pinmode statements for each)
I can't see how the choice of GPIOs could cause the symptoms I'm seeing. I searched for the uf2 file and none is being created - only the elf - so I used elf2uf2 to make one and uploaded it using BOOTSEL but it still doesn't run. Both versions compile without error, the only indication of problem is when the IDE tries to upload the UF2 serially to the Pico (and I'll admit I'm not fully up to speed on the exact boot- boot2 sequence of operations).
So as a last resort I commented out the five lines in the PCB version and copied in the same ones from the breadboard, which are incorrect for this hardware, but after restoring the bootloader I successfully uploaded it and it works.
I'd really appreciate if anyone can explain how my choice of GPIOs manages to break the uploading process! Of course I may be missing something obvious - so any suggestions are appreciated.
Thanks,
Bob
Beta Was this translation helpful? Give feedback.
All reactions