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.

TMS320F28379D: In debug mode, the program runs normally, and the program does not run normally after burning to flash

Genius 3095 points
Part Number: TMS320F28379D

Dear team:

My client recently used 28379d development board to collect BISS-C absolute encoder data. Under debug mode, the program runs normally and can collect data normally. At the same time, he has set three periodic functions, which is also running, as shown in the following figure:

After burning to flash, three periodic functions are running, but the program of acquisition encoder is not normal. biss_data_struct.dataReady is always 1, as shown in the figure below. He measured the clock signal produced by ePWM4 through the oscilloscope, and it was always high level.

Q in the figure is a variable set by him. In the main loop, the data is collected all the time through the main loop. The program is as follows:

   while(1)
    {
        bissc_data_read();
        q=q+1;
        DeviceControl.position = bissc_data_struct.position*RES_32BIT;
    }
void bissc_data_read(void)
{
    #if BISS_ENCODER_HAS_CD_INTERFACE
    //every so often, do a CD transaction
    if(bissCDCounter < 0)
    {
        //for Lika HS58S18/I7, addr 0x7E (ManuID MSB) should contain 0x4C (CRC on packet should be 0xF)
        bissc_data_struct.cd_register_xfer_address = 0x7E;
        bissc_data_struct.cd_register_xfer_is_write = 0;
        bissc_data_struct.cd_status = 0;  //arm new
        bissCDCounter = 1000;
    }
    else
    {
        bissCDCounter--;
    }
    #endif

    // BISS_DATA_CLOCKS
    //  for Lika HS58S18/I7-P9-RM2 it is 34 ==> 32 (pos+E+W+posCRC) + CDS + Start
    //  for Kuebler 8.F5863.1426.C423 it is 36 ==> 34 (pos+E+W+posCRC) + CDS + Start
    PM_bissc_setupNewSCDTransfer(BISS_DATA_CLOCKS, SPI_FIFO_WIDTH);
    #if BISS_ENCODER_HAS_CD_INTERFACE
    if(bissc_doCDTasks() == 0)
    {
        ESTOP0; //most likely the BiSS CD CRC did not match
    }
    #endif
    PM_bissc_startOperation();
    while (bissc_data_struct.dataReady != 1) {}
    // fill and receive SCD data (including position) and putting it into the BiSS data structure
    if(bissc_receivePosition(BISS_POSITION_BITS, BISS_POSITION_CRC_BITS) == 0)
    {
        ESTOP0; //BiSS SCD CRC did not match
    }
    DELAY_US(50L);  //Delay 10ms
}

What is the possible reason for this? How to solve this problem?

  • Hi,

    Please note that Flash execution involves additional wait-states (unlike 0-wait RAM).

    Hence, the rate at which the interrupts (and hence the remaining code) work may change based on the priority of the interrupts.  Ex: If the high priority interrupts take more time now due to additional wait-states, CPU may not get to low priority interrupts and other code quickly.

    I will ask if any of our system experts can help you on this.

    Thanks and regards,
    Vamsi

  • Dear Vamsi:

    Thank you for your reply, and I'll ask my client to followup this post if you can arrange system experts to help me on this.

  • Hi,

    Ok. Please suggest to map ISRs to RAM (using .TI.ramfunc) and see if that helps.

    Thanks and regards,

    Vamsi