5 Replies Latest reply on Jun 20, 2019 2:31 AM by KandlaguntaR_36

    Can a Debug Session run on AN75779 AVC code using EZ USB Suite and CYUSB3KIT-003?


      If it’s possible to run a debug session into an RTOS; on the AVC code that accompanies AN75779, what’s the process to get past the first couple instructions in Main then follow function call CyU3PKernelEntry into the ThreadX RTOS?


      As soon as the code gets out of Main, I can no longer seem to track it. Any help is appreciated.



      1. Copy and unzip AN75779.zip and AN75779 How to Implement guide to PC
      2. Connect two USB connectors on CYUSB3KIT-003 to two USB ports on PC
      3. Start TeraTerm & Setup as Serial Port to new Com Port at 115200 baud
      4. Start Cypress’ EZ USB Suite
      5. Import AN75779 project UVC
      6. Build UVC_AN75779 project – select “Debug(Debug Configuration)”
      7. Set Debug Configuration for UVC_AN75779 project
        1. Select GDB OpenOCD Debugging
        2. Leave Main tab untouched
        3. On Debugger tab, ensure
          1. Executable = C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\JTAG\OpenOCD\Windows\openocd.exe
          2. Config options = -f "C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\JTAG\OpenOCD\Config\arm926ejs_fx3.cfg"
        4. On Starup tab, de-select “Enable ARM semihosting” and “Pre-run reset”
        5. Select “Apply” then “Debug”
      8. Notice when progress bar in lower right corner completes uvc.c fills center window with first command in main highlighted.


      At this point, I don’t foresee where the code’s going so I decide to step over and into – but get lost after CyU3PKernelEntry command. ???



      CyU3PDeviceInit <– Step Over

      CyU3PDeviceCacheControl <– Step Over

      CyU3PDeviceConfigureIOMatrix <– Step Over

      Dozen io_cfg settings <– Step Over each one

      1. CyU3PKernelEntry <-- I don’t know how to debug at this point. Resuming or stepping into causes program to run, a window for 0x0 pops up over the uvc.c window with red text, “No source available for “0x0”
      • [View Disassembly…] <-- clicking on this radio button opens a Disassembly window that shows address lines for code followed by the text, “Unable to retrieve disassembly data from backend.”

      and Tera Term displays the following output:

      Error: Reading Sensor ID failed!

      UsbEventCB: Detected SS USB Connection

      USBSetupCB:In SET_FTR 0::1

      USBSetupCB:In SET_FTR 0::1

      USBSetupCB:In SET_FTR 0::1

      USBSetupCB:In SET_FTR 0::1

      USBSetupCB:In SET_FTR 0::1

      USBSetupCB:In SET_FTR 0::1

      USBSetupCB:In SET_FTR 0::1

      USBSetupCB:In SET_FTR 0::1

      USBSetupCB:In SET_FTR 0::1

      USBSetupCB:In SET_FTR 0::1

      USBSetupCB:In SET_FTR 0::1

      UsbEventCB: SUSPEND encountered...

      Entering USB Susp



      - Code does appear to be halted @ fffffff8, which is highlighted green in the Disassembly window.

      - ‘Step Return’ causes information in the Console to update and the Disassembly code to refresh.

      - ‘Step Into’ and ‘Step Over’ appear to have no effect.



      I did find some existing posts and attempted various modifications with no success:

      A) UVC Troubleshooting Guide – KBA226722 @ https://community.cypress.com/docs/DOC-17227 appears to be related to a running application. It’s possible the code locks up without a data stream.


      B) I uncommented the #define USB_DEBUG_INTERFACE line in uvc.h then ran a build then the debugger.

      • There isn’t any additional output, which makes sense as the code didn’t go to area where the Debug comments are located.


      C) There is a section in the readme.txt file in the UVC_AN75779 directory:

          4. Updating to a new FX3 SDK version:


          The cyfxtx.c and cyfx_gcc_startup.S files used here are taken from the FX3 SDK release. This version of the application makes use of FX3 SDK release version 1.3.3.

          When updating the application to work with a new SDK version, you need to copy the latest cyfxtx.c and cyfx_gcc_startup.S files from the new SDK into this project. You will also need to follow the instructions for porting to the new SDK that are included in the "Getting started with the FX3 SDK" document.


      Looking at copies of cyfxtx.c and cyfx_gcc_startup.S files in EZ USB SDK files and UVC_AN75779, I see no difference.


      D1) Mention of running Profile Debug for RTOS in response to Community Post “debug and release mode” @ https://community.cypress.com/message/156326. I’ll try it.

      • Re-build using Profile Debug option
      • Change C/C++ Application in Main tab of Debug configuration by using [Search Project…] button and selecting Profile version.
      • No difference


      D2) More information on Profile Debug in the post “Profiling support of ThreadX” @ https://community.cypress.com/community/usb/usb-superspeed-peripherals/blog/2018/12/23/profiling-support-of-threadx

      • Still no difference in my inability to follow debug after start of RTOS