I have a PSoC5LP application which includes bootloader and bootloadable components. On power-up, the bootloader checks the state of a pushbutton. If the pushbutton is pressed, it enters the boot mode and waits indefinately for data over the USB to reprogram the application. Whilst in boot mode, a LED flashes indicating that it is in boot mode. This works perfectly as intended.
I have a C# project running on my PC which is based on the 'USBBootloaderHost_VC2015' application contained in USBBootloaderHost_VC2015.zip which is attached to application note AN73503_USB_HID_Bootloader_for_PSoC_3_and_PSoC_5LP_0.pdf downloaded from the Cypress web site.
I can successfully program the PSoC5LP device by switching it into boot mode as described above and running the PC application which verifies that the PC application is running correctly.
I want to be able to send a command over the USB while the PSoC5LP is running the application, to tell it to switch into boot mode to allow me to upload a firmware update.
The way I am trying to accomplish this is for the PC to send a text string "Program" via the USB to the PSoC5LP. When the PSoC5LP receives this string, it responds with "Ok". The PSoC5LP shuts down all the peripherals, and calls Bootloadable_1_Load(); which forces a reset into boot mode. indicated by the LED flashing.
Meanwhile, when the PC receives the "Ok", it waits for 5 seconds to allow the PSoC5LP to switch into boot mode, then starts the reprogram sequence which fails on attempting to send the first block of data.
I have a USB analyser connected between the PC and the PSoC5LP, so I am able to monitor all the USB communications.
I can see the "Program" string and the "Ok" response followed 6 seconds later by a number of descriptor blocks, but no data blocks.
Putting a breakpoint in the PC software following the line 'status = BootloaderHIDDevice.WriteOutput();' in the WriteData function, I can see that it returns a status of false.
What is going wrong?!