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.

TMS320F280049C: Testing Motorware _system_post_cinit(), failed to parse the previous frame FP

Part Number: TMS320F280049C
Other Parts Discussed in Thread: LAUNCHXL-F280049C, TMDSHVMTRINSPIN, C2000WARE

I am using the LaunchXL-F280049C. I started by importing the Lab 01. I don't have the TMDSHVMTRINSPIN; I have a custom inverter hardware. I started on the assumption that it wouldn't be a problem at this point.

Running the example without changes, produced the error:

As I didn't have any clue where I was mistaken, I went and made a reduced program to determine where the error was:

/**
 * main.c
 */
int main(void)
{
    uint16_t estNumber = 0;
    bool flagEstStateChanged = false;

    //
    // initialize the user parameters
    //
    //USER_setParams(&userParams);

    //userParams.flag_bypassMotorId = true;


    //
    // initialize the user parameters
    //
    //USER_setParams_priv(&userParams);

    //
    // initialize the driver
    //
    halHandle = HAL_init(&hal, sizeof(hal));

    //
    // set the driver parameters
    //
    HAL_setParams(halHandle);

    //
    // initialize the interrupt vector table
    //
    HAL_initIntVectorTable(halHandle);


#define HAL_GPIO_LED2 34

    EINT;
    ERTM;

    while (1){
        DEVICE_DELAY_US(250000);
        HAL_toggleLED(halHandle, HAL_GPIO_LED2);


    }
	//return 0;
}


__interrupt void mainISR(void)
{

#define HAL_GPIO_LED3  23
    //
    // toggle status LED
    //
    counterLED++;

    if(counterLED > (uint32_t)(USER_ISR_FREQ_Hz / LED_BLINK_FREQ_Hz))
    {
        HAL_toggleLED(halHandle, HAL_GPIO_LED3);
        counterLED = 0;
    }

    //
    // acknowledge the ADC interrupt
    //
    HAL_ackADCInt(halHandle, ADC_INT_NUMBER1);

}

Apparently, the problem is being caused after the ADCs are enabled. For example, If I bypass HAL_setupADCs(), the program runs just fine (i.e. The green LED if the launchpad blinks.)

I started bypassing code from HAL_setupADCs and the code runs until I enable the ADCs

If I return after enabling the ADCs, the error occurs (The same happens If I remove the return line and let the HAL_setupADCs function to run unchanged.)

I have checked the Handles that are passed to ADC_enableConverter to make sure valid data was being passed. As it turns out, the values passed are

  • 0x7400 for ADC A
  • 0x7480 for ADC B
  • 0x7500 for ADC C

                

I am just starting with this processor's software and at this point I am lost. I would appreciate any help that would allow me to make some progress.

  • Hi Victor,

    My sincere apology for late response. Actually I was assigned to wrong engineer. I am assigning to subject matter expert and you should get response later today.

    Thanks & Regards,

    Santosh

  • Are you running this lab on  the LaunchXL-F280049C? Or your own board?

    1. Configure the JTAG debugger in .ccxml according to the emulator you used.

    2. Setup clock PLL in SysCtl_setClock() in hal.c according to the clock used on your board

    3. Setup the ADC according to your board, like reference, ADC channel...

    4. Configure the PWM and GPIO according to your board if needed.

  • Hello Yamming, Thanks for your reply.

    I checked the points you suggested. I am using LaunchXL-F280049C. JTAG debbuger is configured correctly.

    According to the Lab code. PLL should be 20 MHz crystal and a 10x multiplier and a 2x divider; so 100MHz

    // Set up PLL control and clock dividers
    // PLLSYSCLK = 20MHz (XTAL_OSC) * 10 (IMULT) * 1 (FMULT) / 2 (PLLCLK_BY_2)
    SysCtl_setClock(SYSCTL_OSCSRC_XTAL |
    SYSCTL_IMULT(10) |
    SYSCTL_FMULT_NONE |
    SYSCTL_SYSDIV(2) |
    SYSCTL_PLL_ENABLE);

    ADC Internal reference used

    SysCtl_delay(100U);
    ADC_setVREF(obj->adcHandle[ADC_ADCC], ADC_REFERENCE_INTERNAL, ADC_REFERENCE_3_3V);
    ADC_setVREF(obj->adcHandle[ADC_ADCB], ADC_REFERENCE_INTERNAL, ADC_REFERENCE_3_3V);
    ADC_setVREF(obj->adcHandle[ADC_ADCA], ADC_REFERENCE_INTERNAL, ADC_REFERENCE_3_3V);
    SysCtl_delay(100U);

    ADC Channels

    // configure the interrupt sources
    // configure the ample window to 15 system clock cycle wide by assigning 14
    // to the ACQPS of ADCSOCxCTL Register.
    // RC2/C1
    ADC_setInterruptSource(obj->adcHandle[1], ADC_INT_NUMBER2, ADC_SOC_NUMBER2);

    // Configure for modular inverter hardware VM
    // Iu <- A5 ADC0-Res0
    ADC_setupSOC(obj->adcHandle[0], ADC_SOC_NUMBER0, ADC_TRIGGER_EPWM1_SOCA, ADC_CH_ADCIN5, HAL_ADC_SAMPLE_WINDOW);

    // Iv <- B0 ADC1-Res0
    ADC_setupSOC(obj->adcHandle[1], ADC_SOC_NUMBER0, ADC_TRIGGER_EPWM1_SOCA, ADC_CH_ADCIN0, HAL_ADC_SAMPLE_WINDOW);

    // Iw <- C2 ADC2-Res0
    ADC_setupSOC(obj->adcHandle[2], ADC_SOC_NUMBER0, ADC_TRIGGER_EPWM1_SOCA, ADC_CH_ADCIN2, HAL_ADC_SAMPLE_WINDOW);

    // Vu <- B2 ADC1-Res1
    ADC_setupSOC(obj->adcHandle[1], ADC_SOC_NUMBER1, ADC_TRIGGER_EPWM1_SOCA, ADC_CH_ADCIN2, HAL_ADC_SAMPLE_WINDOW);

    // Vv <- C0 ADC2-Res1
    ADC_setupSOC(obj->adcHandle[2], ADC_SOC_NUMBER1, ADC_TRIGGER_EPWM1_SOCA, ADC_CH_ADCIN0 , HAL_ADC_SAMPLE_WINDOW);

    // Vw <- A9 ADC0-Res1
    ADC_setupSOC(obj->adcHandle[0], ADC_SOC_NUMBER1, ADC_TRIGGER_EPWM1_SOCA, ADC_CH_ADCIN9, HAL_ADC_SAMPLE_WINDOW);

    // Vbus <- B1 ADC1-Res2
    ADC_setupSOC(obj->adcHandle[1], ADC_SOC_NUMBER2, ADC_TRIGGER_EPWM1_SOCA, ADC_CH_ADCIN1, HAL_ADC_SAMPLE_WINDOW);

    I am using EPWM1, EPWM2 and EPWM3 as in the sample code. I went throug HAL_setupGPIOs and meade the necessary  editions. But I have the same problem. The program stops. It never stop while I'm stepping through the code; only when I let it run continuosly. For this reason, I don't know where the code was running just before the error happens.

  • I am using the LaunchXL-F280049C.

    Seems like you are using LaunchXL-F280049C, you may refer to the example in the folder as below in motor control SDK.

    C:\ti\c2000\C2000Ware_MotorControl_SDK_<version>\solutions\boostxl_drv8320rs\f28004x

  • I am running the sample from 

    \ti\c2000\C2000Ware_MotorControl_SDK_4_01_00_00\solutions\tmdshvmtrinspin\f28004x

    I tried the one you suggested; and after removing all the references to drv8320rs it has the same problem. Could you please tell me what is the cause of this problem?

    Am I the only one who has this problem?

    I noticed the link file doe not define memory names for page 0 so I modified it (see below) but the problem remains.

    I have gone through the documentation even checking if the allocations of the registers of the internal devices. 

    MEMORY
    {
    PAGE 0 :
    BEGIN : origin = 0x000000, length = 0x000002
    RESET : origin = 0x3FFFC0, length = 0x000002

    RAMGS1_3 : origin = 0x00E000, length = 0x006000
    RAMLS4_7 : origin = 0x00A000, length = 0x002000
    PAGE 1 :


    /* FLASHB0_SA : origin = 0x080002, length = 0x00FFFE */ /* on-chip Flash */
    /* FLASHB1_SA : origin = 0x090000, length = 0x010000 */ /* on-chip Flash */

    BOOT_RSVD : origin = 0x000002, length = 0x0000F3 /* Part of M0, BOOT rom will use this for stack */
    RAMM0_1 : origin = 0x0000F5, length = 0x00070B

    /* CLA1 : origin = 0x001400, length = 0x000080 */ /* Defined in headers cmd file*/

    RAMGS0_A : origin = 0x00C000, length = 0x002000

    RAMLS0_1 : origin = 0x008000, length = 0x001000 /* Can't be used, reserved for FAST object */
    RAMLS2_3 : origin = 0x009100, length = 0x000F00 /* */

    CLA1MSGRAMLOW : origin = 0x001480, length = 0x000080
    CLA1MSGRAMHIGH : origin = 0x001500, length = 0x000080

    }

    SECTIONS
    {
    codestart : > BEGIN, PAGE = 0, ALIGN(4)
    .TI.ramfunc : > RAMLS4_7 PAGE = 0, ALIGN(4)
    .text : > RAMGS1_3, PAGE = 0, ALIGN(4)
    .cinit : > RAMGS1_3, PAGE = 0, ALIGN(4)
    .switch : > RAMGS1_3, PAGE = 0, ALIGN(4)
    .reset : > RESET, PAGE = 0, TYPE = DSECT


    Cla1Prog : > RAMLS4_7, PAGE = 0
    Cla1Prog2 : > RAMLS4_7, PAGE = 0

    .const : > RAMGS1_3, PAGE = 0
    .data : > RAMLS2_3, PAGE = 1, ALIGN(4)

    /* Digital Controller Library functions */
    dclfuncs : > RAMGS1_3, PAGE = 0
    dcl32funcs : > RAMGS1_3, PAGE = 0

    .stack : > RAMM0_1, PAGE = 1
    .bss : > RAMGS0_A, PAGE = 1
    .bss:output : > RAMGS0_A, PAGE = 1
    .init_array : > RAMGS0_A, PAGE = 1, ALIGN(4)
    .sysmem : > RAMGS0_A, PAGE = 1

    .bss_cla : > RAMLS2_3, PAGE = 1
    ClaData : > RAMLS2_3, PAGE = 1, ALIGN(2)


    Cla1ToCpuMsgRAM : > CLA1MSGRAMLOW, PAGE = 1
    CpuToCla1MsgRAM : > CLA1MSGRAMHIGH, PAGE = 1

    .const_cla : > RAMLS2_3, PAGE = 1

    .scratchpad : > RAMLS2_3, PAGE = 1
    }

    SECTIONS
    {
    sysctrl_data : > RAMGS0_A, PAGE = 1
    ctrl_data : > RAMM0_1, PAGE = 1
    }

    SECTIONS
    {
    datalog_data : > RAMGS0_A, PAGE = 1
    graph_data : > RAMGS0_A, PAGE = 1
    }

    Thsese are my predefined symbols

  • Hello folks, 

    I finally managed to make the green LED on the card to blink. 

    I went to HAL_setupPeripheralClks() and started selectively disabling the clocks for the peripherials that are not used. The program worked after I disabled all the clocks from the comparator. They were originally enabled.

    /** VM Originally enabled */
    SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_CMPSS1);
    SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_CMPSS2);
    SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_CMPSS3);
    SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_CMPSS4);
    SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_CMPSS5);
    SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_CMPSS6);
    SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_CMPSS7);

    I will continue to testing the full  is01_intro_hal_eabi from \ti\c2000\C2000Ware_MotorControl_SDK_4_01_00_00\solutions\tmdshvmtrinspin\f28004x. In the meantime, could you provide some explanation of why? Is this because the comparator peripherials are not configured?  Are they triggering an interrupt that points to nowhere?

  • The InstaSPIN labs use the CMPSS for over-current protection. If you didn't configure the GPIO, PWM, ADC, and CMPSS according to the kits you used, the fault will be triggered and the output of PWM will be disabled. The CMPSS doesn't trigger any interrupt, just turn-off the PWM output and stop the motor.

    BTW, please use the right labs according to the kit you used, or change the example lab correctly according to the board.

  • Hello Jamming, 

    What kind of fault? An exception? An assert? The watchdog? Why does the program stop in _system_post_cinit()? It appears to me that there's something weird happening with the comparators. At least, if I activate only those used in this example (CMPSS1, CMPSS3 and CMPSS5), the application doesn't stop.

    BTW, I have spent quite a lot of hours going through the docuentation (SPRUI33E, TMS320F28004x) and the surce code; so unfortunately, general answers cannot help me. All the things you have suggested, I have tried them much before you post the message. I am aware that I'm doing something wrong hence I'm asking for help. 

  • If you try to run the example code without any changes on LaunchXL-F280049C as mentioned above, what happens?

    Why does the program stop in _system_post_cinit()?

    Did you monitor the variables in Expressions watch window? Are the values shown as the lab user's guide?

    The FAST codes are in the ROM. The program pointer will stop in _system_post_cinit() at some time if you stop running the code, that's normal.