3 Replies Latest reply on Sep 28, 2012 7:48 AM by userc_40307

    USB behaviour for USB HID bootloader and application

      In our application we will a high number of PSoC 3 devices on a USB-tree and want to use the  USB bootloader.


      Now I wonder how the process of the bootloader starting first and later the application looks from a USB perspective.


      Is the device enumerated twice and the application uses a different vendorID/deviceID than the bootloader?


      Alternatively I could define two configurations both in the bootloader and in the application


      and let the driver of my application switch the configuration (or do that at the end of the bootloader host).


      That would be much cleaner in my opinion and avoid the double enumeration.


      I probably need to modify the bootloader host code (use libusb or similar), because my device will not be a HID class for my application. I could also allow to trigger a new bootloading by switching the configuration back to "bootloader" and make my appliction code trigger for config changes and entering the bootloader when this happens.


      The question is, whether I can avoid that the device reset (that is done at the end of the bootloader when starting the application)  will reset the USB component such that this is  is visible to the USB side.



        • 1. Re: USB behaviour for USB HID bootloader and application

          The principle way a bootloader works includes some checks at a very early stage:


          1st. Is a device present from which a bootloadable can be downloaded?


          2nd Is the bootloadable a different version than the current?


          When both questions are answered with "yes" the bootload-process can start.


          Cypress's Bootloaders are organized in a way so that you may integrate any communication interface for the bootloading process, have a look at an example here:http://www.cypress.com/?rID=50230


          So using USB for bootloading will work. you may search as well in the "Keyword Search" at the top of this page for "bootloader usb" and go through the references found.





          • 2. Re: USB behaviour for USB HID bootloader and application

            More info on bootloader, attached.




            Regards, Dana.

            • 3. Re: USB behaviour for USB HID bootloader and application



              You are correct in saying that once the bootlaoder ends, PSoC will undergo a reset to start application code. When you look at it from USB host perspective, host will see the disconnect of HID bootloader device and then it will recognise a different device as per your application.

              From the PC application perspective, you will need to write application for two devices: one would be the bootlaoder and the other would be the bootloadable. If you ask me, I will disable the 'wait for command' checkbox in bootloader so that at the power up and in normal conditions, the bootloader will not enumerate at all and the first device that the host will see will be the device as you define in your application.

              When you want to bootload, you could implement a vendor command in your application USB device to start bootloader operation by calling Bootloadable_Load API.
              AN56377 - PSoC® 3 and PSoC 5 USB Transfer Types has a good example of implementation of vendor commands with PSoC. Once the vendor command is sent out, PC application can start looking for detection of bootloader HID device and once bootloading is finished, it can start looking for application USB device.