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?
USB Memory Stick PIC24/PIC32
Moderator: Benj
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: USB Memory Stick PIC24/PIC32
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: USB Memory Stick PIC24/PIC32
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.
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.
-
Steve001
- Valued Contributor

- Posts: 1189
- Joined: Wed Dec 31, 2008 3:37 pm
- Has thanked: 460 times
- Been thanked: 523 times
Re: USB Memory Stick PIC24/PIC32
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
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
Success always occurs in private and failure in full view.
Re: USB Memory Stick PIC24/PIC32
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.
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.
-
Steve001
- Valued Contributor

- Posts: 1189
- Joined: Wed Dec 31, 2008 3:37 pm
- Has thanked: 460 times
- Been thanked: 523 times
Re: USB Memory Stick PIC24/PIC32
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
http://uk.farnell.com/ftdi/vnc1l/embedd ... dp/1329312
would this be usable or still too expensive
Steve
Success always occurs in private and failure in full view.
Re: USB Memory Stick PIC24/PIC32
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.
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.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: USB Memory Stick PIC24/PIC32
Let us know how you're getting on.
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
Yes bootloaders are generally very specific to the hardware, AVR and PIC are very different beasts.Would an AVR bootloader be very much different to PIC24?
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.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?
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
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel