Page 1 of 1

VisualMicro Hack for MS Visual Studio to use freeRTOS esp-idf on ESP32

Posted: Sat May 26, 2018 6:19 pm
by Deouss
Here is a process that is more like a hack but it simply allows to use Visual Studio with Espressif IoT framework


1) Go to, download and install VisualMicro Extension


2) Verify and update the extension from the list


3) Create a new Arduino Project in Visual Studio
Note: Ignore the .ino file that opens right after
Do not delethe the .ino file


4) Expand Solution Explorer and right-click on 'Source Files' then -> Add -> New Item -> c++ File(.cpp)
Name the new file main.cpp - this is mandatory


5) Place the following code into that file
Note - this is a simple blink example to test

Code: Select all


#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/gpio.h"

#define BLINK_GPIO (gpio_num_t)2

extern "C" void app_main()
	gpio_set_direction(BLINK_GPIO, GPIO_MODE_OUTPUT);
	while (1) {
		/* Blink off (output low) */
		gpio_set_level(BLINK_GPIO, 0);
		vTaskDelay(100 / portTICK_PERIOD_MS);
		/* Blink on (output high) */
		gpio_set_level(BLINK_GPIO, 1);
		vTaskDelay(100 / portTICK_PERIOD_MS);
6) Enjoy using freeRTOS Espressif esp-idf framework ;)

Note: It is probably possible to mix Arduino code with RTOS - needs testing