AN73503 - USB HID Bootloader for PSoC® 3 and PSoC 5

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

 An awaited and awesome appnote is here!

   

Link : http://www.cypress.com/?rID=57561

   

Enjoy the power of the PSoC! 🙂

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi,

   

After receiving help from my customer base with VS 2015 programming (which I a far from knowledgeable about), attached is the complete source for a working stand alone bootloader host.   It has been tested on a clean (only default installation) Windows 10 machine.  NOTE: the Microsoft Visual C++ 2015 Redistributable (x86) must also be installed on the target host machine. 

   

Regards,

   

Ron

View solution in original post

0 Likes
17 Replies
Anonymous
Not applicable

 This App Note can be used as a starting point to get started with USB Bootloader. The source code for a stand-alone GUI is avalable with this App Note. Take this source code and modify it to suit your needs. Note that this GUI is for windows only. On similar lines, application for Linux and MAC OSX can be developed. 

   

Post your suggestions and improvements here, which will be incorporated in the next revision of the GUI. If any other help is required as far as the tool is concerned, post it here.

Anonymous
Not applicable

AN73503 - USB Bootlader is wonderful and very very useful.

   

Thanks for Cypress.

   

Now I tested the AN73503 Bootloader Host(C# application) to program the firmware to my device.

   

It works very well.

   

But the writting time is somewhat long about 2 minutes.

   

 

   

For comparison, the same firmware is written to my device using "PSoC Creator Bootloader Host Program" It was very fast about only 5 second to finish writting.

   

 

   

Is the any method to shorten the writting time using AN73505 USB Bootloader Host ?

   

 

   

ps. My PC OS is Windows XP 32bit.

0 Likes
Anonymous
Not applicable

Hello which device are you trying to porgram ? PSoC3 or PSoC5. waht is the size of the flash. You can reduce the write time modifying a parameter in the source code. Are you familiar with C# coding ?

0 Likes
Anonymous
Not applicable

Thanks  U2,

   

My Device is psoc3 CY8C3446. 

   

flash size is 106kbyte. ( = *.cyacd file size)

   

 

   

 

   

I checked the source file(Delegated_Functions.cs)  included AN73503. 

   

I found the "Sleep(100)" in the WriteData() method.

   

/* We neeed this delay for Bootload operation to be successsful */
                System.Threading.Thread.Sleep(100); 

   

May be this is time consumming routine. 100 msec is very long.

   

I want to shorten this time.

   

However, I  wonder  if I shorten this time about 1ms make some trouble to write flash.

   

It is very helpful if I know delay time of  "PSoC Creator Bootloader Host Program". I wil set the same time delay.

0 Likes
Anonymous
Not applicable

CEO, that is the delay I am talking about. That delay is required in order to get a response from PSoC once you send a bootloader command to it. You can go to delays as low as 40ms. This number is as per my test results. You can continue lowering this vlaue until the point where your bootload process does not fail.

0 Likes
Anonymous
Not applicable

I am currently working on an SD-card based USB-bootloader and a multi-protocol bootloader

   

SD Card based bootloader is in essence like a regular USB HID bootloader,but if an SD card is present,it will load a .cycad file from there instead,and bootload "itself".

   

Multi-protocol is just a regular bootloader,which presents a menu(on a uart terminal) on power-on,allowing you to select the communication protocol that can be used for bootloading.. USB/I2C/SPI/SdCard...

   

Both of these are work in progress things,which is currently on pause since I lost my Harddisk,and lost the code too(backup..backup..backup!).. I'll post updates and more as soon as I get it back from warranty replacement..

0 Likes
Anonymous
Not applicable

Hello,

   

I have downloaded and built the usbbootloaderhost application as supplied with AN73503.  The release version was built and tested and it works fine on my PC.  One of my customers is testing the application as I indent to distribute this with a new product we are currently testing.  However it will not work on the customers PC.  Windows (Win 10) is reporting it can not find USBBootloader_Utils.dll.  I know the file is included with the customer distribution as I am distributing everything in the release directory plus the USBBootloader_Utils.dll. I am at a lose as to why this is happening.  Please see below the output of Windows when the application fails

   

Any help is greatly appreciated,

   

Regards,

   

Ron

   


See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.DllNotFoundException: Unable to load DLL 'BootLoader_Utils.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
   at USBBootloaderHost.Bootloader_Utils.CyBtldr_Program(String file, Byte[] securityKey, Byte appId, CyBtldr_CommunicationsData& comm, CyBtldr_ProgressUpdate update)
   at USBBootloaderHost.Form1.button2_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5485 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
USBBootloaderHost
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/Joel/Desktop/Omnia%20Firmware/USBBootloaderHost.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5491 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.8686 (QFE.050727-8600)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5495 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
CyUSB
    Assembly Version: 3.4.7.0
    Win32 Version: 3.4.7.0
    CodeBase: file:///C:/Users/Joel/Desktop/Omnia%20Firmware/CyUSB.DLL
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.


Joel

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hello Ron,

   

Could you try the attached files? I've built with release option.

   

If it is debug option, as you know, some system needs to be installed proper development environment. 

   

The release option is not required the "Bootloader_Utils.dll" file. 

   

I've attached two zip files, one is the zipped release output folder, second is zipped an entire VS project for release option.

   

Thank you,

   

Brian

0 Likes
Anonymous
Not applicable

Hello Brian,

   

I attempted to use the application as provided in the Release.zip.  Sorry but it does not work as the Windows is reporting that it can not find the bootloader_Utils.dll: System.DllNotFoundException: Unable to load DLL 'BootLoader_Utils.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E).   Is there a static version of the libraries which may be bound to the executable at build time? 

   

Later I will examine the VS project you have provided.

   

Regards,

   

Ron 

   

 

   

The full output is below:

   


See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.DllNotFoundException: Unable to load DLL 'BootLoader_Utils.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
   at USBBootloaderHost.Bootloader_Utils.CyBtldr_Program(String file, Byte[] securityKey, Byte appId, CyBtldr_CommunicationsData& comm, CyBtldr_ProgressUpdate update)
   at USBBootloaderHost.Form1.button2_Click(Object sender, EventArgs e) in C:\p4v\local\WPP\001-73503\test\USBBootloaderHost\Form1.cs:line 286
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.8689 (QFE.050727-8600)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
USBBootloaderHost
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/Ron/Downloads/Release/USBBootloaderHost.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.8670 (QFE.050727-8600)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.8690 (QFE.050727-8600)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.8681 (QFE.050727-8600)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
CyUSB
    Assembly Version: 3.4.7.0
    Win32 Version: 3.4.7.0
    CodeBase: file:///C:/Users/Ron/Downloads/Release/CyUSB.DLL
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

0 Likes
Anonymous
Not applicable

Hello Ron,

   

I don't know why it requires the dll in your end. I did test with Windows10 x64 which didn't have any Visual studio but it worked well. 

   

The Application Note is a reference of GUI, but Cypress is not an expert for PC GUI and debugging individual environment is out of our scope. Please check with Visual studio forum for more deeper issue. 

   

Thank you,

   

Brian 

0 Likes
Anonymous
Not applicable

Hello,

   

I still can not get this to work.  Cypress must have some resources to work on this.  PSoC Creator is all PC GUI and related.  The utility still reports Bootloader_Utils is missing.  What version of VS was used to compile the utility?  Do I need the Microsoft redisbutible?

   

If we can't get this working, Cypress is going have about 150 folks downloading Creator in very short order.

   

Regards,

   

Ron Patton

Anonymous
Not applicable

Make that 300 folks.

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi,

   

After receiving help from my customer base with VS 2015 programming (which I a far from knowledgeable about), attached is the complete source for a working stand alone bootloader host.   It has been tested on a clean (only default installation) Windows 10 machine.  NOTE: the Microsoft Visual C++ 2015 Redistributable (x86) must also be installed on the target host machine. 

   

Regards,

   

Ron

0 Likes
JoBr_1593366
Level 5
Level 5
100 sign-ins 50 questions asked 100 replies posted

All of the attached files say "Unable to load DLL 'BootLoader_Utils.dll': The specified module could not be found" on Windows 7 64-bit

   

 

   
    
See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.  ************** Exception Text ************** System.DllNotFoundException: Unable to load DLL 'BootLoader_Utils.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)    at USBBootloaderHost.Bootloader_Utils.CyBtldr_Program(String file, Byte[] securityKey, Byte appId, CyBtldr_CommunicationsData& comm, CyBtldr_ProgressUpdate update)    at USBBootloaderHost.Form1.button2_Click(Object sender, EventArgs e) in C:\Users\Ron\Desktop\USBBootloaderHost\USBBootloaderHost\Form1.cs:line 286    at System.Windows.Forms.Control.OnClick(EventArgs e)    at System.Windows.Forms.Button.OnClick(EventArgs e)    at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)    at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)    at System.Windows.Forms.Control.WndProc(Message& m)    at System.Windows.Forms.ButtonBase.WndProc(Message& m)    at System.Windows.Forms.Button.WndProc(Message& m)    at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)  ************** Loaded Assemblies ************** mscorlib     Assembly Version: 2.0.0.0     Win32 Version: 2.0.50727.8669 (QFE.050727-8600)     CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll ---------------------------------------- USBBootloaderHost     Assembly Version: 1.0.0.0     Win32 Version: 1.0.0.0     CodeBase: file:///D:/Documents/Cypress%20USB%20Audio/USB%20bootloader%20hosts/USBBootloaderHost%20(Ron's)/USBBootloaderHost/bin/x86/Release/USBBootloaderHost.exe ---------------------------------------- System.Windows.Forms     Assembly Version: 2.0.0.0     Win32 Version: 2.0.50727.8653 (QFE.050727-8600)     CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll ---------------------------------------- System     Assembly Version: 2.0.0.0     Win32 Version: 2.0.50727.8686 (QFE.050727-8600)     CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll ---------------------------------------- System.Drawing     Assembly Version: 2.0.0.0     Win32 Version: 2.0.50727.8681 (QFE.050727-8600)     CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll ---------------------------------------- CyUSB     Assembly Version: 3.4.7.0     Win32 Version: 3.4.7.0     CodeBase: file:///D:/Documents/Cypress%20USB%20Audio/USB%20bootloader%20hosts/USBBootloaderHost%20(Ron's)/USBBootloaderHost/bin/x86/Release/CyUSB.DLL ----------------------------------------  ************** JIT Debugging ************** To enable just-in-time (JIT) debugging, the .config file for this application or computer (machine.config) must have the jitDebugging value set in the system.windows.forms section. The application must also be compiled with debugging enabled.  For example:  <configuration>     <system.windows.forms jitDebugging="true" /> </configuration>  When JIT debugging is enabled, any unhandled exception will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box. 
   
0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi,

   

Sorry it is not working for you.  I have tested this many times on a clean Win 10 machine.  I have attached a zip file with only what I believe are the files needed for bootloader host.  Also, please be sure that you have installed the X86 version of the Redistributable (x86). This version of bootloader host will not work with the 64 bit version.

   

Regards,

   

Ron

lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hello Ron,

   

Recently I figured out Visual Studio Community 2015 has a default configuration which is required msvcr100.dll C++ dll creation. 

   

The runtime library should be built with Multi-threaded (/MT).

   

I've uploaded the updated project files for bootloader_utils and host. You can try the project(USBBootloaderHost.zip)

   

Thank you for your valuable feedback, I appreciate that.

   

-Brian L

0 Likes
Anonymous
Not applicable

Hello Brian,

   

The new version appears to work.  I have been successful in building the supplied source and running running the resulting DLL.  I have given the application to my customer base as a beta release for testing.  I will let you know how it works in the field after I receive comments from the customers.

   

Regards,

   

Ron

0 Likes