hello guys, i neep help from you please.
I compiled and run blink program and hello world and everything was ok but i tried with a new program creating 2 tasks and the serial monitor outputs nothing useful. I was searching for a reason in the community and one of them says
- Remove:
#define CONFIG_ESP32_XTAL_FREQ_40 1
- Remove:
#define CONFIG_ESP32_XTAL_FREQ 40
- Add:
#define CONFIG_ESP32_XTAL_FREQ_AUTO 1
- Add
#define CONFIG_ESP32_XTAL_FREQ 0
I did it but nothing works.
my code is:
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_system.h"
#include "esp_spi_flash.h"
#include "nvs_flash.h"
void vTask1(void *pvParameters){
while (1)
{
// vprintf(pcTaskName);
printf("Task1 running \n");
vTaskDelay(1000 / portTICK_PERIOD_MS);
}
vTaskDelete(NULL);
}
void vTask2(void *pvParameters){
while (1)
{
//vprintf(pcTaskName);
printf("Task2 running \n");
vTaskDelay(1000 / portTICK_PERIOD_MS);
}
vTaskDelete(NULL);
}
void app_main(){
nvs_flash_init();
xTaskCreate(
vTask1,
"Task 1",
1000,
NULL,
1,
NULL
);
xTaskCreate(vTask2, "Task 2", 1000, NULL, 1, NULL);
vTaskStartScheduler();
for (int i = 10; i >= 0; i--) {
printf("Restarting in %d seconds...\n", i);
vTaskDelay(1000 / portTICK_PERIOD_MS);
}
printf("Restarting now.\n");
fflush(stdout);
esp_restart();
}