工具与软件:
您好!
我目前正在将 CCS 与 F2838x 板配合使用、并探索支持 C++代码(而非 C)的可能性。我将闪烁 LED 示例修改为 C++、编译成功。 不过、我现在正在测试 C++库是否受支持、并了解需要解决的内存限制。
即使将堆栈和堆大小增加到1024、修改后的代码也会遇到内存限制错误。 我应该进行哪些更改才能解决此问题? 此外、如果有任何文档或资源可以帮助我确保 C++与 CCS 兼容、我将不胜感激。
#include <stdio.h>
extern "C"{
#include "driverlib.h"
#include "device.h"
#include "board.h"
#include "c2000ware_libraries.h"
}
class DeviceController {
public:
//Constructor
DeviceController() {
// 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;
}
//Method representing background task
void applicationRun(){
printf("Hello!\n");
// fflush(stdout);
while (true) {
// 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);
}
}
};
int main() {
// Class based definition for DeviceController
DeviceController controller;
controller.applicationRun();
return 0;
}
"syscfg/device_cmd.cmd"、第77行:错误#10099-D:程序无法放入可用存储器、或者该段包含的调用站点需要无法为此段生成 trampoline。 针对第0页的".sysmem"段大小0x1024运行对齐/分块放置失败。 可用存储器范围:
RAMLS5大小:0x800未使用:0x143最大空洞:0x143
"syscfg/device_cmd.cmd"、第71行:错误#10099-D:程序无法放入可用存储器、或者该段包含的调用站点需要无法为此段生成 trampoline。 针对第0页的".stack"大小0x1024段运行对齐/分块放置失败。 可用存储器范围:
RAMM1大小:0x3f8未使用:0x3f8最大空洞:0x3f8
"syscfg/device_cmd.cmd"、第68行:错误#10099-D:程序无法放入可用存储器、或者该段包含的调用站点需要无法为此段生成 trampoline。 段".text"大小0x323d 第0页的对齐/分块放置失败。 可用存储器范围:
RAMLS0大小:0x800未使用:0x0最大空洞:0x0
RAMLS1大小:0x800未使用:0x0最大空洞:0x0
RAMLS2大小:0x800未使用:0x0最大空洞:0x0
RAMLS3大小:0x800未使用:0x0最大空洞:0x0
RAMLS4大小:0x800未使用:0x0最大空洞:0x0
错误#10010:链接过程中遇到错误;未构建"led_ex1_blinky.out"
