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.

TMS320F28375S: Issue about using the STA sample with diagnosis library

Part Number: TMS320F28375S

Dear Sir,

We integrate the STA sample with calling STL function for power on testing.

The timer2 and some GPIOs are malfunction after we call the STA test (for example: STA_SCI_TEST or STA_SCI_MON...)

Is it possible to reset all the CPU setting after calling the STA test?

  • Note that the STA is a reference example for how to use the different library modules and isn't necessarily meant to be used as-is. You should customize the code to use the applicable peripheral instances and GPIOs for your application. That said, if you do still need to reset a peripheral after testing it, some modules have a SOFTPRESx register in DEV_CFG_REGS that can be used to do so.

    Similarly the STL_SCI_MON and STL_INT_MON tests are meant to demonstrate how to do time slot monitoring of communications and interrupts. You should use them as a model of how to integrate the monitoring into your own existing code.

    Whitney

  • Is there any method we can reset all CPU registers as the cold-boot status?

    Eddie

  • I'm not aware of a software CPU register reset--just causing a hardware CPU reset of the device (like with the WD or similar). You can look up the default values in the CPU guide if you want to write them manually, but of course that won't work on the read-only bits.

    Whitney

  • The CPU self-test is executed at the program begin. I can NOT use WD to reboot the CPU. It will execute the CPU self-test again.

    Now, my program run well if there is no STA test (CPU self-test). I need a methed to reset all registers. We had tried to write the register to our setting. But the timer2 still mafunction.

    Eddie

  • Which specific test is causing the issue? By CPU self-test do you mean HWBIST? The HWBIST code saves and restores all the CPU registers, so I wouldn't think that would be the cause the issue.

    Note that some of the tests use CPU Timer 2--like STL_OSC_CT--since it can be configured to run off of an independent clock source instead of SYSCLK. If you are configuring the timer before running one of the tests that uses CPU Timer 2, it will overwrite your Timer 2 settings, so you'll need to restore them afterward or wait until after the tests run to configure the timer.

    Whitney

  • I DO reconfigue the timer2 as we need. But, the time2 still run with STA frequency.

    Here is our procedure.

    =====Code Snippet===

    STA_main(); // Do STA Test
    DELAY_US(500);

    Gpio_setup1(); // PIN Mux Setting


    DINT;
    IER = 0x0000;
    IFR = 0x0000;

    InitPieCtrl();
    InitPieVectTable();


    EALLOW;
    PieVectTable.TIMER0_INT = &cpu_timer0_isr;
    PieVectTable.TIMER1_INT = &cpu_timer1_isr;

    PieVectTable.TIMER2_INT = &cpu_timer2_isr;

    // PieVectTable.SPIA_RX_INT = &spiaRxFifoIsr;
    // PieVectTable.SPIA_TX_INT = &spiaTxFifoIsr;
    // PieVectTable.SPIB_RX_INT = &spibRxFifoIsr;

    PieVectTable.SCIA_RX_INT = &sciaRxFifoIsr;
    PieVectTable.SCIB_RX_INT = &scibRxFifoIsr;


    PieVectTable.ADCA1_INT = &adca1_isr; //function for ADCA interrupt 1
    EDIS;

    .....

    PieCtrlRegs.PIECTRL.bit.ENPIE = 1; // Enable the PIE block
    PieCtrlRegs.PIEIER9.bit.INTx1 = 1; // PIE Group 9, INT1
    PieCtrlRegs.PIEIER9.bit.INTx2 = 1; // PIE Group 9, INT2
    PieCtrlRegs.PIEIER9.bit.INTx3 = 1; // PIE Group 9, INT3
    PieCtrlRegs.PIEIER9.bit.INTx4 = 1; // PIE Group 9, INT4
    PieCtrlRegs.PIEIER6.bit.INTx1 = 1; // Enable PIE Group 6, INT 1 rx SPIA_RX
    PieCtrlRegs.PIEIER6.bit.INTx2 = 1; // Enable PIE Group 6, INT 2 tx SPIA_TX
    PieCtrlRegs.PIEIER6.bit.INTx3 = 1; // Enable PIE Group 6, INT 3 rx SPIB_RX
    PieCtrlRegs.PIEIER1.bit.INTx7 = 1; // PIE Group 1, INT7 time 0
    PieCtrlRegs.PIEIER1.bit.INTx1 = 1;

    ...

    IER = M_INT6; //ENABLE SPIA,SPIB
    IER |= M_INT1; //ENABLE timer 0
    IER |= M_INT13; //ENABLE timer 1
    IER |= M_INT14; //ENABLE timer 2
    IER |= M_INT9; //ENABLE SCI1,SCIB
    EINT; // Enable Global Interrupts
    ERTM; // Enable Global realtime __interrupt DBGM

    ====== End ============

    Is there something wrong?

    Eddie

  • That procedure seems fine. I don't see where CPU Timer 2 set up is part of it though? Can you try taking a screen capture of the Timer 2 register configuration both with and without the STA and see if you can figure out what the difference is that's causing the issue?

    Whitney