We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi Friends,
I have been working on CY7C68013A EZ-FX2LP USB based micro controller, I have written code for IN/OUT operation i.e, Read and Write operation of USB.
I am initially reading data from HOST a bulk 64 Bytes of data and storing it in a location starting from 0xE000 which is the starting address of scrachpad memory of 512 Bytes, after which if i want to read data from this location I am initially getting a JUNK first time ,latter next read I get actual value, I mean to say that after write is done to this memory location in RAM, every first time i read I get previous value and the actual value is only reflected in the next read operation,
I tried a lot , but i am not able to find out what is the exact problem, I have pasted code below.
// INITIALIZATION CODE void TD_Init(void) // Called once at startup { BYTE i=0; // we are just using the default values, yes this is not necessary... EP1OUTCFG = 0xA0; SYNCDELAY; EP1INCFG = 0xA0; SYNCDELAY; // see TRM section 15.14 EP1INCS = 0x00; SYNCDELAY; EP2CFG = 0x82; SYNCDELAY; EP2BCL = 0xC0; // arm EP2OUT by writing byte count w/skip. SYNCDELAY; EP2BCL = 0xC0; // arm EP2OUT by writing byte count w/skip. SYNCDELAY; EP1INBC = 0x40; // EP2BCH = 0x02; // arm EP2OUT by writing byte count w/skip. // SYNCDELAY; // EP2BCH = 0x02; // arm EP2OUT by writing byte count w/skip. // SYNCDELAY; // enable dual autopointer feature SYNCDELAY; AUTOPTRSETUP |= 0x01; } TD_Poll() { /* -> USB OUT PACKET TRANSFER MODULE -> BULK - 64BYTES -> EP2 - ENDPOINT 2 -OUT DATA TRANSFER */ if(!(EP2468STAT & 0x01)) { ACC =XBYTE[0x8800]; Addr = 0xE000; // scrachpad area starting Addr AddrFIFO = 0xF000; //EP2FIFO starting Addr for( i = 0x0000; i < 64; i++ ) { XBYTE[Addr++]= XBYTE[AddrFIFO++]; } SYNCDELAY; EP2BCL = 0xC0; ACC=XBYTE[0x8800]; } /* -> USB IN PACKET TRANSFER MODULE -> BULK - 64BYTES -> EP1 - ENDPOINT 1 -IN DATA TRANSFER */ if(!(EP1INCS & bmEPBUSY)) //check for EP1IN bit, wait for BUSY Bit =0 { count=EP1INBC; // Load count with EP1 received buffer size /* for(Addr=0xE000;Addr<0xE040;Addr++) // load data to scrachpad RAM ,starting from 0xE000 to 0xE040 (64Bytes) { XBYTE[Addr]=in; // Incremental data for every read operation from HOST } in++; */ // Increment value for one Read operation Addr=0xE000 ; // Intial ScrachPad Address for(i=0;i<count;i++) // 64 Bytes Loop Count { // EP1INBUF[j]=BufferOUT[i]; // Transfer Data from scrachpad RAM Area to EP1 EP1INBUF[j]=XBYTE[Addr++]; j++; } SYNCDELAY; // Sychronization Delay j=0; EP1INBC = 0x40; // Re-Arm EP1 Byte Count SYNCDELAY; // Sychronization Delay ACC=XBYTE[0x9800]; // LED 3 ON SYNCDELAY; ACC=XBYTE[0xA800]; // LED 4 ON SYNCDELAY; } ACC=XBYTE[0x8000]; SYNCDELAY; ACC=XBYTE[0x9000]; // LED 3 ON SYNCDELAY; ACC=XBYTE[0xA000]; // LED 4 ON SYNCDELAY; } }
Please reply me if there is any mistake, waiting for a positive reply,
Abhilash
Did the code look readable in the preview?
Dear Per Westermark,
Yes, the code was Readable in preview, every time i read first 64 Bytes of data is the previous written data and next actual data,
Please find a solution for this,
Is there any solution for this Problem????
i have same error L57
are you using ?C_STARTUP?
im do this and code did compile with error and did run but fail before end
plz give me solution now
I am not able to get what u mean by that, yes I added STARTUP.a51 to project, I dont think it can make any difference.
"Yes, the code was Readable in preview"
Really?!
Do you really think that the source code as shown is legible?!
ie, do you really think that it is clearly laid-out and easy to read?!
It looks like you've used TABs to lay-out your code? You need to convert the TABs to spaces - TABs just cannot be relied upon to format the same way on different applications!
In fact, TABs can't even be relied upon to consistently format the same way in the same application!! (because the user can fiddle with the TAB settings).
Any decent editor (even uVision) can be set to insert spaces instead of TABs.
"i have same error L57"
Why do you say it's the "same" error?
Nobody has mentioned any errors in this thread - let alone Linker errors in general or L57 in particular!
"code did compile with error and did run but fail before end. plz give me solution now"
You need to fix the error!
startup is give me errors but i fix it
still gives error L57 but i fix it also does the 232 connect to port?
the it still gives error L57
plz give code now for fix
There is no such error listed in the Linker Manuals:
http://www.keil.com/support/man/docs/lx51/lx51_errors.htm
http://www.keil.com/support/man/docs/bl51/bl51_errors.htm
Post the complete text of the message that you are getting - use copy-and-paste; do not manually re-type it!
mr any niel you are kind for help but where is the code?????
as you ask i give error is
** Warnnnng L37 sleepSS: ?C_C51STARTUP Segmunt is be in address spac Y:O-y:OEFFFh
i must have code for project before job done plz give now
"but where is the code?????"
If you want someone to write code for you, see: http://www.keil.com/condb Cypress can probably also suggest some names of consultants having experience with their products...
"** Warnnnng L37 sleepSS: ?C_C51STARTUP Segmunt is be in address spac Y:O-y:OEFFFh"
You have clearly typed that manually - I specifically said do not type it manually!
So it never was Error L57 at all - or is that just another mis-type?
Error L37 is described in the Manual: http://www.keil.com/support/man/docs/bl51/bl51_l37.htm
you do not know my answer???
you ask me to typed message and you do not like?????
the error was in the startup.a51 as i said at first but with error L37 at address o7fe0h
why you not help with my code before????
Maybe because you don't deserve help - you don't specify what error you have, and you request help instead of asking for help.
You get upset, when people ask you to specify the full (and correct) error message, since it isn't possible for anyone to give a correct answer to an incorrect question.
Do you really believe that there may only be one single error in startup.a51, and if you just specify the file name then it is possible to help you? That is about the same as saying: I have a Mercedes. What is wrong with it?
I have a Mercedes. What is wrong with it?
the tire is flat
"the tire is flat"
There you go again - Which tyre?