Skip to content

RP2350B pin PIO function abnormality #2133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Octopus1633 opened this issue Dec 9, 2024 · 16 comments
Open

RP2350B pin PIO function abnormality #2133

Octopus1633 opened this issue Dec 9, 2024 · 16 comments
Milestone

Comments

@Octopus1633
Copy link

Octopus1633 commented Dec 9, 2024

Hello,

I have successfully run the hello_pio example on RP2350B based on #2051 . Now RP2350B has two pins connected to USB. I want to use PIO to simulate USB to realize USB master-slave communication, but after burning the firmware, I don't detect any signal on the pins. Even if I use pins below 32 and PICO_PIO_USE_GPIO_BASE=0.

https://github.com/sekigon-gonnoc/Pico-PIO-USB This code works fine on the RP2040. If it is run on the RP2350B and the pins below 32 are used to implement the PIO function, the program should run without any modification.

RP2040:
企业微信截图_17337390914160

RP2350B:
企业微信截图_1733739153390

@peterharperuk
Copy link
Contributor

Does it work on a RP2350A?

@lurch
Copy link
Contributor

lurch commented Dec 9, 2024

Perhaps you just need to modify the code to remove the GPIO isolation latches? (A new feature in RP2350 that wasn't in RP2040)

@Octopus1633
Copy link
Author

Octopus1633 commented Dec 10, 2024

Does it work on a RP2350A?

@peterharperuk Hello, I used RP2350A to test that USB communication can be carried out normally, and a stable signal can be detected.

Perhaps you just need to modify the code to remove the GPIO isolation latches? (A new feature in RP2350 that wasn't in RP2040)

@lurch Hello, how can I properly remove the GPIO isolation latch? I did not add any extra code when implementing it with RP2350A.

@lurch
Copy link
Contributor

lurch commented Dec 10, 2024

Ah, well if it works with RP2350A then I guess it should also work with RP2350B, so I'll leave this to Peter or Graham to investigate 🙂

@Octopus1633
Copy link
Author

Octopus1633 commented Dec 23, 2024

@lurch @peterharperuk Hi, I would like to ask how the test is going?

@peterharperuk peterharperuk self-assigned this Jan 2, 2025
@peterharperuk
Copy link
Contributor

I gave the host example a test and it worked on pico1 but I can't get it to work on pico2. Not immediately obvious why but I assume it's something to do with gpio not being setup properly.

@arlaneenalra
Copy link

hmm .. I suspect I'm seeing something very similar but on the input side of things. I have a PIO program that waits for a to go low, then high, and it never seems to react on the rp2350. It works fine on the 2040. I'm running an RP2350A0A2 if I'm reading this right. GPIO reads show the pin changing, but PIO doesn't react at all .. odd..

@peterharperuk
Copy link
Contributor

I can't help you without seeing your code

@arlaneenalra
Copy link

It could be unrelated..
PIO: https://github.com/arlaneenalra/CGA_LCD_Capture/blob/c63f808fc69c7abaa6c7c12ffd35135aca6897d3/src/lcd.pio
PIO Init code: https://github.com/arlaneenalra/CGA_LCD_Capture/blob/c63f808fc69c7abaa6c7c12ffd35135aca6897d3/src/main.c#L52

The signal line in question is a pulse at roughly 76hz. The code overclocks right now, but I've tried it at the stock clock frequency and with various GPIO pin configurations. It works great on an rp2040 but doesn't do anything on the rp2350. I'm probably missing something simple... but it sounds very similar to what's described in this bug.

@Octopus1633
Copy link
Author

Octopus1633 commented Jan 6, 2025

I gave the host example a test and it worked on pico1 but I can't get it to work on pico2. Not immediately obvious why but I assume it's something to do with gpio not being setup properly.

@peterharperuk Thank you for your reply. I used the same test procedure and the result was that RP2350A tested normal, but RP2350B was abnormal. What could be the problem?

@peterharperuk
Copy link
Contributor

@Octopus1633 what boards are you using with your tests?

@Octopus1633
Copy link
Author

Octopus1633 commented Jan 6, 2025

@Octopus1633 what boards are you using with your tests?

The circuit I designed referring to the schematic in the official manual is the same as the reference board you provided.

@peterharperuk
Copy link
Contributor

@Octopus1633 Do you have any pico2 devices? If you do, can you see if you can get the host and device examples to work. I can only get the device examples to work on a pico2. I'm slightly suspicious that the code is suffering from an issue with the pull downs.

However, the device example works on pico2 and a pimoroni pico 2 plus which uses an rp2350b. I tested it with pins 12 and 13 so I can't reproduce your problem.

@Octopus1633
Copy link
Author

Octopus1633 commented Jan 7, 2025

@peterharperuk I think there is a problem with the latest example of https://github.com/sekigon-gonnoc/Pico-PIO-USB. I used the 0.53 version of the example to test on pico2, and the result showed that it is feasible as a USB device or host.

However, when compiling the 0.53 version of the example, you need to comment out the pio_sm_set_jmp_pin function definition in the sdk.

I used GPIO7 and 8 and tested it on RP2350B again, but it still didn't work. The computer would pop up that the USB device could not be recognized.

@lurch
Copy link
Contributor

lurch commented Jan 7, 2025

It's probably not relevant, but just FYI: #1849 (things were in a state of flux at one point, but hopefully everything has stabilised now).

@Octopus1633
Copy link
Author

@lurch Thank you for your advice. I re-pulled the latest SDK and initialized the submodule. The test results are still the same as above.

@peterharperuk peterharperuk removed their assignment Jan 27, 2025
@kilograham kilograham added this to the 2.2.0 milestone Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants