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.

TMS320F28P650DH: CLA init sequence

Part Number: TMS320F28P650DH
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Hi team

The CLA init sequence in TRM is below:

Copy CLA code into the CLA program RAM -> Initialize CLA data RAM, if necessary -> Configure the CLA registers -> Initialize the PIE vector table and registers -> Enable CLA tasks/interrupts -> Initialize other peripherals

But in cla_ex1_asin demo code, the init sequence is:

PinMux_init();
CLA_init();
MEMCFG_init();
INTERRUPT_init();

if switch CLA_init() and MEMCFG_init(), the MCU cannot run properly. Do I understand the sequence wrong?

Thanks

Joe

  • Hi team

     Could you please kindly take a look at this thread. 
    thanks

    joe

  • Hi Joe,

    I apologize for the delay. The order stated in the TRM is as follows: 

    1. Copy CLA code into the CLA program RAM: Done in CLA_init()

    2. Initialize CLA data RAM, if necessary: Done in CLA_init()

    3. Configure the CLA registers

    -Enable the CLA peripheral clock using the assigned PCLKCRn register: Done in Device_init() in main code

    -Populate the CLA task interrupt vectors: Done in myCLA0_init() which is called at the end of CLA_init()

    -Select the task interrupt sources: Done in myCLA0_init() which is called at the end of CLA_init()

    -Enable IACK to start a task from software, if desired: Done at the end of myCLA0_init() which is called at the end of CLA_init()

    -Map CLA data RAM to CLA space, if necessary: Done in MEMCFG_init()

    -Map CLA program RAM to CLA space: Done in MEMCFG_init()

    4. Initialize the PIE vector table and registers: Done in Interrupt_initVectorTable() in main code

    5. Enable CLA tasks/interrupts: Done at the end of myCLA0_init() which is called at the end of CLA_init()

    6. Initialize other peripherals: No other peripherals are used in example

    You are correct that the Sysconfig generated code doesn't follow the TRM order exactly. This is just a recommended order however; initialization can also be done in the order executed by Sysconfig (like in the example). The Sysconfig generated code is done this way to keep initializations modular to each peripheral. Device_init() and Interrupt_initVectorTable() are also generally always called before Board_init() in the main() function, which does cause some of these recommended initializations to be done out of order, but not in a way that would cause any issues.

    I would recommend if using Sysconfig for a project to follow the order of the generated code (CLA_init() first then MEMCFG_init()).

    Best Regards,

    Delaney