Other Parts Discussed in Thread: CC2640
用CCS编译程序后 view->Memory Allocation查看编译后的数据存放,发现定义的数组放入.data段的同时,也会被放入.cinit段,而.cinit段是会放到flash中去的。由此产生的问题是,定义数组会挤占flash空间,本来flash就不是很充足,数组稍微定义大一点,编译就通不过。定义一个数组而已,想不明白为什么要存到flash里面去呢?有没有办法定义的数组不放.cinit中?
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.
/*
* ======== empty.c ========
*/
/* For usleep() */
#include <unistd.h>
#include <stdint.h>
#include <stddef.h>
/* Driver Header files */
#include <ti/drivers/GPIO.h>
// #include <ti/drivers/I2C.h>
// #include <ti/drivers/SPI.h>
// #include <ti/drivers/UART.h>
// #include <ti/drivers/Watchdog.h>
/* Board Header file */
#include "Board.h"
uint8_t Array[1024]={0xef,0xff,0x32};
uint8_t t;
/*
* ======== mainThread ========
*/
void *mainThread(void *arg0)
{
/* 1 second delay */
uint32_t time = 1;
/* Call driver init functions */
GPIO_init();
// I2C_init();
// SPI_init();
// UART_init();
// Watchdog_init();
t=Array[1];
/* Configure the LED pin */
GPIO_setConfig(Board_GPIO_LED0, GPIO_CFG_OUT_STD | GPIO_CFG_OUT_LOW);
/* Turn on user LED */
GPIO_write(Board_GPIO_LED0, Board_GPIO_LED_ON);
while (1) {
sleep(time);
GPIO_toggle(Board_GPIO_LED0);
}
}
我在empty例程中定义了数组,初始化后再调用,添加数组前后cinit段没有变化:
