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.

TMS320F280021: Issue with MCU Initialization - LED Indicator Remains On

Part Number: TMS320F280021

Hi.

I am using an LED as a status indicator during the initialization process of the MCU.

The process flow is as follows: MCU power-up -> Initialization -> Main function.

The initialization functions consist of initsysctrl(), initgpio(), initpiectrl(), and initpievetable(). 

During initgpio(), I set the LED GPIO pin to 'L', which turns the LED on. This serves as an indicator that the initgpio() function is being executed.

After the Initialization: If the entire initialization process, including initgpio() and other functions like initpiectrl() and initpievetable(), completes without any errors, I then set the LED GPIO to 'H', turning off LED. This indicates that the initialization has been completed successfully.

Here is the error I encounter...
Occasionally, during the initialization process of my microcontroller, an LED, which I set to low (ON) in initgpio(), remains 'on' after the initialization process is supposed to be complete.

When this occurs, the main function of the MCU does not execute. In this situation, I manually turn off and then turn on the power to reset the system.

The expected behavior is for LED to be set high (OFF) at the end of the initialization process, indicating successful completion and the transition to the main function.

Based on the situation described above, I am looking for the suggestion on how to resolve this issue...

1. any possible reasons why LED remains 'on' and the main function fails to execute in this occasional cases?

2. can anyone recommend practical steps for fixing this issue?

  • Hello Noa,

    Occasionally, during the initialization process of my microcontroller, an LED, which I set to low (ON) in initgpio(), remains 'on' after the initialization process is supposed to be complete.

    When you say this error occasionally happens, can you clarify how frequently this is? Is it under any special circumstances (such as resetting or restarting the device through CCS, driving the XRSn pin low, etc.)?

    When this occurs, the main function of the MCU does not execute.

    Can you step through the code to see if the GPIO register changes properly for that line every time? Does it only happen when you run without breakpoints/optimizations? Have you checked to see if the program gets caught in an illegal ISR or ESTOP somewhere?

    Once you answer the above questions, we can try to narrow down exactly why you're seeing the LED behave this way.