Allow use of pico_stdio_usb with explicit TinyUSB use #838

Closed
opened 2022-05-23 12:50:52 -05:00 by kilograham · 11 comments
kilograham commented 2022-05-23 12:50:52 -05:00 (Migrated from github.com)

Currently pico_stdio_usb requires that the user not be using tinyusb, as it exposes its own USB descriptor(s) and runs its own polling loop.

The majority of pico_stdio_usb would be fine if the user has defined their own CDC device and it would probably be useful to allow that.

Currently pico_stdio_usb requires that the user not be using tinyusb, as it exposes its own USB descriptor(s) and runs its own polling loop. The majority of pico_stdio_usb would be fine if the user has defined their own CDC device and it would probably be useful to allow that.
lurch commented 2022-05-23 17:55:34 -05:00 (Migrated from github.com)

Just out of curiosity, would that interfere with the picotool-reset-over-CDC mechanism?

Just out of curiosity, would that interfere with the picotool-reset-over-CDC mechanism?
kilograham commented 2022-05-24 12:44:37 -05:00 (Migrated from github.com)

It wouldn't interfere with the reset over CDC mechanism, but that is not what picotool uses. It uses a separate interface, which the user would have to add separately (so the short answer is probably yes)

It wouldn't interfere with the reset over CDC mechanism, but that is not what picotool uses. It uses a separate interface, which the user would have to add separately (so the short answer is probably yes)
kilograham commented 2022-05-24 12:45:26 -05:00 (Migrated from github.com)

The CDC mechanism is to set the baud rate, however using that from the host requires you to know how to translate a USB id into a higher level comms device you can talk to which is non-trivial and different on all platforms. The reason for this is that libusb is not able to talk to the USB directly once claimed by said comms device.

The CDC mechanism is to set the baud rate, however using that from the host requires you to know how to translate a USB id into a higher level comms device you can talk to which is non-trivial and different on all platforms. The reason for this is that libusb is not able to talk to the USB directly once claimed by said comms device.
lurch commented 2022-05-24 13:36:26 -05:00 (Migrated from github.com)

It uses a separate interface...

Right, that's what I was thinking of, I guess my mention of CDC must have been a mis-remembering.

> It uses a separate interface... Right, that's what I was thinking of, I guess my mention of CDC must have been a mis-remembering.
kilograham commented 2022-06-20 12:52:51 -05:00 (Migrated from github.com)

merged into develop

merged into develop
popy2k14 commented 2022-11-23 14:08:27 -06:00 (Migrated from github.com)

Hey guys,

Running tiny USB in device mode as hid keyboard and pico tool doesn't work. I am using no CDC in tiny USB.

When I get it correctly, this should be possible now. Read your thread here and the commits but just don't what to configure to get CDC for pico tool with standard USB lib alongside tiny USB.

Any hints?

Hey guys, Running tiny USB in device mode as hid keyboard and pico tool doesn't work. I am using no CDC in tiny USB. When I get it correctly, this should be possible now. Read your thread here and the commits but just don't what to configure to get CDC for pico tool with standard USB lib alongside tiny USB. Any hints?
kilograham commented 2022-11-23 17:16:31 -06:00 (Migrated from github.com)

Hey guys,

Running tiny USB in device mode as hid keyboard and pico tool doesn't work. I am using no CDC in tiny USB.

When I get it correctly, this should be possible now. Read your thread here and the commits but just don't what to configure to get CDC for pico tool with standard USB lib alongside tiny USB.

Any hints?

um CDC != picotool ... you cannot run the picotool interface alongside your app (it is a separate thing int the bootrom)

> Hey guys, > > Running tiny USB in device mode as hid keyboard and pico tool doesn't work. I am using no CDC in tiny USB. > > When I get it correctly, this should be possible now. Read your thread here and the commits but just don't what to configure to get CDC for pico tool with standard USB lib alongside tiny USB. > > Any hints? um CDC != picotool ... you cannot run the picotool interface alongside your app (it is a separate thing int the bootrom)
popy2k14 commented 2022-11-24 02:16:51 -06:00 (Migrated from github.com)

ok, sorry for mixing things up.
I thought picotool is using CDC.

So my question should be:
How to use picotool alongside tinyusb? Is this possible?
I want to flash my devices without the BOOTSEL button.

ok, sorry for mixing things up. I thought picotool is using CDC. So my question should be: How to use picotool alongside tinyusb? Is this possible? I want to flash my devices without the BOOTSEL button.
popy2k14 commented 2022-11-25 04:22:11 -06:00 (Migrated from github.com)

Added CDC to TinyUSB descriptors and copied and adapted the function:

// Support for default BOOTSEL reset by changing baud rate
void tud_cdc_line_coding_cb(__unused uint8_t itf, cdc_line_coding_t const* p_line_coding) {
    if (p_line_coding->bit_rate == 110) {    
        //board_led_write(1);
        reset_usb_boot(gpio_mask, 0);
    }
}

Would be nice if this function from sdk reset interface does'nt get's defined out when using TinyUSB.

Added CDC to TinyUSB descriptors and copied and adapted the function: ``` // Support for default BOOTSEL reset by changing baud rate void tud_cdc_line_coding_cb(__unused uint8_t itf, cdc_line_coding_t const* p_line_coding) { if (p_line_coding->bit_rate == 110) { //board_led_write(1); reset_usb_boot(gpio_mask, 0); } } ``` Would be nice if this function from sdk reset interface does'nt get's defined out when using TinyUSB.
kilograham commented 2022-11-25 10:07:50 -06:00 (Migrated from github.com)

Would be nice if this function from sdk reset interface does'nt get's defined out when using TinyUSB.

please open a separate issue, and it can be fixed

> Would be nice if this function from sdk reset interface does'nt get's defined out when using TinyUSB. please open a separate issue, and it can be fixed
popy2k14 commented 2022-11-25 10:27:15 -06:00 (Migrated from github.com)

Done, thx

Done, thx
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-raspberrypi/pico-sdk#838
No description provided.