Firmware updater with C# windows application

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

cross mob
Shafi
Level 3
Level 3
50 sign-ins First solution authored 10 questions asked

Hello experts,

I trying to design a host application to update the firmware of my device. I am following CyControlCenter.pdf provided in the SDK  -->C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\application\c_sharp.

I have struck up at  one place i.e., the devices which are in bootloader mode can only be detected by Control center and shown up in Device tree. I am trying to imitate this behavior in such a way that my application needs to detect the devices which are in device mode and needs to communicate with it further.

Is it possible to communicate with devices which are in device mode?

If yes, could you please give a hint to do this?

 

Thank you,

Shafi.

0 Likes
1 Solution
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello Shafi,

You want the device to enumerate as UVC + Vendor device. If the composite device has the vendor interface, only then you will be able to bind it to cyusb3 driver.

Please refer to this KBA for adding vendor interface to UVC https://community.infineon.com/t5/Knowledge-Base-Articles/Vendor-Interface-in-UVC-KBA218335/ta-p/247... 

Once, the vendor interface is added, please add the code to read/write to/from SPI Flash based on the vendor commands. You can refer to USBFlashProg example in the FX3 SDK

Regards,
Rashi

View solution in original post

0 Likes
8 Replies
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hi Shafi,

I understand that you are developing a custom host application to communicate with FX3 in bootloader mode.

Please let me know what communication you want to do with the device in the bootloader. The bootloader supports only the vendor commands sent by the Control Center.

Regards,
Rashi
0 Likes

Hi Rashi_Vasta,

>>I understand that you are developing a custom host application to communicate with FX3 in        bootloader mode.

No, I am developing a custom host application to communicate with CX3 in device mode.

My custom host application needs to access the SPI flash of my CX3. I need to read/write the SPI flash through this app. 

My question is --- Is it possible to communicate(spi read/write) with CX3 which is in device mode?

According to control center logic, they treat bootloader devices as CyUSB devices. Can I treat device mode CX3 as CyUSB device?

Thank you,

Shafi.

 

0 Likes
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello Shafi,

Okay, understood.

My question is --- Is it possible to communicate(spi read/write) with CX3 which is in device mode?

>> No, SPI Read/Write is not possible when the device in bootloader mode. When Program > SPI Flash is done in the Control Center, the control center programs the CyBootProgrammer.img (C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\bin)  to device's RAM and CyBootProgrammer helps to read/write to the SPI Flash connected to FX3/CX3

According to control center logic, they treat bootloader devices as CyUSB devices. Can I treat device mode CX3 as CyUSB device?

>> Yes, if the device (FX3/CX3) is binded to cyusb3 driver, it can be detected by your host application which uses CYUSB.NET APIs

Regards,
Rashi
0 Likes

Hi,

Thank you for your response. 

I am still not convinced that ---Can I able to access the SPI flash(to read/write) after binding the CX3 device(device mode) with Cyusb3 driver?

I am able to see my device in my host application, but I cant able to access its SPI flash to read/write.

What I am thinking is -- since my CX3 is in device mode(not in bootloader), my app cant access SPI flash of connected device.  Is my thinking is correct?

By the way I have invoked CyBootProgrammer in my host application which is required for SPI read/write operation.

Can you share any idea to reach SPI flash in device mode?

Thank you,

Shafi.

 

0 Likes
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hi Shafi,

I am able to see my device in my host application, but I cant able accessing its SPI flash to read/write.

>> As explained in my previous response, Cx3 in bootloader cannot read/write to SPI Flash if the PMODE lines are configured for USB boot.  

To write/read to SPI Flash, you would need to program CyBootProgrammer.img to CX3 and then read/write to SPI Flash.

What I am thinking is -- since my CX3 is in device mode(not in bootloader), my app cant access SPI flash of connected device.  Is my thinking is correct?

>> Please let me know what do you mean by device mode. Which firmware is programmed to CX3 when it is coming up as cyusb3 device in host application

Can you share any idea to reach SPI flash in device mode?

>> Please help me to understand which firmware is programmed to CX3 when you say CX3 is in device mode

Regards,
Rashi
0 Likes

Hi Rashi,

Please let me know what do you mean by device mode. Which firmware is programmed to CX3 when it is coming up as cyusb3 device in host application.

>> UVC firmware is programmed to Cx3. 

As I am interested to update my UVC device firmware, I filtered the USB devices and displayed only UVC devices in the TreeView in app. This filtration is done with the help of Management library. 

By this I can able to display my UVC device in C# app, after that I am trying to bind my UVC device with CyUSB driver as CyUSBDevice but I am not able to do that.

Can you help to understand that only bootloader mode devices are able to bind with CyUSB driver? Or we can bind UVC device  to CyUSB driver?

I just need this confirmation. Please confirm me with this.

Thank you,

Shafi.

 

 

0 Likes
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello Shafi,

You want the device to enumerate as UVC + Vendor device. If the composite device has the vendor interface, only then you will be able to bind it to cyusb3 driver.

Please refer to this KBA for adding vendor interface to UVC https://community.infineon.com/t5/Knowledge-Base-Articles/Vendor-Interface-in-UVC-KBA218335/ta-p/247... 

Once, the vendor interface is added, please add the code to read/write to/from SPI Flash based on the vendor commands. You can refer to USBFlashProg example in the FX3 SDK

Regards,
Rashi
0 Likes

Hello,

Okay, Thank you Rashi.

Shafi.

0 Likes