- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.