USB host on Pico- do we need a host controller chip ? #5050
Replies: 1 comment
-
Posted at 2022-01-05 by @gfwilliams Hi Simon, I'm afraid nothing has progressed on USB Host. While possible with the hardware (although I think most implementations add some kind of USB switch device?) there'd be a lot of software work required in Espruino, and that hasn't been done. So I think your main options would be:
Sorry to not have better news! Posted at 2022-01-05 by @SimonGAndrews Thanks Gordon, Posted at 2022-01-05 by @SimonGAndrews I’ll investigate a bit more , Signed up to Udemy course on interfaces in embedded c, for stm32 !!! but no promises. Out of interest , and maybe mid term answer to my problem, have you decided if, the new Espruino Wi-fi Board might support USB host ! Or use hardware that could. ? If one was going to invest time in this maybe it be better spent that way. Thanks again for considered response. Posted at 2022-01-07 by @gfwilliams I'm pretty sure the new Wifi won't support USB Host I'm afraid - it'll be using the nRF52840 which supports device only :( Posted at 2022-01-07 by @SimonGAndrews Indeed :( Posted at 2022-01-18 by @SimonGAndrews Hi, Will add discussion on an approach for comment after more learning on my part. Found great basic USB tutorial. Trying to get hold of a STM32F407G DISC BOARD for the development as it has debug capability and USB wired up to STF32F4.... But struggling on availability, just spoke to Anglia Live sales rep to complete questionnaire on my 'project' to justify having stock allocated to me ! If ok , will raise an issue for an enhancement 'Provide USB Host functionality on Pico' on Github to formalise the work, in case it helps with supply issue of the dev board. And then can have discussion there on the approach . Posted at 2022-01-18 by @SimonGAndrews Just heard the discovery board has been dispatched :) Posted at 2022-01-18 by @SimonGAndrews From the GitHub commits and changes of the STM drivers in Espruino (targetlibs/stm32usb/Src/) back in 2015 , it looks like GWilliams was very busy and there were a ton of changes to the STM libraries to get USB working in Espruino. SO .... clearly changing existing functionality to use more recent STM libraries is not agood idea ! So approach has to be that any Host functionality is all incremental and sits beside existing device virtual com and HID. However that also makes sense, looking at the current STM host libraries in ... they would be a parallel set to the existing device libraries on the stack. See Attached pic. Attachments: Posted at 2022-01-18 by @SimonGAndrews complicated ....... still early days. update in a couple of weeks. Posted at 2022-01-20 by @SimonGAndrews Realised that given my requirement is to input to pico from usb barcode readers that are usually capable of output in virtual com mode, then may only need host CDC capability on the pico and not need host HID also. So will start with host CDC . Posted at 2022-01-20 by @SimonGAndrews Initially , looks like CDC is an easier implementation and needing fewer library files. Posted at 2022-01-24 by @gfwilliams I think probably CDC - with that you can pretty much just open up the right endpoint (which you could hard-code rather than trying to read the descriptors on the fly) and then you should usually receive serial data on it. I don't think there's much other setup required (but I guess it depends on the device) Posted at 2022-01-24 by @SimonGAndrews Thanks Gordon, CDC it is. Posted at 2022-02-25 by @SimonGAndrews Quick status ... still putting in lots of hours on this. Steep learning curve for me. Achieved so far,
Attachments: Posted at 2022-02-25 by @SimonGAndrews P.s any advice always appreciated. Posted at 2022-02-25 by @SimonGAndrews A little wire wrapping going on in the mean time. :) Attachments: Posted at 2022-02-28 by @gfwilliams Looks great! Hope it goes well! Yes, building with the new ST APIs is a bit of a pain. You may find some clues in the |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-01-01 by @SimonGAndrews
hi,
I am trying to input data to a pico from a USB barcode reader (in either HID or virtual com mode).
OTG is not required , USB would be a dedicated input.
Happy to dig deeper and get a logic analyser on the case but USB low level signalling is a new world for me. Searching the forums :
https://www.hackster.io/gerrit-niezen/adding-usb-host-support-to-espruino-2c494d
So my questions here are:
and any suggestions on investigations I could do to move this forward appreciated.
Thanks in Advance
Simon
Beta Was this translation helpful? Give feedback.
All reactions