How to run and debug FX3 application from within Eclipse IDE?

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

cross mob
okhajut
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

I have used Eclipse IDE in the past with Altera/Intel Nios II. In that case, once the application has been built, we can just right click the project and select "Run as" or "Debug as" and the Nios II option exists there. With FX3 all I get is "Run as Local C/C++ application" and this always fails to run with "Binary not found error" in spite of the project build succeeding.

Now I have got the FX3 superspeed explorer kit. I have followed the instructions to copy all example projects into an Eclipse workspace. However, I find the instruction saying that I must open another program called USB Control Centre and then select the "Cypress FX3 USB BootLoader Device" and then goto Program -> FX3 -> RAM and then browse all the way to an .img file and select it, quite a long winded way. 

Why can't eclipse do this work directly? Also, how am I supposed to add breakpoints and then load the program and cycle through it line by line. Breakpoints can't be done if I just load an .img file and then let the program run.

What am I missing here?

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

Hello, 

Please try to re build the application source and then try running it.

The error  0xc000007b often occurs due to the missing Visual C++ Redistributable Packages. 

If there is some error "cannot open include afxres.h " while building application, you can replace

#include "afxres.h"

with:

#include<windows.h>

You might also require to add following libraries in the linker settings

legacy_stdio_definitions.lib
user32.lib
Regards,
Rashi

View solution in original post

0 Likes
8 Replies
okhajut
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

I have tried to follow the instructions inside the "CYUSB3KIT-003 SuperSpeed Explorer Kit User Guide, Doc. # 001-93186 Rev. *A" to get Eclipse connected to the JTAG connection inside the board. The procedure is described in section 3.7.2 on page 36.

 

This is what appears in the console window in red:

Open On-Chip Debugger 0.8.0 (2014-12-03-15:43)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Warn : Adapter driver 'cy7c65215' did not declare which transports it allows; assuming legacy JTAG-only
Info : only one transport option; autoselect 'jtag'
adapter_nsrst_delay: 200
jtag_ntrst_delay: 200
adapter speed: 1000 kHz
trst_and_srst srst_pulls_trst srst_gates_jtag trst_push_pull srst_open_drain connect_deassert_srst
RCLK - adaptive
adapter speed: 1000 kHz
Info : clock speed 1000 kHz
Error: CyJTAGRead returned: 11
Error: CyJTAGRead returned: 11
Error: CyJTAGRead returned: 11
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Error: CyJTAGRead returned: 11
Error: fx3.cpu: IR capture error; saw 0x0f not 0x01
Error: CyJTAGRead returned: 11
Warn : Bypassing JTAG setup events due to errors
Error: CyJTAGRead returned: 11
Info : Embedded ICE version 0
Error: unknown EmbeddedICE version (comms ctrl: 0x00000000)
Info : fx3.cpu: hardware has 2 breakpoint/watchpoint units
Error: CyJTAGRead returned: 11
Error: CyJTAGRead returned: 11
Error: CyJTAGRead returned: 11
Error: CyJTAGRead returned: 11

...

 

Does this mean that JTAG is not working at all?

 

I did notice that when I cycle power, the board does not go back its default firmware where it blinks when connected to USB3.0 but not when connected into a USB2.0. But I do not think that this should affect the JTAG provided by another chip.

Otherwise, I am still able to use the USB Control Centre to program the example images into the RAM.

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

Hello,

From the description I understand that you want to debug the firmware.  If yes, please let me know if you have referred to EzUsbSuite_UG (section 3) from the FX3 SDK. FX3 Explorer kit which uses CY7C65215 USB serial bridge which implements a JTAG TAP controller. FX3 debug is available using the FX3 JTAG port and the Cypress USB-Serial IC as a dedicated JTAG master. 

 

I did notice that when I cycle power, the board does not go back its default firmware where it blinks when connected to USB3.0 but not when connected into a USB2.0.

>> Can you please let us know how does the device enumerate when plugged in to USB 3.0  and USB 2.0 port? Also, let us know which firmware are you using to debug.

Please let us know if any queries on this

Regards,
Rashi
0 Likes
lock attach
Attachments are accessible only for community members.

Rashi ji, there are two parts to this.

1. How to program the FX3 board without having to open the Cypress Control Centre utility. Why can't I just click Run inside Eclipse IDE and cause the program to be downloaded?

2. Being able to go through user program line by line. This should be possible using the JTAG OpenOCD from what I have read so far.

 

I have read these documents to find out how to configure the OpenOCD:

1. CYUSB3KIT-003 SuperSpeed Explorer Kit User Guide, Doc. # 001-93186 Rev. *A

2. EZ-USB Suite User Guide, Version 1.3.4

The first document section 3.7.2 first describes steps required in "External Tools Configurations". I am able to successfully complete this. The next step creates a debug configuration for a project using "Zylin Embedded Debug". I have followed these steps but once I click on "Debug", I get an error message.

"Error creating session
Open On-Chip Debugger 0.8.0 (2014-12-03-15:43)
Open On-Chip Debugger 0.8.0 (2014-12-03-15:43)
Open On-Chip Debugger 0.8.0 (2014-12-03-15:43)"

The second document section 3.2 does not describe anything related to "External Tools Configuration". It goes straight into debug configurations for a project. However, here instead of using "Zylin Embedded Debug", the "GDB OpenOCD Debugging" is being used. As soon as I click on debug, I get an error message.

Error while launching command: gdb --version
CreateProcess error=2, The system cannot find the file specified

 

What do I do now?

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

Hello,

1. How to program the FX3 board without having to open the Cypress Control Centre utility. Why can't I just click Run inside Eclipse IDE and cause the program to be downloaded?

>> The boot modes supported by FX3 is as mentioned in the "Boot Options" section of FX3 datasheet. To program FX3 using USB interface or program the SPI flash/I2C EEPROM USB control center can be used. JTAG of FX3 can only be used for debugging .

The next step creates a debug configuration for a project using "Zylin Embedded Debug". I have followed these steps but once I click on "Debug", I get an error message.

>> Please share the "Debugger Tab" and "Command tab" snippet of the debug configuration. I tried following the steps in the CYUSB3KIT-003 SuperSpeed Explorer Kit User Guide and it worked fine at my end. The only change is the GDB debugger path i.e. arm-none-eabi-gdb.exe is located here C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\ARM GCC\bin. 

As soon as I click on debug, I get an error message. Error while launching command: gdb --version CreateProcess error=2, The system cannot find the file specified.

>> I understand that for this you are following the steps mentioned in section 3.2 of EzUSBSuite_UG. Please try replacing the arm-none-eabi-gdb${cross_suffix} in the "Executable" field of GDB Client setup 

Regards,
Rashi
0 Likes
okhajut
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

ok, I shall see what should be done with the debugger and JTAG but first, since I am bound to use the control centre application to download the program image into RAM e.t.c from what I understand, why can't Eclipse invoke the control centre itself silently? Is there no way to make this happen?

Having to open the control centre GUI just to download the image file seems to be an annoyance. Is there a command-line version program that I can just type in to load the image? If Eclipse cannot invoke the control centre to do image loading then a command-line version of the control centre will do.

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

Hello,

EzUSBSuite has the icon for opening Control center from EzUSBSuite but it cannot invoke it directly. Clicking on the Control center icon in the suite will open control center.

Please refer to sample C++ Console Application to program the firmware binary onto FX3 device in FX3 SDK. (Path: \Cypress\EZ-USB FX3 SDK\1.3\application\cpp\fwdownload_fx3)
The firmware image can be programmed to RAM, I2C EEPROM or SPI FLASH. 

Regards,
Rashi
0 Likes
okhajut
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

I have tried to run the FwDownloadApp that already exists inside the directory. There are two versions it seems, one under x64 and another under x86. Both of them do not run. I get a Microsoft Visual C++ Runtime Library error with the x64 version.

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

Hello, 

Please try to re build the application source and then try running it.

The error  0xc000007b often occurs due to the missing Visual C++ Redistributable Packages. 

If there is some error "cannot open include afxres.h " while building application, you can replace

#include "afxres.h"

with:

#include<windows.h>

You might also require to add following libraries in the linker settings

legacy_stdio_definitions.lib
user32.lib
Regards,
Rashi
0 Likes