<stdio.h> #include "esp_flash.h" #include "esp_log.h" #define TAG "Firefly" void app_main(void) { esp_flash_init(esp_flash_default_chip); uint32_t flash_size; esp_flash_get_size(esp_flash_default_chip,&flash_size); ESP_LOGI(TAG, "default flash size: %lu", flash_size); } ...
pcName : 任务函数的别名,仅仅是方便调试所用。 usStackDepth :任务堆栈的深度,定义了堆栈可以包含的变量数——不是字节数。比如如果堆栈 的宽度为 16BIT,而 usStackDepth定义为100,则200 字节被分配给堆栈存储。堆栈深度乘以堆栈宽度的最大值,不能超过 size_t变量能包含的最大值。 pvParameters :作为参数传递给...
可以看看 idf 是如何调用 app_main 的。 staticvoidmain_task(void*args) { ESP_LOGI(MAIN_TAG,"Started on CPU%d", (int)xPortGetCoreID());#if!CONFIG_FREERTOS_UNICORE//Wait for FreeRTOS initialization to finish on other core, before replacing its startup stackesp_register_freertos_idle_hook_...
.task_name = "loop_task", // task will be created //任务名 .task_priority = uxTaskPriorityGet(NULL), //优先级 .task_stack_size = 2048, //分配栈大小 .task_core_id = tskNO_AFFINITY }; esp_event_loop_args_t loop_without_task_args = { //配置不带任务的循环 .queue_size = 5, ...
*/#include<stdio.h>#include"sdkconfig.h"#include"freertos/FreeRTOS.h"#include"freertos/task.h"#include"esp_system.h"#include"esp_spi_flash.h"voidapp_main(void){printf("Hello world!\n");/* Print chip information */esp_chip_info_tchip_info; ...
(QOS0)", i++); paramsQOS0.payloadLen = strlen(cPayload); @@ -328,5 +360,5 @@ void app_main() ESP_ERROR_CHECK( err ); initialise_wifi(); - xTaskCreatePinnedToCore(&aws_iot_task, "aws_iot_task", 9216, NULL, 5, NULL, 1); + xTaskCreatePinnedToCore(&aws_iot_task, "aws_...
2. 创建 main_task ,见如下链接https://github.com/espressif/esp-idf/bl ... mmon.c#L72; 3. app_main 中处理的数组大小取决于 ESP_TASK_MAIN_STACK ,具体配置见 CONFIG_ESP_MAIN_TASK_STACK_SIZE,默认是 3584,见如下链接https://github.com/espressif/esp-idf/bl ... onfig#L168 ...
这里上一下app_main.c文件源码,其实只要看过我的教学博文,下面这个文件的代码都是有分析说明的,包括本文上面也对每个部分的功能有单独说明。整个应用工程的代码,我上传到了资源: 本博文工程源码 app_main.c: /* MQTT (over TCP) Example This example code is in the Public Domain (or CC0 licensed, at ...
I (401) app_main: [APP] IDF version: v5.2 I (421) wifi_connect_deault: Start example_connect. I (421) pp: pp rom version: 9387209 I (421) net80211: net80211 rom version: 9387209 I (431) wifi:wifi driver task: 3fca1e8c, prio:23, stack:6656, core=0 ...
登录后复制#include"esp_heap_trace.h"#defineNUM_RECORDS 100staticheap_trace_record_ttrace_record[NUM_RECORDS];// This buffer must be in internal RAM...voidapp_main(){ ...ESP_ERROR_CHECK(heap_trace_init_standalone(trace_record, NUM_RECORDS) ); ...