HW: ESP32D0WD-V3
OS: Windows 10
如果开启了CONFIG_VFS_SUPPORT_SELECT特性就会“在ISR内调用flash代码”的错误。
分析过程如下:
【1】在vfs组件里,vfs_uart.c文件中定义了select_notif_callback_isr()函数,它是定位在flash中的代码片段。
Code: Select all
static void select_notif_callback_isr(uart_port_t uart_num, uart_select_notif_t uart_select_notif, BaseType_t *task_woken);
Code: Select all
uart_set_select_notif_callback(i, select_notif_callback_isr);
Code: Select all
void uart_set_select_notif_callback(uart_port_t uart_num, uart_select_notif_callback_t uart_select_notif_callback)
{
if (uart_num < UART_NUM_MAX && p_uart_obj[uart_num]) {
p_uart_obj[uart_num]->uart_select_notif_callback = (uart_select_notif_callback_t) uart_select_notif_callback;
}
}
Code: Select all
if (p_uart->uart_select_notif_callback) {
p_uart->uart_select_notif_callback(...);
}
总结:ESP32由于flash用于XIP的设计,同时又用于读写用户数据和OTA。这虽然成本降低了,但引入非常多与此相关的BUG。