Part Number: TMS320F2800133
Other Parts Discussed in Thread: LAUNCHXL-F2800137
Hello,
I've been working with the TMS320F2800133 and have attempted to test some of the TI provided examples on it, however I am having an issue with struct initialization, where struct members are not being initialized correctly when declared within main. The strange thing is that when I declare the struct outside of main as a global varible, the members are initialized correclty. This is being compiled for flash, but when built for RAM the issue seems to be solved.
The below example is the led_ex1_blinky provided by TI for f280013x series MCUs. When buliding for flash and flashing an external target, the struct initilization fails when declared inside main and the members are initialized to a = -1, b = -1, c = -1 which clearly is not correct.
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
#include "board.h"
#include "c2000ware_libraries.h"
/*Example struct*/
typedef struct test_t
{
int a;
int b;
int c;
} test_t;
// Main
//
void main(void)
{
/*Initization inside main*/
test_t t = {1, 2, 3};
//
// Initialize device clock and peripherals
//
Device_init();
//
// Disable pin locks and enable internal pull-ups.
//
Device_initGPIO();
//
// Initialize PIE and clear PIE registers. Disables CPU interrupts.
//
Interrupt_initModule();
//
// Initialize the PIE vector table with pointers to the shell Interrupt
// Service Routines (ISR).
//
Interrupt_initVectorTable();
//
// PinMux and Peripheral Initialization
//
Board_init();
//
// C2000Ware Library initialization
//
C2000Ware_libraries_init();
//
// Enable Global Interrupt (INTM) and real time interrupt (DBGM)
//
EINT;
ERTM;
//
// Loop Forever
//
for(;;)
{
//
// Turn on LED
//
GPIO_writePin(myBoardLED0_GPIO, 0);
//
// Delay for a bit.
//
DEVICE_DELAY_US(500000);
//
// Turn off LED
//
GPIO_writePin(myBoardLED0_GPIO, 1);
//
// Delay for a bit.
//
DEVICE_DELAY_US(500000);
}
}
//
// End of File
//
The example was first flashed onto a custom designed board and has now been flashed onto a LAUNCHXL-F2800137 launchpad and it seems that on the launchpad this issue is no longer present. Is there a known issue with the TMS320F2800133 or has anyone experienced a similar issue? I've taken a look at the erata for this family of MCUs and nothing seems to have been mentioned.
This may well be a hardware issue outside of the TMS320F2800133, but any suggestions on possible MCU hardware or software issues would be greatly appreciated.
Thank you!