esp32 idf 内存段指定问题
Posted: Fri Feb 18, 2022 5:18 am
我想定义一些变量到自定义内存段,链接脚本里已经做了相应修改,目前测试发现很奇怪,只能将变量定义到maic.c中测试是可以的,但如果定义到别的.c中始终不行(map中看不到该变量)
int rr(int argc, char **argv)
{
printf("aaaaaaa\r\n");return 0;
}
const esp_console_cmd_t r __attribute__((section(".console_cmd_lib"))) = {
.command = "heap",
.help = "Get minimum size of free heap memory that was available during program execution",
.hint = NULL,
.func = rr,
};
int rr(int argc, char **argv)
{
printf("aaaaaaa\r\n");return 0;
}
const esp_console_cmd_t r __attribute__((section(".console_cmd_lib"))) = {
.command = "heap",
.help = "Get minimum size of free heap memory that was available during program execution",
.hint = NULL,
.func = rr,
};