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, i'm developing a firmware for the TUSB3210. It is based on the Code example of Texas, 'Keyboard firmware'. It's originaly for IAR compiler, but i'm translating it to Keil compiler. The simulation is now warking ok, but when i download it to the TUSB it doesn't function in the same way, some variables missed they values into the functions, and so the flow didn't match the one it had in the simulation. For example in the next part of the code:
... volatile BYTE abIEP0Buffer[EP0_MAX_PACKET_SIZE] _at_ 0xFEF8; ... PBYTE pbIEP0Buffer; // A buffer pointer to input end point 0 // Data sent back to host is copied from // this pointed memory location ... void usbSendNextPacketOnIEP0(void) { ... for(bIndex=0; bIndex<bPacketSize; bIndex++) { abIEP0Buffer[bIndex] = *pbIEP0Buffer++; } P2 = abIEP0Buffer[0]; ... }
if i stop the program (with a while(1) for example) inmediatly after assigning the value to Port 2, and then i read the value of P2 when the firmware is running on chip, i read 0x00, different of which i'm expecting based on simulation (ex: 0x12) I suspect it is a problem with a difference in the behavior of variables or pointers in simulation and in chip. What could it be?
Thank you.
Sebastian.
PD: sorry for my english.
Hi Tsuneo, the probelm was related as you say to memory assignament. I compiled de firmware using the small memory model (variables in DATA), instead of the large memory model, and with Large Code Rom Size (64K). Explicity putting the requiered variables in XDATA. The problem was resolved in this way. Thank you for your help Tsuneo!
See you.