esp32 idf 内存段指定问题

abcliuleihua
Posts: 3
Joined: Tue Jan 18, 2022 9:34 am

esp32 idf 内存段指定问题

Postby abcliuleihua » 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,
};

ESP_morris
Posts: 290
Joined: Wed Sep 05, 2018 6:23 am

Re: esp32 idf 内存段指定问题

Postby ESP_morris » Fri Feb 18, 2022 9:28 am

因为“别的.c” 并没有函数被实际链接进去,在那里定义的console_cmd_lib section也不会被链进去

Who is online

Users browsing this forum: No registered users and 159 guests