ESP32 hangs when using core 1
Posted: Sun Apr 08, 2018 6:47 am
Hello all,
I'm having a problem executing blink on Core 1. My ESP is the WeMos Lolin32 Lite. Tried to modify the priority, the task handler, add vTaskStartScheduler() in the end of code, all without success. Here's the code:
I'm using Eclipse Oxygen to program the ESP32. When I change it to core 1, it does not blink. There's something that I'm missing?
I'm having a problem executing blink on Core 1. My ESP is the WeMos Lolin32 Lite. Tried to modify the priority, the task handler, add vTaskStartScheduler() in the end of code, all without success. Here's the code:
Code: Select all
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/gpio.h"
#include "sdkconfig.h"
#define BLINK_GPIO 22
void blink_task(void *param)
{
gpio_pad_select_gpio(BLINK_GPIO);
gpio_set_direction(BLINK_GPIO, GPIO_MODE_OUTPUT);
while(1)
{
gpio_set_level(BLINK_GPIO, 0);
vTaskDelay(500 / portTICK_PERIOD_MS);
gpio_set_level(BLINK_GPIO, 1);
vTaskDelay(500 / portTICK_PERIOD_MS);
}
}
void app_main()
{
xTaskCreatePinnedToCore(blink_task, "Blink", 1000, NULL, 20, NULL, 0);
}