Page 1 of 1
USB Memory Stick PIC24/PIC32
Posted: Wed Jan 25, 2017 10:27 am
by Synergy6
Hi,
We are looking into a feature on an up and coming project.
We would like to add in USB support. The USB port will be used to read and write to a memory flash drive.
Is it currently possible to do this with FC?
If it is not, what do i need to look into to get it working? Is it just a case of writing a USB stack?
Further to this we would like to read update data from the USB Stick, and then reprogram the PIC Microcontroller with that data using a bootloader.
I guess a bootloader would need to be written for this application. Is it possible to do this as the USB stack would be quite big. Is there a limit to how big a bootloader can be?
Re: USB Memory Stick PIC24/PIC32
Posted: Wed Jan 25, 2017 11:09 am
by Benj
Hello,
Reading a USB flash drive is not currently possible however it certainly would be a nice feature and is on our to do list. Though maybe some way down the list.
To support the flash drive you would not only need an OTG USB stack but also a file system stack once you have access to the drive, so lots of code required to pull this off.
The maximum allowed size of the bootloader depends on the device you're using. PIC24 and PIC32 devices should be quite flexible.
I have written firmware for a SD card AVR programmer before and this would be my advice for now, instead of a USB dongle use an SD card as it's already supported in Flowcode and much less effort to pull off.
Re: USB Memory Stick PIC24/PIC32
Posted: Fri Jan 27, 2017 1:12 am
by Synergy6
Hi Ben.
Would an AVR bootloader be very much different to PIC24?
If it would follow a similar type of code, would it be at all possible to get a look at your AVR bootloader please. Assuming of course it was written in flowcode?
An SD card would be easier i admit, from an end user point of view im not sure if it is most convinient.
Re: USB Memory Stick PIC24/PIC32
Posted: Fri Jan 27, 2017 2:10 pm
by Steve001
Hi Synergy
Have you seen FTDI Vdrive ?
http://uk.farnell.com/ftdi/vdrive2/mod- ... dp/1615834
There are a couple of posts on the forums about using them
Steve
Re: USB Memory Stick PIC24/PIC32
Posted: Sat Jan 28, 2017 11:02 am
by Synergy6
Hi Steve.
I have breifly looked at the vdrive. Our project is price sensitive so such devices in this instance are not suitable.
I am currently torn between SD card or USB. SD card makes for easier coding but has its downsides in terms of customer useability and also how it would fit in our design.
USB is much more desirable but has the problem of major coding.
Another curveball recently thrown into the mix recently was using WiFi to update. The ESP8266 seems an ideal candidate. Has anyone had any experience in using the ESP8266 in conjunction with a bootloader.
Re: USB Memory Stick PIC24/PIC32
Posted: Sat Jan 28, 2017 11:08 am
by Steve001
This is the device within the vdrive
http://uk.farnell.com/ftdi/vnc1l/embedd ... dp/1329312
would this be usable or still too expensive
Steve
Re: USB Memory Stick PIC24/PIC32
Posted: Sat Jan 28, 2017 6:54 pm
by Synergy6
Hi
For the purpose of only reading/writing to USB flash drive this is too expensive for our end product.
I would rather spend this on more functional components such as WiFi or a more capable microcontroller.
I think i might have a bash at writing the USB firmware and see how far in i can get.
Re: USB Memory Stick PIC24/PIC32
Posted: Mon Jan 30, 2017 12:45 pm
by Benj
Let us know how you're getting on.
Would an AVR bootloader be very much different to PIC24?
Yes bootloaders are generally very specific to the hardware, AVR and PIC are very different beasts.
If it would follow a similar type of code, would it be at all possible to get a look at your AVR bootloader please. Assuming of course it was written in flowcode?
My code is for an external ICSP programmer, not a bootloader. It was done as a commercial project so I'm afraid I'm not at liberty to share it out just saying it wasn't too much work to get working having tackled ICSP programming previously.
The Microchip Solutions library has a lot of example code including bootloaders and should be a good starting point.
http://www.microchip.com/mplab/microchi ... plications