Writing the fxapp firmware library to the FX3

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

cross mob
Jarrod
Level 1
Level 1
5 replies posted 10 sign-ins First reply posted

Hello, 

I have followed several guides/documents/posts in an attempt to program the FX3 device with the USBVIdeoClassBulk Web Cam application with an updated firmware library located in FX3_SDK_1_3_1_SRC/sdk/firmware/src/fxapp. I am successful in writing the USBVideoClassBulk  application to the FX3 device. I see the device registers in Device Manager under Cameras as, "FX3". I then use Wireshark to monitor the USB traffic and note the Device Descriptor: 

Jarrod_0-1655324706786.png

The code that is responsible for populating the Device Descriptor is found FX3_SDK_1_3_1_SRC/sdk/firmware/src/fxapp/cyfxmain. 

I used fx3_firmware_read document to build the FX3 firmware libraries found here: https://community.cypress.com/gfawx74859/attachments/gfawx74859/usb-superspeed-peripherals/5750/1/FX...

With the libraries built, I used this post to correctly link the .a files noted in the FX3FirmwareSourceUserGuide to my USBVideoClassBulk project within eclipse https://community.infineon.com/t5/USB-superspeed-peripherals/FX3-Error-building-library-files/m-p/64...

Finally, I made sure to go to Properties->Project References->sdk to include the sdk folder structure within my USBVideoClassBulk project within Eclipse. I followed this post to correctly link the sdk folder structure to my project . 

https://github.com/nickdademo/cypress-fx3-sdk-linux - Note at the very bottom where the post tells us to link our project as follows:

Jarrod_1-1655325257308.png 

with all the steps above, I made minor changes to the fxapp's cyfxmain.c to change the device descriptor of  0x04b4 (as a test) to 0x00 0x00. I have made other heavy handed changes to the file to ensure I would be able to spot the changes such as changing all device descriptors within the file to all 0x00. Eclipse will even note when I intentionally place a syntax error in the cyfxmain.c in which my USBVideoClassBulk application will fail to compile as it is correctly linked to the fxapp src library application. So, I am sure the project is correctly linked and building properly. After making my edits to the cyfxmain.c, compiling the project together, ensuring that project points to the correct location with the newly compiled .a libarires, I use the elf2img application and provide the following command: 

./elf2img -i USBVideoClassBulk.elf -o USBVideoClassBulk.img

I then use the cyusb_linux application to program my new .img to the fx3. When I do, the device then enumerates and is registered as "FX3" within Device Manager. I then check the Device Descriptors within Wireshark to see none of my changes to the Device Descriptors. 

I am not sure what I am doing incorrectly in the process above? I have tried many times to update the cyfxmain.c, ensured I am getting new .a libraries after compiling using the following command  "make CYCONFIG=fx3_debug" I have ensured to clean the project multiple times, and have reprogramed my fx3 device many many times in attempt to see updated device descriptors. 

I see there is an cyfxapp.elf within eclipse after I compile the library: 

Jarrod_2-1655326000683.png

 

Do I need to somehow program both my USBVideoClassBulk.img and convert this cyfxapp.elf into a cyfxapp.img and also program it to the FX3 device? I have tried this and it simply overwrites the first img. 

I am unable to program the USBVideoClassBulk application with updated firmware libraries in sdk/firmware/src/fxp/cyfxmain. 

 

Any help is greatly appreciated. 

 

0 Likes
1 Solution
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello,

If your intention is to change the descriptors of the project USBVideoClass, then you need not recompile the library. You can just edit the source file cyfxuvcdscr.c that is a part of the USBVideoClass project. I edited the VID in the superspeed and high speed device descriptor structure found in the source file cyfxuvcdscr.c and was able to see the device enumerating with the new VID. Please try this and let me know if you still face any issues.

Also, the latest version of FX3 SDK is 1.3.4. We recommend you to use the latest version for development.

Best Regards,
Jayakrishna

View solution in original post

1 Reply
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello,

If your intention is to change the descriptors of the project USBVideoClass, then you need not recompile the library. You can just edit the source file cyfxuvcdscr.c that is a part of the USBVideoClass project. I edited the VID in the superspeed and high speed device descriptor structure found in the source file cyfxuvcdscr.c and was able to see the device enumerating with the new VID. Please try this and let me know if you still face any issues.

Also, the latest version of FX3 SDK is 1.3.4. We recommend you to use the latest version for development.

Best Regards,
Jayakrishna