我想定义一些变量到自定义内存段,链接脚本里已经做了相应修改,目前测试发现很奇怪,只能将变量定义到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,
};
esp32 idf 内存段指定问题
-
- Posts: 290
- Joined: Wed Sep 05, 2018 6:23 am
Re: esp32 idf 内存段指定问题
因为“别的.c” 并没有函数被实际链接进去,在那里定义的console_cmd_lib section也不会被链进去
Who is online
Users browsing this forum: No registered users and 67 guests