[SOLVED] USB: Connection timed out SYS: Connection timed out
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
USB: Connection timed out SYS: Connection timed out
Hi! I am trying to run an example where it send bulk data through the USB port as max device speed to test the link.
The chip is a Cypress FX2 (I dont think there is a problem firmware).
You can find the whole example here
He create this own version sdcc and used a function called Bench_bulk.
The Problem it looked like System is timing out, but I don't know how to really tell to wait until it has received all the data.
I run the command:
Code:
cycfx2prog prg:bench_in.ihx run bench_bulk:6,16777216
and I get:
Quote:
cycfx2prog prg:bench_in.ihx run bench_bulk:6,16777216
Using ID 04b4:8613 on 002.009.
Putting 8051 into reset.
Programming 8051 using "bench_in.ihx".
Putting 8051 out of reset.
Reading 65536 bytes from EP 0x86: USB: Connection timed out SYS: Connection timed out
From other example it use stdin to non-blocking which I though may be the answer to:
Quote:
else if(!strcmp(cmd,"bench_bulk"))
{
int ep=-1;
int len=1024*1024;
int cs=65536;
/****************************
* Need to change stdin to non-blocking. */
int n, k;
n = fcntl(0,F_GETFL);
if(n<0) {
fprintf(stderr,"Trouble getting stdin flags\n");
n = 0;
}
n = fcntl(0,F_SETFL,n|O_NONBLOCK);
if(n<0) {
fprintf(stderr,"Trouble setting stdin flags\n");
n = 0;
}
if(a[0] && *a[0]) { ep=strtol(a[0],NULL,0); }
if(a[1] && *a[1]) { len=strtol(a[1],NULL,0); }
if(a[2] && *a[2]) { cs=strtol(a[2],NULL,0); }
// If len<0, allow short reads.
if(ep<0 || ep>=127 || len<=0 || len>32*1024*1024 ||
cs<1 || cs>32*1024*1024)
{ fprintf(stderr,"Command bench_bulk: Illegal/missing "
"endpoint/length/number.\n"); ++errors; }
else
{
// IN endpoints have the bit 7 set.
ep|=0x80;
I had time to spend a bit more with the code, but I have noticed that is C++ code stile but the files are .cc and its compiling with gcc, its possible use C++ using gcc compiler?
"
It depends on what exactly you changed in the makefile. gcc / g++ is really just a front-end driver program which invokes the actual compiler and / or linker based on the options you give it.
If you invoke the compiler as gcc:
it will compile as C or C++ based on the file extension (.c, or .cc / .cpp);
it will link as C, i.e. it will not pull in C++ libraries unless you specifically add additional arguments to do so.
If you invoke the compiler as g++:
it will compile as C++ regardless of whether or not the file extension is .c or .cc / .cpp;
it will link as C++, i.e. automatically pull in the standard C++ libraries."
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.