Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Board request: ESP8684-DevKitM-1 #1151

Open
Kuenlun opened this issue Jul 19, 2023 · 9 comments
Open

Board request: ESP8684-DevKitM-1 #1151

Kuenlun opened this issue Jul 19, 2023 · 9 comments

Comments

@Kuenlun
Copy link

Kuenlun commented Jul 19, 2023

Please, could someone add or help me add this board based on the ESP-C2?
Or just give a quick fix so I (and many of us) can program this devkit.

https://docs.espressif.com/projects/espressif-esp-dev-kits/en/latest/esp8684/esp8684-devkitm-1/user_guide.html

Thank you!

@Jason2866
Copy link
Contributor

To add the board is not the only needed change. See provided PR for supporting C6. The change for the C2 is similar.

@Kuenlun
Copy link
Author

Kuenlun commented Jul 19, 2023

Great, I will wait patiently.
I decided to create this Issue since there seems to be a lack of information regarding the ESP8684-DevKitM-1 board and the ESP-C2 microcontroller on the platform. Considering that the ESP-C2 is quite commonly used nowadays and was released earlier than the ESP-C6, it strikes me as odd that there is no board support available in Platformio.

Thank you so much!

@Jason2866
Copy link
Contributor

Jason2866 commented Jul 20, 2023

@Kuenlun Did the needed changes in Platformio and added the c2 board (esp32-c2-devkitm-1) The C2 board is only supported with IDF! There is no Arduino Support
The fork is here https://github.com/Jason2866/platform-espressif32/tree/C2_IDF50

You can use with

platform = https://github.com/Jason2866/platform-espressif32.git#C2_IDF50

Since i dont have a C2, i cant test if it does work in real life. The CI C2 example "Blink" does compile successful

@Kuenlun
Copy link
Author

Kuenlun commented Jul 20, 2023

Thank you very much, @Jason2866, for your contribution and especially for your promptness. I've tested it on an ESP8684-DevKitM-1 board and it's working properly.
Just for those who are going to use this board, please remember that it has a quartz crystal operating at 26 MHz, not 40 MHz as most of Espressif's boards do, so you need to configure the corresponding option in menuconfig (espressif/esp-idf#10782 (comment)).
Also, to properly view the serial monitor, I had to set the baud rate to 74800.
I'm leaving the "platformio.ini" file I'm using here for reference:

[platformio]
default_envs = ESP8684_Debug

[env]
platform = https://github.com/Jason2866/platform-espressif32.git#C2_IDF50
framework = espidf
board = esp32-c2-devkitm-1
monitor_speed = 74800
monitor_raw = yes
build_flags =
  -Wall
  -Wextra
  -Werror

[env:ESP8684_Debug]
build_type = debug
build_flags =
  -D configUSE_TRACE_FACILITY=1
  -D configGENERATE_RUN_TIME_STATS=1
  -D configUSE_STATS_FORMATTING_FUNCTIONS=1

[env:ESP8684_Release]
build_type = release

It's odd that when "env" is named "mydebug" in the "platformio.ini" file, it triggers an error:

[env:mydebug]
platform = https://github.com/Jason2866/platform-espressif32.git#C2_IDF50
framework = espidf
board = esp32-c2-devkitm-1
Building .pio\build\mydebug\firmware.bin
esptool.py v4.6.2
Creating esp32c2 image...
Merged 2 ELF sections

A fatal error occurred: Contents of segment at SHA256 digest offset 0xb0 are not all zero. Refusing to overwrite.
*** [.pio\build\mydebug\firmware.bin] Error 2

@Jason2866
Copy link
Contributor

@Kuenlun To avoid to forget to set the correct XTAL frequency, adding a sdkconfig.defaults file in the project folder is a safe way. This can be done MCU specific. See the example here

@Jason2866
Copy link
Contributor

With a hack from @stintel linking of IDF5.1 is now successfully.
In this fork the C2 (and all other ESP32 MCUs) can be used with IDF5.1 and the alpha WiP Arduino 3.0 build based on IDF 5.1

platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF5

@Jason2866
Copy link
Contributor

Solved with PR #1203

@soufiane707
Copy link

Thank you very much, @Jason2866, for your contribution and especially for your promptness. I've tested it on an ESP8684-DevKitM-1 board and it's working properly. Just for those who are going to use this board, please remember that it has a quartz crystal operating at 26 MHz, not 40 MHz as most of Espressif's boards do, so you need to configure the corresponding option in menuconfig (espressif/esp-idf#10782 (comment)). Also, to properly view the serial monitor, I had to set the baud rate to 74800. I'm leaving the "platformio.ini" file I'm using here for reference:

[platformio]
default_envs = ESP8684_Debug

[env]
platform = https://github.com/Jason2866/platform-espressif32.git#C2_IDF50
framework = espidf
board = esp32-c2-devkitm-1
monitor_speed = 74800
monitor_raw = yes
build_flags =
  -Wall
  -Wextra
  -Werror

[env:ESP8684_Debug]
build_type = debug
build_flags =
  -D configUSE_TRACE_FACILITY=1
  -D configGENERATE_RUN_TIME_STATS=1
  -D configUSE_STATS_FORMATTING_FUNCTIONS=1

[env:ESP8684_Release]
build_type = release

It's odd that when "env" is named "mydebug" in the "platformio.ini" file, it triggers an error:

[env:mydebug]
platform = https://github.com/Jason2866/platform-espressif32.git#C2_IDF50
framework = espidf
board = esp32-c2-devkitm-1
Building .pio\build\mydebug\firmware.bin
esptool.py v4.6.2
Creating esp32c2 image...
Merged 2 ELF sections

A fatal error occurred: Contents of segment at SHA256 digest offset 0xb0 are not all zero. Refusing to overwrite.
*** [.pio\build\mydebug\firmware.bin] Error 2

hi please , were you able to use the arduino framework

@Jason2866
Copy link
Contributor

@soufiane707 My fork (not fully compatible to original!) does support the C2 with Arduino
Can be used with

platform = https://github.com/Jason2866/platform-espressif32.git

Do NOT open an issue here when you encounter problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants