This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Firmware running on simulation but not when it runs in the TUSB3210

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.

Parents
  • I believe the problem lies on the address assignment for CODE and/or XDATA.
    Without above explicit address range, the linker maps objects to the address on which no CODE/ XDATA RAM exists. Then the firmware works on the simulation, but not on the real chip.
    It will be confirmed on the map (.M51) file.

    Tsuneo

Reply
  • I believe the problem lies on the address assignment for CODE and/or XDATA.
    Without above explicit address range, the linker maps objects to the address on which no CODE/ XDATA RAM exists. Then the firmware works on the simulation, but not on the real chip.
    It will be confirmed on the map (.M51) file.

    Tsuneo

Children
  • 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.

    Sebastian.