Other Parts Discussed in Thread: TMS320F2800133, LAUNCHXL-F2800137
器件型号: TMS320F2800133
主题中讨论的其他器件: LAUNCHXL-F2800137
您好:
我一直在使用 TMS320F2800133、并尝试测试 TI 提供的一些相关示例、但是我遇到了结构初始化问题、在 main 中声明结构成员时、结构成员无法正确初始化。 奇怪的是、当我将 main 之外的结构声明为全局变量时、成员被初始化成 corredy。 该代码正在针对闪存进行编译、但在针对 RAM 进行构建时、问题似乎得到解决。
以下示例是 TI 为 f280013x 系列 MCU 提供的 led_ex1_blinky。 当闪存构建并刷写外部目标时、在 main 内声明结构初始化失败、并且成员初始化为 a =–1、b =–1、c =–1、这显然是不正确的。
//
// 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
//
该示例首先刷写到定制设计的电路板上、现在已刷写到 LAUNCHXL-F2800137 LaunchPad 上、似乎 LaunchPad 上不再存在此问题。 TMS320F2800133 是否存在已知问题或是否有人遇到过类似的问题? 我已经查看了此 MCU 系列的 erata、似乎没有提到任何内容。
这很可能是 TMS320F2800133 之外的硬件问题、但有关可能的 MCU 硬件或软件问题的任何建议都将非常有用。
谢谢!