PSOC4 USB UART Bootloader implementation

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

cross mob
N_SE_329246
Level 1
Level 1
First like received

Hello every one,

we are working on a PSOC4245 based USB_UART device, we have completed the basic application functionality .now its time to add the firmware update functionality over USB-Uart. we have created 2 projects one with bootloader & Bootloadable components. in bootloader just "bootloader start(); is used. in bootloadable no code is added related to bootloading. confused about whether bootloader component handles all USB uart traffic and all communication ,flash updating thing, or do we need to add any code. kindly point me to some examples which has both bootloader & application firmware updating support example codes via USB_UART. so we can add that code to our main application.Thank you

with regards

Dr.N.Chandra sekhar,M.Tech,phd

0 Likes
1 Solution
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello N.SE_329246

We have a USBFS Bootloader - Bootloadable code example for PSoC 4. The example demonstrates Bootloading via USB communication interface and Switching between Bootloader and Bootloadable applications. The link to project is: https://www.cypress.com/documentation/code-examples/ce95391-psocr-usb-hid-bootloader

The document with the associated with code example contains the complete steps required for the operation

We have a small example of USBUART bootloader. But this can be used only with Bootloader Host Tool given by Cypress. Else you will need to create a bootloader host tool of similar pattern. The example project is available in the link:

https://www.hackster.io/hima/usbuart-bootloader-16cc46

In case you do not want to switch between the USB CDC an HID is it possible for you to use only the HID class?

Can you please let me know why is it necessary to use only the USB CDC class?

Best Regards

Ekta

View solution in original post

0 Likes
5 Replies
JeMe_288686
Level 1
Level 1

You create your application and you add a bootloadable component, then click on it and add the bootloader dependencies. You build your app, this will create a cyacd file that Bootloader Host application will use to reprogram the psoc4.

Note that the dependencies are two files that must be included in your project. This code when activated will communicate with Bootloader Host application. You can create a new bootloader project to create dependencies or use dependencies from cypress kits.

The bootloader must be activated. It depends on how the bootloader is created. (the bootloader can be automatiically activated after reset)

Once the bootloader is activated, you use Bootloader Host application to reprogram the psoc4.

If you need information concerning the protocol to reprogram the psoc4, it is available on the Cypress site.

You can also create your own Bootloader host application. I have build one in C# that package the programming protocol in UDP packets. I use an ESP8266 to reset and reprogram the psoc4 by WiFi,

0 Likes

hi,

yes we did the same.

but in the bootloader project if there is USB HID, then uploading of firmware working properly. but our application uses USB -CDC. , we would like to use USB-UART for the bootloader ,uploading of firmware. but when i choose USB-UART ,i am getting error

02:25:43 AM - Selected device: Communications Port (COM1) - UART

Generic Serial Port

02:25:43 AM - Selected device: USB Serial Device (COM3) - UART

Generic Serial Port

02:25:45 AM - program Started

02:25:50 AM - The semaphore timeout period has expired.

02:25:50 AM - Communication port reported error 'Unable to write data to the target device'.

02:25:50 AM - program failed in 5013 ms.

we dont want to switch between HID & CDC. we would like to have CDC USB-UART mode in both bootloader and bootloadable mode.

Thank you

0 Likes
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello N.SE_329246

We have a USBFS Bootloader - Bootloadable code example for PSoC 4. The example demonstrates Bootloading via USB communication interface and Switching between Bootloader and Bootloadable applications. The link to project is: https://www.cypress.com/documentation/code-examples/ce95391-psocr-usb-hid-bootloader

The document with the associated with code example contains the complete steps required for the operation

We have a small example of USBUART bootloader. But this can be used only with Bootloader Host Tool given by Cypress. Else you will need to create a bootloader host tool of similar pattern. The example project is available in the link:

https://www.hackster.io/hima/usbuart-bootloader-16cc46

In case you do not want to switch between the USB CDC an HID is it possible for you to use only the HID class?

Can you please let me know why is it necessary to use only the USB CDC class?

Best Regards

Ekta

0 Likes

Hello,

i tried USBFS, and it works. now my problem is, uploading tool. do you have any Vc# source code or any application just  like bootloader tool. in our application, its a serial mouse device for a specific application. so we choose Usb cdc. it is okay to use USB FS in bootloader mode as it has faster uploading speed. but we need to build a tool with simple steps, so it should open the serial port, send a reset command to psoc, then while booting it changes to USBFS, from then we want to make the readily available bootloader tool to take control. in between we would like to keep the bootloader waiting time to 1 to 2 secs only,else it will get delayed for normal application loading every time ,we plug it.

so our plan is, if you have any vC# application source code for Bootloader tool, we would like to add some serial port handling, connect to device when a program button is pressed, then it will send reset command to psoc, then serial port will be closed, automatically connects to USB FS  and completes the download.

if there is any source code for bootloader tool.kindly share it.Thank you

0 Likes
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello N.SE_329246​,

We cannot share the source code of the bootloader tool.

Please refer to the following appnote: PSoC® 3, PSoC 4, and PSoC 5LP UART Bootloader: https://www.cypress.com/file/216621/download

The appnote covers the following Bootloader Host topic:

  • How to use the Bootloader Host Tool
  • The basic building blocks and functionality of a bootloader host system
  • How to create an embedded UART bootloader host using PSoC 5LP
  • How to create a PC bootloader application

The app note is talks about Creator 3.1, but the process is still valid.

All APIs can be found here: C:\Program Files (x86)\Cypress\PSoC Creator\4.3\PSoC Creator\cybootloaderutils

Best Regards

Ekta

0 Likes