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

Memory unkown source data

Hello,
We have a product controlled by a C8051F060, which
among other tasks measures the internal temperature of the
MCU, and if it exceeds some rate of temperature for more than a specified time
the measurement is saved to a 'internal high temperature table'.

The Same task is done in our older product, which is controlled
by a C8051F020, and works as expected, with no issues,
i.e. can be read and reset by a protocol command.

At The product controlled by the C8051F060 when reading this table
includes unreasonable values (negative, 65535 and others),
which appear also when there is no high ambient temperature what so ever.

This table is located in the data memory, as appears in the map file(L. 129):
www.mediafire.com/.../file

I found it hard to troubleshoot the problem, since the task of saving high temperature
functions properly at the F020 product and the task in the F060 is taken from there.
It seems that the wrong data source is a result of some memory issue as stack overflowing.

I would be glad for any guidance for solving this issue.
Thanks,
Amitai

Parents
  • Now that I have files to look at, this 1 byte actually makes sense. As everything in ht_records.c goes to xdata, there's only on byte left: change_flag. This is what you're seeing in the map file.

    BUT: ID_ADDRESS is defined to 0x0000 (flash_driver.c). So this seems to access your controller's vector table:

    Line 48 - FLASH_PageErase (ID_ADDRESS, 1);
    Line 67 - pID[i] = FLASH_ByteRead (ID_ADDRESS + i, 1);

    And what is this?
    Line 55 - FLASH_ByteWrite(i, pID[i - ID_ADDRESS], 1);

Reply
  • Now that I have files to look at, this 1 byte actually makes sense. As everything in ht_records.c goes to xdata, there's only on byte left: change_flag. This is what you're seeing in the map file.

    BUT: ID_ADDRESS is defined to 0x0000 (flash_driver.c). So this seems to access your controller's vector table:

    Line 48 - FLASH_PageErase (ID_ADDRESS, 1);
    Line 67 - pID[i] = FLASH_ByteRead (ID_ADDRESS + i, 1);

    And what is this?
    Line 55 - FLASH_ByteWrite(i, pID[i - ID_ADDRESS], 1);

Children