Esp8266 and Idf

Deouss
Posts: 425
Joined: Tue Mar 20, 2018 11:36 am

Esp8266 and Idf

Postby Deouss » Mon Feb 11, 2019 1:42 am

Maybe this is a trivial question but can current idf for esp32 can be used for esp8266 ?
I am just looking into previous hardware models and wonder if anything needs to be ported or simply switching some compilation options is ok.

ESP_Gargamel
Posts: 786
Joined: Wed Nov 14, 2018 8:45 am

Re: Esp8266 and Idf

Postby ESP_Gargamel » Mon Feb 11, 2019 2:33 am

hi, current esp-idf doesn't support esp8266, integrating esp8266 into esp-idf is under our plan.
ESP8266_RTOS_SDK is idf style esp8266 sdk, some fundamental features are same with idf. Here is the link: https://github.com/espressif/ESP8266_RTOS_SDK

Deouss
Posts: 425
Joined: Tue Mar 20, 2018 11:36 am

Re: Esp8266 and Idf

Postby Deouss » Mon Feb 11, 2019 3:08 am

Can I use CMake for that SDK ?

Deouss
Posts: 425
Joined: Tue Mar 20, 2018 11:36 am

Re: Esp8266 and Idf

Postby Deouss » Thu Feb 14, 2019 3:28 am

OK. So I was able to flash Esp8266 (NodeMCU) with almost same settings for Esp32 toolchain except I switched IDF_PATH to ESP8266_RTOS_SDK directory. All compiled fine just like CMake for esp32

Log:
esptool.py v2.3.1
Running esptool.py in directory C:\Users\dev\Documents\Esp8266\Projects\blink\build
Executing "C:\Python27\python.exe C:\Users\dev\Documents\Esp32\esp-idf\components/esptool_py/esptool/esptool.py -p com17 -b 460800 write_flash @flash_project_args"...
esptool.py -p com17 -b 460800 write_flash --flash_mode dio --flash_size detect --flash_freq 40m 0x1000 bootloader/bootloader.bin 0x8000 partition_table/partition-table.bin 0x10000 blink.bin
esptool.py v2.3.1
Connecting....
Detecting chip type... ESP8266
Chip is ESP8266EX
Features: WiFi
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Compressed 22432 bytes to 13143...
Wrote 22432 bytes (13143 compressed) at 0x00001000 in 0.3 seconds (effective 592.3 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 82...
Wrote 3072 bytes (82 compressed) at 0x00008000 in 0.0 seconds (effective 1890.5 kbit/s)...
Hash of data verified.
Compressed 136848 bytes to 67042...
Wrote 136848 bytes (67042 compressed) at 0x00010000 in 1.7 seconds (effective 647.0 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
However simple blink does not work.
What am I doing wrong here?

Deouss
Posts: 425
Joined: Tue Mar 20, 2018 11:36 am

Re: Esp8266 and Idf

Postby Deouss » Sat Feb 16, 2019 3:03 am

I guess I used setup for esp32 that was somehow forced with setup.
I am getting different errors now from CMake - seems like something is not set right in CMake files or code.
After tweaking toolchain-esp8266.cmake file I get to the point where generating build output dirs fails.
-- The ASM compiler identification is GNU
-- Found assembler: C:/Users/dev/Documents/Esp8266/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc.exe
-- The C compiler identification is GNU 5.2.0
-- The CXX compiler identification is GNU 5.2.0
-- Check for working C compiler: C:/Users/dev/Documents/Esp8266/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc.exe
-- Check for working C compiler: C:/Users/dev/Documents/Esp8266/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Users/dev/Documents/Esp8266/xtensa-lx106-elf/bin/xtensa-lx106-elf-g++.exe
-- Check for working CXX compiler: C:/Users/dev/Documents/Esp8266/xtensa-lx106-elf/bin/xtensa-lx106-elf-g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at C:/Users/dev/Documents/Esp8266/esp-idf/tools/cmake/project.cmake:118 (add_subdirectory):
add_subdirectory given source "cjson" which is not an existing directory.
Call Stack (most recent call first):
CMakeLists.txt:8 (project)


CMake Error at C:/Users/dev/Documents/Esp8266/esp-idf/tools/cmake/project.cmake:118 (add_subdirectory):
add_subdirectory given source "coap" which is not an existing directory.
Call Stack (most recent call first):
CMakeLists.txt:8 (project)

--------
Most of subdirs fail - 'existing directory' error

These lines fail:

~~~
# Add each component to the build as a library
#
foreach(COMPONENT_PATH ${BUILD_COMPONENT_PATHS})
get_filename_component(COMPONENT_NAME ${COMPONENT_PATH} NAME)
add_subdirectory(${COMPONENT_PATH} ${COMPONENT_NAME})
endforeach()

~~~

I would appreciate help

Who is online

Users browsing this forum: No registered users and 64 guests