This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMDXIDDK379D: Difference between Device_call() and DEVICE_CAL_LOCATION

Part Number: TMDXIDDK379D
Other Parts Discussed in Thread: C2000WARE

Hello everybody,


it's quite confusing. Where is the difference between


#define DEVICE_CAL_LOCATION 0x70280
#define C1BROM_DEVCAL (void (*)(void))(DEVICE_CAL_LOCATION)

(see the link: e2e.ti.com/.../ccs-tms320f28377d-adc-calibration

AND

#define device_cal (void (*)(void))0x70282.

(see the file: ...\TI\C2000\C2000Ware_MotorControl_SDK_3_02_00_00\c2000ware\device_support\f2837xd\common\include\F2837xD_Examples.h
or
the link: e2e.ti.com/.../tms320f280049-adc-calibration

The function pointers are different by 2 words

Thanks in advance - Bui

  • Bui,

    Generally speaking, the device_cal() location is expected to be the same across a given device family (like F2837x), but it may vary between device families.

    For this specific case, both 0x70280 and 0x70282 are valid. If you look at the raw data at 0x70280 - 0x70281, you will find NOP instructions. When executing the function starting from 0x70280, the CPU will skip over the first two words and execute the instructions starting at 0x70282.

    The Boot ROM is hard-coded into the device so follow-on changes are very costly to implement. In order to mitigate risks, address 0x70280 (in TI-OTP Flash) was defined as a redundant starting address in case some unforeseen issue would invalidate device_cal() at its current location at 0x70282. In such a scenario, the 0x70280 - 0x70281 NOP instructions would be replaced with a branch to another address. Fortunately, no such issues were found so the Boot ROM continues to execute from 0x70280, while 0x70282 is interchangeably used in examples.

    -Tommy

  • Hi Tommy,

    many thanks for the quick and clear answer.

    Bui