cancel
Showing results for 
Search instead for 
Did you mean: 

Knowledge Base Articles

External FLASH memory to store all the code.

Anonymous
Not applicable

External FLASH memory to store all the code.

Question: My design uses external FLASH memory to store all the code. I am using the default frameworks code that comes on the development CD, and my device is not coming up when I plug in the USB cable. What could be happening?  My firmware works on the dev board and my new device comes up?

 

Answer:

Please replace the following similar code snippet in frameworks with this one, only if you are using external memory for code boot up (EA=1). This will ensure that your descriptor table is located into internal memory properly. Previously the descriptors were nabbed from xdata space and NOT code space.


IntDescrAddr = INTERNAL_DSCR_ADDR;

ExtDescrAddr = (WORD)&DeviceDscr;

DevDescrLen = (WORD)&UserDscr - (WORD)&DeviceDscr + 2;

for (i = 0; i < DevDescrLen; i++)

*((BYTE xdata *)IntDescrAddr+i) = 0xCD;

for (i = 0; i < DevDescrLen; i++)

*((BYTE xdata *)IntDescrAddr+i) = *((BYTE code *)ExtDescrAddr+i);

pDeviceDscr = IntDescrAddr;

offset = (WORD)&DeviceDscr - INTERNAL_DSCR_ADDR;

pConfigDscr -= offset;

pHIDDscr -= offset;

pReportDscr -= offset;

pStringDscr -= offset;

0 Likes
Version history
Revision #:
1 of 1
Last update:
‎Dec 19, 2008 12:00 AM
Updated by:
Anonymous
 
Contributors