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.
Steps:
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. ???
Main
CyU3PDeviceInit <– Step Over
CyU3PDeviceCacheControl <– Step Over
CyU3PDeviceConfigureIOMatrix <– Step Over
Dozen io_cfg settings <– Step Over each one
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
Notes:
- 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.
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.
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-sup...
Solved! Go to Solution.
Greg,
KernelEntry() function is a non return function. There is no way to debug it.
You can use the RTOS APIs to check the thread performace. For this, you need to build the firmware with Profile Debug or release mode
Check this out: debug and release mode
Sridhar
Side Note: Since this post is focused on tips and tricks to getting started with a debug session;
I started a separate post related specifically to issues debugging AN75779 @ https://community.cypress.com/message/199158
Debugging AN75779 is complicated by the presence of multi-thread RTOS.
Greg,
KernelEntry() function is a non return function. There is no way to debug it.
You can use the RTOS APIs to check the thread performace. For this, you need to build the firmware with Profile Debug or release mode
Check this out: debug and release mode
Sridhar
Sridhar,
Thank you for the clarification that the KernelEntry() function can't be debugged in the standard way and providing a link to a method that may be used.
The discussion at the link debug and release mode has an open question from geethanjali, "where i can i find these information completly." I would also like any supporting information describing the "Profile Debug" and "Profile Release" processes. I'll state the same on the linked thread and mark this thread complete as my initial question has been answered.
Greg,
The KernelEntry function can't be debugged even you use profile debug and release builds. Therefore, there is no way to debug the KernelEntry function.
The use of Profile debud and release is: There are some APIs whose library is not included in default debug and release mode.
If you wanna to use such APIs, you need to build the code with Profile debug or release.
However, why you want to debug KernelEntry function?
Example APIs are CyU3PDeviceGetCpuLoad, CyU3PDeviceGetDriverLoad, CyU3PDeviceGetThreadLoad, CyU3PThreadPerfGet and etc., Search for profilling in API guide for other APIs.
Please create a new thread for a new query.
Sridhar