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.

TMS320F280049: Why call Device_cal function at the condition of "#ifndef _FLASH" when run using debugger

Part Number: TMS320F280049

Hi Expert,

In F280049 example code, there're below comments. Which confused me are

  1. What's the different when code running in RAM and Flash, why just call Device_cal function in RAM?
  2. If code running in Flash, could it run using debugger, if yes, why not call Device_cal?

#ifndef _FLASH
//
// Call Device_cal function when run using debugger
// This function is called as part of the Boot code. The function is called
// in the Device_init function since during debug time resets, the boot code
// will not be executed and the gel script will reinitialize all the
// registers and the calibrated values will be lost.
// Sysctl_deviceCal is a wrapper function for Device_Cal
//
SysCtl_deviceCal();
#endif

Thanks!

Best Regards

Rayna

  • Rayna,

    when running through debugger,  OnTargetConnect() function of GEL  file it resets the target and re-configures everything, and that is why Device_cal() should be run.

    When running from Flash, function Device_cal is run as part of boot sequence, and no need to run again.