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.

CCS/TMS320F28379D: Boot to flash TMS320F28379D standalone

Part Number: TMS320F28379D
Other Parts Discussed in Thread: CONTROLSUITE

Tool/software: Code Composer Studio

Hi,

I look for an advice. My circuit has on board f28379D MCU. Everything works well, however, I try to do some standalone tests and I want the processor to boot to flash memory after reset/power down it fails. The GPIO72/84 are "1" and TRST is 0 when debugger (XDS100) is disconnected. This should by default chose the GetMode as a boot option? My application doesn't start after power down. However, when I run blink example from controlSuite it toogles the pin after power down. 

The RAM/FLASH target configurations change the linker file true? So with both options I should be able to boot to flash? (Of course when running from flash memory particular functions need to be copied and run from RAM).

Thanks a lot for any clue.

  • Hi,

    Could you please refer to the wiki page at processors.wiki.ti.com/.../FAQs
    to check if everything is taken care.

    Let us know if you need any more information.

    Thanks,
    Katta
  • Hi Rajaravi Krishna Katta,

    Thank you for the response. Of course I have reviewed this resource before. I have debugged this problem a bit and it looks like the FLASH build configuration works. However, in my application I track the fundamental frequency of a signal and modulate properly a discrete time filter. Without any details, what happens is after powering down or resetting MCU it boots to flash (if FLASH configuration is chosen) but stays in a PWM frequency that peripheral is initialized to at the beginning of main(). It means it doesn't follow the update of PWM period which is done in the interrupt routine of Ecap module (which is responsible for tracing the frequency).

    The routine is here for reference:

    __interrupt void ecap1_isr(void)
    {
    
    result1=ECap1Regs.CAP2/20;
    
    EALLOW;
    CpuSysRegs.PCLKCR0.bit.TBCLKSYNC = 0;
    EDIS;
    
    EPwm2Regs.TBPRD = (result1)/fratio;       // Set timer period
    EPwm2Regs.CMPA.bit.CMPA = (result1)/fratio/2;      // Set compare A value
    
    EALLOW;
    CpuSysRegs.PCLKCR0.bit.TBCLKSYNC = 1;
    EDIS;
    
       ECap1Regs.ECCLR.bit.CEVT2 = 1;
       ECap1Regs.ECCLR.bit.INT = 1;
    
       //
       // Acknowledge this __interrupt to receive more __interrupts from group 4
       //
       PieCtrlRegs.PIEACK.all = PIEACK_GROUP4;
    }

    If I use RAM build configuration after power down nothing happens what is expected. This looks good.

    I have 2 questions:

    - How can I disable RAM/FLASH configurations and use other .cmd linker file? If I create a project based on provided examples most of them have default build configurations allowing to chose between FLASH/RAM. How can I see which linker file is used by a given configuration?

    -Is it possible thay the existing linker file doesn't assign some critical section to flash what causes this strange behavior?

    Thanks a lot.

  • Hi Lukasz,

    Linker command file will be included in your project. It will displayed along with your source files in the CCS project -> Project explorer window.
    Or else you can find it in the CCS Project -> Properties -> General -> Linker Command File.
    Or else you can find it in the CCS Project -> Properties -> Build -> C2000 Linker -> File Search Path -> Look for linker command file.

    If it is the last case, you can copy the linker command file to your project and edit it. Remove it from the file search path.

    You can disable a linker command file by -> Right Click on the linker command file -> "Exclude from build".

    So, in your case you don't see the interrupt - ECAP1_INT in Flash configuration case right?

    Thanks,
    Katta
  • HI,

    Thank you for the response, I see the linker file. I have seen it in the controlSuite folders but couldn't see the link in CCS.

    Basically the update of PWM period ( routine in my previous reply) doesn't happen. It look like the code doesn't enter the interrup routine. Is there anything additional that should be done to the PIE vector when booting to flash? Something like copying to RAM flash related functions before FlashInit() call is made?

    Lukasz

  • In the document SPRA958L (Running from Internal Flash) there is a routine :

    /*** Initialize the PIE_RAM ***/
    PieCtrlRegs.PIECTRL.bit.ENPIE = 0; // Disable the PIE
    asm(" EALLOW"); // Enable EALLOW protected register access
    memcpy((void *)0x000D00, &PieVectTableInit, 256);
    asm(" EDIS"); // Disable EALLOW protected register access

    for copying PIEVect to RAM. However, in the existing example codes inside of  InitPieVectTable() function,  the content is copied using pointers to the section PieVectTableFile. 

    Do I understand correctly that it already takes care of copying PieVEct to proper RAM locations independently if from FLASH or RAM? So I do not need to use the routine from SPRA958L (Running from Internal Flash) ?

  • Hi Lukasz,

    It is already taken care in the linker command file "<controlSUITE>\device_support\F2837xD\v210\F2837xD_headers\cmd\F2837xD_Headers_BIOS_cpu1.cmd" to assign the dedicated memory to the PieVectTableFile section.

    UNION run = PIE_VECT, PAGE = 1
    {
    PieVectTableFile
    *
    *
    }
    and

    PIE_VECT : origin = 0x000D00, length = 0x000200 /* PIE Vector Table */

    Please let us know if you find any issues.

    Thanks,
    Katta
  • Hi,

    Thank you for response. I do not use BIos .
    This doesn’t solve my problem. You have confirmed that PIE vector is initialized to proper memory range, however, interrupt routine still doesn’t work properly after reboot.

    I will appreciate some detailed clue. Now I know that it boots to flash just the interrupt is giving problem, whereas I previously thought the boot to flash doesn’t work at all. If posting new question can make it easier to solve let me know.

    Thank you.
  • Hi Lukasz,

    Could you please raise a new query as this thread was about the issue with boot to flash. We can focus just on the interrupt routine in the next thread.

    Thanks,
    Katta