USB stdio & SDK 1.1.0 #257

Closed
opened 2021-03-15 03:13:35 -05:00 by Wiz-IO · 41 comments
Wiz-IO commented 2021-03-15 03:13:35 -05:00 (Migrated from github.com)

maybe is issues...

pico_stdio_usb\reset_interface.c:63:32: error: 'SRAM_END' undeclared (first use in this function);
#include "hardware/regs/addressmap.h"

pico_stdio_usb\stdio_usb.c:17:8: error: unknown type name 'mutex_t'
#include "pico/mutex.h"

pico_stdio_usb\stdio_usb.c:19:13: warning: function declaration isn't a prototype [-Wstrict-prototypes]
static void low_priority_worker_irq()

maybe is issues... pico_stdio_usb\reset_interface.c:63:32: error: '**SRAM_END**' undeclared (first use in this function); #include "hardware/regs/addressmap.h" pico_stdio_usb\stdio_usb.c:17:8: error: unknown type name '**mutex_t**' #include "pico/mutex.h" pico_stdio_usb\stdio_usb.c:19:13: warning: function declaration isn't a prototype [-Wstrict-prototypes] static void low_priority_worker_irq()
lurch commented 2021-03-15 06:10:44 -05:00 (Migrated from github.com)

pico_stdio_usb\reset_interface.c:63:32: error: 'SRAM_END' undeclared (first use in this function);

@kilograham the offending line says:

watchdog_reboot(0, SRAM_END, PICO_STDIO_USB_RESET_RESET_TO_FLASH_DELAY_MS);

but the doxygen for watchdog_reboot says "If pc is non-zero, this will be the stack pointer used.", but here pc is zero, so that would seem to imply that SRAM_END isn't needed? 🤷‍♂️

@Wiz-IO Just out of curiosity, what compiler / compiler-version / compiler-options are you using to catch those errors, which we seem to have missed ourselves? 🙂

> pico_stdio_usb\reset_interface.c:63:32: error: 'SRAM_END' undeclared (first use in this function); @kilograham the offending line says: ``` watchdog_reboot(0, SRAM_END, PICO_STDIO_USB_RESET_RESET_TO_FLASH_DELAY_MS); ``` but the doxygen for [watchdog_reboot](https://raspberrypi.github.io/pico-sdk-doxygen/group__hardware__watchdog.html#gaa73ccd43d6d755817e71bc3d7eb1fda6) says "If `pc` is non-zero, this will be the stack pointer used.", but here `pc` **is** zero, so that would seem to imply that `SRAM_END` isn't needed? :man_shrugging: @Wiz-IO Just out of curiosity, what compiler / compiler-version / compiler-options are you using to catch those errors, which we seem to have missed ourselves? :slightly_smiling_face:
Wiz-IO commented 2021-03-15 06:53:06 -05:00 (Migrated from github.com)

Hi,

I make "experimental" platform for PlatformIO ( VSCode ) & Arduino, based on pico-sdk v1.1.0 and one last version as "backup" (v1.0.1)
Builder: https://github.com/Wiz-IO/wizio-pico
Sources: https://github.com/Wiz-IO/framework-wizio-pico

The compiler is arm-none-eabi 7.2.1
support Windows, Linux and OSX ... ( PlatformIO download this version ( pack 1.70201.0 ) auto @ PC system )
and is tested 4 years from me with ARM-s
GCC link: http://dl.platformio.org/packages/manifest.json ( search version gccarmnoneeabi 1.70201.0 @ system )

-Wall
-Wfatal-errors
-Wstrict-prototypes
-Wno-... will remove later

All default flags is here: https://github.com/Wiz-IO/wizio-pico/blob/main/builder/frameworks/common.py#L104

Hi, I make "experimental" platform for PlatformIO ( VSCode ) & Arduino, based on pico-sdk v1.1.0 and one last version as "backup" (v1.0.1) Builder: https://github.com/Wiz-IO/wizio-pico Sources: https://github.com/Wiz-IO/framework-wizio-pico The compiler is arm-none-eabi 7.2.1 support Windows, Linux and OSX ... ( PlatformIO download this version ( pack 1.70201.0 ) auto @ PC system ) and is tested 4 years from me with ARM-s GCC link: http://dl.platformio.org/packages/manifest.json ( search version gccarmnoneeabi 1.70201.0 @ system ) -Wall -Wfatal-errors -Wstrict-prototypes -Wno-... will remove later All default flags is here: https://github.com/Wiz-IO/wizio-pico/blob/main/builder/frameworks/common.py#L104
kilograham commented 2021-03-15 14:18:21 -05:00 (Migrated from github.com)

pico_stdio_usb\stdio_usb.c:19:13: warning: function declaration isn't a prototype [-Wstrict-prototypes]
static void low_priority_worker_irq()

Yup; this isn't in our standard warning check since TinyUSB has warnings. Will fix

pico_stdio_usb\reset_interface.c:63:32: error: 'SRAM_END' undeclared (first use in this function);
#include "hardware/regs/addressmap.h"

pico_stdio_usb\stdio_usb.c:17:8: error: unknown type name 'mutex_t'
#include "pico/mutex.h"

Agree these should be in place, though for it to fail it implies that you have tinyusb configured not to use RP2040 target, 'cause otherwise they'd both be included via "tusb.h"

> pico_stdio_usb\stdio_usb.c:19:13: warning: function declaration isn't a prototype [-Wstrict-prototypes] > static void low_priority_worker_irq() Yup; this isn't in our standard warning check since TinyUSB has warnings. Will fix > pico_stdio_usb\reset_interface.c:63:32: error: '**SRAM_END**' undeclared (first use in this function); > #include "hardware/regs/addressmap.h" > > pico_stdio_usb\stdio_usb.c:17:8: error: unknown type name '**mutex_t**' > #include "pico/mutex.h" Agree these should be in place, though for it to fail it implies that you have tinyusb configured not to use RP2040 target, 'cause otherwise they'd both be included via "tusb.h"
Wiz-IO commented 2021-03-15 17:08:06 -05:00 (Migrated from github.com)

by the way ... Windows 10 and USB stdio

  1. "HelloWorld" example with USB stdio from SDK 1.0.1 - PC driver is OK - USB stdio work
  2. same example compiled with SDK 1.1.0 - PC driver unknow ( Zadig can not see the device ) - USB stdio not work
  3. #define PICO_STDIO_USB_ENABLE_RESET_VIA_VENDOR_INTERFACE 0 ( disable reset )
  4. compile with SDK 1.1.0 - USB stdio is OK :)
by the way ... Windows 10 and USB stdio 1. "HelloWorld" example with USB stdio from SDK 1.0.1 - PC driver is OK - USB stdio work 2. same example compiled with SDK 1.1.0 - PC driver unknow ( Zadig can not see the device ) - **USB stdio not work** 3. **#define PICO_STDIO_USB_ENABLE_RESET_VIA_VENDOR_INTERFACE 0** ( disable reset ) 4. compile with SDK 1.1.0 - USB stdio is OK :)
lurch commented 2021-03-17 06:40:30 -05:00 (Migrated from github.com)

@Wiz-IO That's interesting, thanks.

@kilograham I see that e.g. https://github.com/raspberrypi/tinyusb/blob/master/examples/device/hid_generic_inout/src/usb_descriptors.c#L28 says
"A combination of interfaces must have a unique product id, since PC will save device driver after the first plug.
Same VID/PID with different interface e.g MSC (first), then CDC (later) will possibly cause system error on PC."
Could that explain the behaviour that @Wiz-IO describes in his last message? If so, does that imply that "USB-CDC + USB_ENABLE_RESET" needs a different PID from just "USB-CDC"?

@Wiz-IO That's interesting, thanks. @kilograham I see that e.g. https://github.com/raspberrypi/tinyusb/blob/master/examples/device/hid_generic_inout/src/usb_descriptors.c#L28 says "A combination of interfaces must have a unique product id, since PC will save device driver after the first plug. Same VID/PID with different interface e.g MSC (first), then CDC (later) will possibly cause system error on PC." Could that explain the behaviour that @Wiz-IO describes in his last message? If so, does that imply that "USB-CDC + USB_ENABLE_RESET" needs a different PID from just "USB-CDC"?
kilograham commented 2021-03-17 11:04:46 -05:00 (Migrated from github.com)

that could certainly be it. @Wiz-IO can you try changing the line 35 in src/rp2_common/pico_stdio_usb/stdio_usb_descriptors.c

#define USBD_PID (0x000a) // Raspberry Pi Pico SDK CDC

to something else maybe 0xeeea and see if Windows likes that

that could certainly be it. @Wiz-IO can you try changing the line 35 in src/rp2_common/pico_stdio_usb/stdio_usb_descriptors.c ``` #define USBD_PID (0x000a) // Raspberry Pi Pico SDK CDC ``` to something else maybe `0xeeea` and see if Windows likes that
Wiz-IO commented 2021-03-17 11:43:23 -05:00 (Migrated from github.com)

reset enabled
EEEA-RESET

reset disabled
EEEA-NO-RESET

reset enabled ![EEEA-RESET](https://user-images.githubusercontent.com/14574834/111504690-9614a180-8750-11eb-908c-271f39bfe9d2.jpg) reset disabled ![EEEA-NO-RESET](https://user-images.githubusercontent.com/14574834/111504742-a2006380-8750-11eb-9e49-391c3390d074.jpg)
kilograham commented 2021-03-17 11:48:41 -05:00 (Migrated from github.com)

was that with zadig? i.e. did zadig not like the "new" device?

was that with zadig? i.e. did zadig not like the "new" device?
Wiz-IO commented 2021-03-17 11:50:45 -05:00 (Migrated from github.com)

the driver is installed ... but win 10 work without zadig ( I do not remember )

enable/disable reset is
PICO_STDIO_USB_ENABLE_RESET_VIA_VENDOR_INTERFACE 1/0
https://github.com/raspberrypi/pico-sdk/blob/master/src/rp2_common/pico_stdio_usb/include/pico/stdio_usb.h#L72

the driver is installed ... but win 10 work without zadig ( I do not remember ) enable/disable reset is PICO_STDIO_USB_ENABLE_RESET_VIA_VENDOR_INTERFACE **1/0** https://github.com/raspberrypi/pico-sdk/blob/master/src/rp2_common/pico_stdio_usb/include/pico/stdio_usb.h#L72
Wiz-IO commented 2021-03-17 11:57:48 -05:00 (Migrated from github.com)

btw: win 7 - unknow device for both ( driver is for SDK 1.0.1 ) - I need to delete from registry driver uuid and restart PC
( will test tomorrow )

btw: win 7 - unknow device for both ( driver is for SDK 1.0.1 ) - I need to delete from registry driver uuid and restart PC ( will test tomorrow )
lurch commented 2021-03-18 07:17:36 -05:00 (Migrated from github.com)

Yes, Windows 7 requires extra steps that Windows 10 doesn't - the getting started guide has a link to https://www.raspberrypi.org/forums/viewtopic.php?f=146&t=300053

Yes, Windows 7 requires extra steps that Windows 10 doesn't - the [getting started guide](https://datasheets.raspberrypi.org/pico/getting-started-with-pico.pdf) has a link to https://www.raspberrypi.org/forums/viewtopic.php?f=146&t=300053
kilograham commented 2021-03-18 07:20:14 -05:00 (Migrated from github.com)

I'm super confused about what does and doesn't work now; does Windows 10 work correctly with a not seen before (different PID) device which uses the reset interface (i.e. is composite)?

I'm super confused about what does and doesn't work now; does Windows 10 work correctly with a not seen before (different PID) device which uses the reset interface (i.e. is composite)?
Wiz-IO commented 2021-03-18 07:33:34 -05:00 (Migrated from github.com)

#define USBD_PID (0x000a) up driver COM4
#define USBD_PID (0xeeea) up driver COM5

someone other to test Reset vendor on Win10 - it doesn't work for me - Unknown device...

#define USBD_PID (0x000a) up driver COM4 #define USBD_PID (0xeeea) up driver COM5 someone other to test Reset vendor on Win10 - it doesn't work for me - Unknown device...
kilograham commented 2021-03-27 09:32:55 -05:00 (Migrated from github.com)

@lurch can you take a look at this to see what does and doesn't work?

@lurch can you take a look at this to see what does and doesn't work?
lurch commented 2021-03-27 09:50:12 -05:00 (Migrated from github.com)

@kilograham I'm afraid all my computers run Linux, I don't have anything with Windows 10 :-/ I think @liamfraser uses Windows though?

@kilograham I'm afraid all my computers run Linux, I don't have anything with Windows 10 :-/ I think @liamfraser uses Windows though?
Wiz-IO commented 2021-03-28 02:47:44 -05:00 (Migrated from github.com)

RESET_0/1.TXT mean PICO_STDIO_USB_ENABLE_RESET_VIA_VENDOR_INTERFACE 0/1
https://github.com/Wiz-IO/framework-wizio-pico/blob/main/SDK/include/pico/stdio_usb.h#L72

logs form WIN10 ... CFG_TUSB_DEBUG=2
https://github.com/Wiz-IO/TEST

**RESET_0/1**.TXT mean PICO_STDIO_USB_ENABLE_RESET_VIA_VENDOR_INTERFACE **0/1** https://github.com/Wiz-IO/framework-wizio-pico/blob/main/SDK/include/pico/stdio_usb.h#L72 logs form WIN10 ... CFG_TUSB_DEBUG=2 https://github.com/Wiz-IO/TEST
kilograham commented 2021-03-28 08:18:29 -05:00 (Migrated from github.com)

OK, thanks that is helpful

OK, thanks that is helpful
liamfraser commented 2021-03-30 09:28:27 -05:00 (Migrated from github.com)

@Wiz-IO if you open Zadig and List all devices what is the driver for the Board CDC interface with the standard VID + PID. It should be usbser:

image

@Wiz-IO if you open Zadig and List all devices what is the driver for the Board CDC interface with the standard VID + PID. It should be usbser: ![image](https://user-images.githubusercontent.com/4839615/113005588-8479c380-916c-11eb-9ae5-386632873d22.png)
Wiz-IO commented 2021-03-30 09:36:26 -05:00 (Migrated from github.com)

my WIN-10 work without Zadig

btw: here it tries to load a second driver
https://github.com/Wiz-IO/TEST/blob/main/RESET_1.TXT#L88

my WIN-10 work without Zadig btw: here it tries to load a second driver https://github.com/Wiz-IO/TEST/blob/main/RESET_1.TXT#L88
kilograham commented 2021-03-30 09:38:52 -05:00 (Migrated from github.com)

Can you please explicitly state exactly what does and does not work

You said higher above that Windows 10 does not work for you, and then you say it does work

Can you please explicitly state exactly what *does and does not* work You said higher above that Windows 10 does not work for you, and then you say it does work
Wiz-IO commented 2021-03-30 09:53:42 -05:00 (Migrated from github.com)

not work reset interface
PICO_STDIO_USB_ENABLE_RESET_VIA_VENDOR_INTERFACE = 1

not work reset interface PICO_STDIO_USB_ENABLE_RESET_VIA_VENDOR_INTERFACE = 1
Wiz-IO commented 2021-03-30 10:00:28 -05:00 (Migrated from github.com)

IF PICO_STDIO_USB_ENABLE_RESET_VIA_VENDOR_INTERFACE = 1 windows say unknown driver... if = 0 the driver is ok, stdio work...
sorry... i write from phone

IF PICO_STDIO_USB_ENABLE_RESET_VIA_VENDOR_INTERFACE = 1 windows say unknown driver... if = 0 the driver is ok, stdio work... sorry... i write from phone
lurch commented 2021-03-30 10:40:46 -05:00 (Migrated from github.com)

The reset interface won't work because it's a "custom interface" which we don't supply a Windows-driver for yet.
But the USB stdio interface should still work with the RESET_VIA_VENDOR_INTERFACE enabled?

The reset interface won't work because it's a "custom interface" which we don't supply a Windows-driver for yet. But the USB stdio interface should still work with the RESET_VIA_VENDOR_INTERFACE enabled?
Wiz-IO commented 2021-03-30 10:48:30 -05:00 (Migrated from github.com)

it doesn't work for me - Test it...

I have disabled it for PlatformIO port
https://github.com/Wiz-IO/framework-wizio-pico/blob/main/SDK/include/pico/stdio_usb.h#L72

it doesn't work for me - Test it... I have disabled it for PlatformIO port https://github.com/Wiz-IO/framework-wizio-pico/blob/main/SDK/include/pico/stdio_usb.h#L72
lurch commented 2021-03-30 10:50:58 -05:00 (Migrated from github.com)

As asked above, can you please show a Zadig screenshot for the Board CDC interface? You might need to enable the "list all devices" option or something.

As asked above, can you please show a Zadig screenshot for the Board CDC interface? You might need to enable the "list all devices" option or something.
Wiz-IO commented 2021-03-30 10:57:28 -05:00 (Migrated from github.com)
I posted it... https://github.com/raspberrypi/pico-sdk/issues/257#issuecomment-801237579
kilograham commented 2021-03-30 11:51:28 -05:00 (Migrated from github.com)

that is not what was asked for, and yes we've obviously tested it and it works fine, so we're trying to help figure out why it doesn't work on your machine

that is not what was asked for, and yes we've obviously tested it and it works fine, so we're trying to help figure out why it doesn't work on *your* machine
Wiz-IO commented 2021-03-30 12:07:01 -05:00 (Migrated from github.com)

Untitled-1

![Untitled-1](https://user-images.githubusercontent.com/14574834/113028030-7b501d00-9193-11eb-9d12-41604c8309f9.jpg)
Wiz-IO commented 2021-03-30 12:32:09 -05:00 (Migrated from github.com)

WIN 7
Untitled-1

WIN 7 ![Untitled-1](https://user-images.githubusercontent.com/14574834/113031126-fc5ce380-9196-11eb-8d7d-01d3f8459090.jpg)
Wiz-IO commented 2021-03-30 12:40:13 -05:00 (Migrated from github.com)

no reset - WIN 7 ( 10 work too )

Untitled-1

**no reset** - WIN 7 ( 10 work too ) ![Untitled-1](https://user-images.githubusercontent.com/14574834/113032076-1cd96d80-9198-11eb-812e-53b71d7e59cf.jpg)
kilograham commented 2021-04-01 11:43:36 -05:00 (Migrated from github.com)

WIN 7
Untitled-1

can you close the dropdown so we can see what is underneath it in this (the reset) case (show the results for both interfaces)

> WIN 7 > ![Untitled-1](https://user-images.githubusercontent.com/14574834/113031126-fc5ce380-9196-11eb-8d7d-01d3f8459090.jpg) can you close the dropdown so we can see what is underneath it in this (the reset) case (show the results for both interfaces)
Wiz-IO commented 2021-04-01 11:51:05 -05:00 (Migrated from github.com)

the Pico USB not exist in this menu

the Pico USB not exist in this menu
kilograham commented 2021-04-01 13:41:54 -05:00 (Migrated from github.com)

what you have selected right there "USB Device Interface 0" and "USB Device Interface 1"

what you have selected right there "USB Device Interface 0" and "USB Device Interface 1"
Wiz-IO commented 2021-04-01 13:54:51 -05:00 (Migrated from github.com)

other USB drivers
Untitled-1

other USB drivers ![Untitled-1](https://user-images.githubusercontent.com/14574834/113340683-dec58080-9334-11eb-8cfe-b8860be78ba0.jpg)
kilograham commented 2021-04-01 13:56:59 -05:00 (Migrated from github.com)

are you able to switch that to WinUSB?

are you able to switch that to WinUSB?
Wiz-IO commented 2021-04-01 14:01:38 -05:00 (Migrated from github.com)

Pico as WinUSB? without reset interface is OK

shot is from WIN 10
Untitled-1

Pico as WinUSB? without reset interface is OK shot is from WIN 10 ![Untitled-1](https://user-images.githubusercontent.com/14574834/113341426-d28df300-9335-11eb-8b3d-67dc83e1ef6b.jpg)
kilograham commented 2021-04-01 14:05:16 -05:00 (Migrated from github.com)

no; are you able to switch libusbK to WinUSB on the broken versions?

no; are you able to switch libusbK to WinUSB on the _broken_ versions?
Wiz-IO commented 2021-04-01 14:12:33 -05:00 (Migrated from github.com)

no driver...
Untitled-1

no driver... ![Untitled-1](https://user-images.githubusercontent.com/14574834/113342567-52688d00-9337-11eb-8588-46f05ee19137.jpg)
Wiz-IO commented 2021-04-01 14:18:29 -05:00 (Migrated from github.com)

can you paste me compilator verbose log ( part )
with PICO_STDIO_USB and PICO_STDIO_USB_ENABLE_RESET_VIA_VENDOR_INTERFACE = 1

can you paste me compilator verbose log ( part ) with PICO_STDIO_USB and PICO_STDIO_USB_ENABLE_RESET_VIA_VENDOR_INTERFACE = 1
lurch commented 2021-04-01 14:53:14 -05:00 (Migrated from github.com)

http://www.linux-usb.org/usb.ids says that 09DA:9066 is "A4Tech Co., Ltd. F3 V-Track Gaming Mouse".

http://www.linux-usb.org/usb.ids says that 09DA:9066 is "A4Tech Co., Ltd. F3 V-Track Gaming Mouse".
Wiz-IO commented 2021-04-01 15:00:15 -05:00 (Migrated from github.com)

yep, it is my mouse :)

yep, it is my mouse :)
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#257
No description provided.