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.

TMS320F280025C: Software Reset Issue

Part Number: TMS320F280025C


Tool/software:

We are working on a C2000 MCU, specifically the F280025C, for motor control. We have a CAN bootloader residing in the first 3 sectors of flash. After that, our application code is placed.

During a power cycle, the bootloader runs first, waits for some time, then disables CAN and the timer, and finally jumps to the application.
This flow works fine — we updated the firmware using CAN during a power cycle, and the application runs correctly.

Next, we wanted to avoid a power cycle and instead perform a software reset by sending a CAN message to the application. The bootloader runs, and we update the firmware again.
However, this time the application does not run correctly — specifically,
the PWM outputs are not functioning properly.

After performing a power cycle again (without re flashing the firmware), the application works fine.

Observations:

Other peripherals like ADC and I/Os are working correctly.

Of the 3 PWM outputs (U, V, W), the V and W phases output correctly.

The U phase seems to be using the same comparator value as the V phase. We confirmed this by changing the counter compare values.

We are updating the counter compare values via CAN and reading them back using the getCounterCompare() function, which returns the correct values.

We also tried different values, but still, the W phase is fine while the U phase output appears to mirror the V phase.

We noticed that the PWMXLINK register is not being set properly when jumping to the application. In our application startup,
there are three lines that clear certain RAM memory regions, and that turned out to be the issue:

HAL_clearDataRAM((void *)extVarsLoadStart, (uint16_t)extVarsLoadSize);

What I'd like clarification on is this: Why doesn't a power cycle cause this issue, but a software reset does?
This seems to be particularly related to extVarsLoadSize.

In the linker file, we have the following:

LOAD = RAMGS0
LOAD_START(extVarsLoadStart),
LOAD_SIZE(extVarsLoadSize),
LOAD_END(extVarsLoadEnd)

  • HI Hari,

    The SW reset doesn't clear the MCU internal RAM. You need to initialize the RAM manually. The cmd file should update the LoadSize based on the new firmware in flash. What is the difference between the LoadSize from SW reset and PORRST (power cycling)?

  • Hi Wang,

    I haven't updated the firmware. I performed a software reset, and the bootloader waits for some time before jumping to the application. While still in the bootloader, I send the PWMXLINK register value over CAN, and it's correct at that point.

    However, after jumping to the application, we are clearing the RAMGS0 section, and when I broadcast the PWMXLINK register value again, it's incorrect. When I removed the RAMGS0 clearing, I got the correct (default) value from the PWMXLINK register.

    What I'd like clarification on is this: Why doesn't a power cycle cause this issue, but a software reset does?

  • Hi Hari,

    After SW reset, the CPU starts execution of bootloader. You sent PWMLINK register value to bootloader. Does the bootloader program the value to PWMLINK register? Is the PWMLINK register value mapped or located in RAMGS0?

    Is the RAMGS0 cleaned after power-cycling too?