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

USB low-full-high speed peripherals Forum Discussions

Anonymous
Not applicable

Greetings,

   

I'm making a small modification to a project that appears to use various global variables declared as 'xdata'.

   

I added my own variable, that I return on an IN endpoint:

   

xdata BYTE test;

   

            test = 0xAB;
            EP1INBUF[0] = test;

   

            EP1INBC = 1;

   

If my windows app reads this endpoint, it reads the value '0'.
However, if I remove the 'xdata' declaration, my windows app DOES actually read '0xAB'.

   

What is going on here, and how do I make 'xdata' work? (This is stripped down code to show the issue, I need 'xdata' because I want to use EZUSB EEPROM routines that have 'BYTE xdata *dat' arguments.

   

~ Paul Claessen
 

0 Likes
1 Solution
Anonymous
Not applicable

Thanks for your response.
I had a closer look at this, and noticed that the Keil uVision IDE, for some reason, placed xram at 0x4000. There simply is no memory at 0x4000 in an FX2LP. When I removed the settings for the external memory settings in the 'Target' tab and rebuilt, everything worked just fine.

View solution in original post

0 Likes
2 Replies
AjayB_76
Moderator
Moderator
Moderator
100 sign-ins 10 questions asked 5 questions asked

one way to check is to make sure the SRAM is connected properly in your schematic. Since the variable maybe forced to stay in the external SRAM, failure may cause it get incorrect data. 

   

since its working when it is placed in the internal RAM, I am suspecting this. 

   

 

   
        
0 Likes
Anonymous
Not applicable

Thanks for your response.
I had a closer look at this, and noticed that the Keil uVision IDE, for some reason, placed xram at 0x4000. There simply is no memory at 0x4000 in an FX2LP. When I removed the settings for the external memory settings in the 'Target' tab and rebuilt, everything worked just fine.

0 Likes