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.