Skip to content

Commit

Permalink
ESP32-C6: bringup of Standalone is complete
Browse files Browse the repository at this point in the history
  • Loading branch information
lyusupov committed Jan 29, 2024
1 parent aa9d5ce commit 36e07dd
Show file tree
Hide file tree
Showing 11 changed files with 93 additions and 12 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,10 @@ Model(s)|Platform|First appearance|       Sta
[**Octave**](https://github.com/lyusupov/SoftRF/wiki/Octave-Concept)|[ASR Microelectronics<br>ASR6601](https://asriot.readthedocs.io/en/latest/ASR6601/index.html)|Q1 2022|![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/icon_good.png)| **the best 'price per radio protocol' ratio** on the market
1&nbsp;[**Lego**](https://github.com/lyusupov/SoftRF/wiki/Lego-Edition)<br>2&nbsp;[**SkyView Pico**](https://github.com/lyusupov/SoftRF/wiki/SkyView-Pico)&nbsp;![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/new-icon.jpg)|[Raspberry Pi<br>Foundation<br>**RP2040**](https://en.wikipedia.org/wiki/RP2040)|Q1 2022|![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/icon_good.png)|&nbsp;holds [**FCC/CE** mark](https://github.com/lyusupov/SoftRF/wiki/Lego-Edition#certificates)
[**Balkan**](https://github.com/lyusupov/SoftRF/wiki/Balkan-Edition)|[STMicroelectronics](https://en.wikipedia.org/wiki/STMicroelectronics)<br>[STM32**WLE5**](https://www.st.com/en/microcontrollers-microprocessors/stm32wle5cc.html)|Q3 2022|![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/icon_good.png)|&nbsp;holds [**CE** mark](https://github.com/lyusupov/SoftRF/wiki/Balkan-Edition#certificates)
[**WebTop USB**](https://github.com/lyusupov/SoftRF/wiki/WebTop-USB)|[Espressif<br>ESP32-S2](https://en.wikipedia.org/wiki/ESP32#ESP32-S2)|Q4 2022|![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/icon_may_need_imp.png)|
[**Standalone**](https://github.com/lyusupov/SoftRF/wiki/Standalone-Edition)&nbsp;**upgrade**![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/new-icon.jpg)|[Espressif<br>ESP32-C3](https://en.wikipedia.org/wiki/ESP32#ESP32-C3)|Q1 2023|![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/icon_may_need_imp.png)|[RISC-V](https://en.wikipedia.org/wiki/RISC-V)
[**WebTop USB**](https://github.com/lyusupov/SoftRF/wiki/WebTop-USB)|[Espressif<br>ESP32-S2](https://en.wikipedia.org/wiki/ESP32#ESP32-S2)|Q4 2022|![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/icon_good.png)|
[**Standalone**](https://github.com/lyusupov/SoftRF/wiki/Standalone-Edition)&nbsp;**upgrade**![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/hot_icon.jpg)|[Espressif<br>ESP32-C3](https://en.wikipedia.org/wiki/ESP32#ESP32-C3)|Q1 2023|![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/icon_good.png)|[RISC-V](https://en.wikipedia.org/wiki/RISC-V)
1&nbsp;[**Prime Mark III**](https://github.com/lyusupov/SoftRF/wiki/Prime-Edition-MkIII)![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/new-icon.jpg)<br>2&nbsp;[**SkyView Pico**](https://github.com/lyusupov/SoftRF/wiki/SkyView-Pico#alternative-hardware-option)&nbsp;![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/new-icon.jpg)<br>3&nbsp;[**Ham**](https://github.com/lyusupov/SoftRF/wiki/Ham-Edition)&nbsp;![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/new-icon.jpg)<br>4&nbsp;[**Midi**](https://github.com/lyusupov/SoftRF/wiki/Midi-Edition)&nbsp;![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/new-icon.jpg)|[Espressif<br>ESP32-S3](https://en.wikipedia.org/wiki/ESP32#ESP32-S3)|Q1 2023|![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/icon_may_need_imp.png)|
[**Standalone**](https://github.com/lyusupov/SoftRF/wiki/Standalone-Edition)&nbsp;**upgrade**![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/new-icon.jpg)|[Espressif<br>ESP32-C6](https://en.wikipedia.org/wiki/ESP32#ESP32-C6)|Q1 2024|![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/icon_in_progress.png)|2 [RISC-V](https://en.wikipedia.org/wiki/RISC-V) cores<br>big.LITTLE

## By sub-1 GHz radio
Radio|Model(s)|First appearance|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Status&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|Notes
Expand Down
Binary file added documents/images/Standalone-ESP32C6-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documents/images/Standalone-ESP32C6-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documents/images/Standalone-ESP32C6-3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documents/images/bom/WT0132C6-S5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documents/images/ham-26.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documents/images/ham-27.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions software/firmware/binaries/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- [ESP32](https://github.com/lyusupov/SoftRF/blob/master/software/firmware/binaries/README.md#esp32)
- [ESP32-S3](https://github.com/lyusupov/SoftRF/blob/master/software/firmware/binaries/README.md#esp32-s3)
- [ESP32-S2](https://github.com/lyusupov/SoftRF/blob/master/software/firmware/binaries/README.md#esp32-s2)
- [ESP32-C6](https://github.com/lyusupov/SoftRF/blob/master/software/firmware/binaries/README.md#esp32-c6)
- [ESP32-C3](https://github.com/lyusupov/SoftRF/blob/master/software/firmware/binaries/README.md#esp32-c3)
- [S76G](https://github.com/lyusupov/SoftRF/wiki/AcSiP-S7xG-flashing-instructions#s76g) (STM32L073)
- [CC1352R](https://github.com/lyusupov/SoftRF/wiki/Uni-Edition.-Firmware-maintenance-procedures#initial-installation)
Expand Down Expand Up @@ -331,6 +332,30 @@ The Bootloader is capable to self-program an application firmware into the devic



6. Press **START** button and wait for completion.

"Stock" devices may also require to apply full flash memory erase (use **ERASE** UI "button") prior to first flashing with SoftRF's firmware.

<br>

## ESP32-C6

1. Take ESP32 flash download tool from this location: https://www.espressif.com/en/support/download/other-tools <br>

2. Download an appropriate version of SoftRF firmware from [this location](https://github.com/lyusupov/SoftRF/tree/master/software/firmware/binaries/ESP32C6/SoftRF) and unzip the archive ; <br>

3. Connect the ESP32-C6 based device to your PC by means of a USB cable ;

4. Execute the tool; Select **ESP32-C6** Chip Type, **Develop** WorkMode and **UART** LoadMode ; <br>

5. Select COM port, enter partition files and addresses, select options ; <br>

Here is an example:<br>

![](https://github.com/lyusupov/SoftRF/raw/master/documents/images/Standalone-ESP32C6-3.jpg)



6. Press **START** button and wait for completion.

"Stock" devices may also require to apply full flash memory erase (use **ERASE** UI "button") prior to first flashing with SoftRF's firmware.
Expand Down
59 changes: 51 additions & 8 deletions software/firmware/source/SoftRF/src/platform/ESP32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ lmic_pinmap lmic_pins = {

WebServer server ( 80 );

#if !defined(EXCLUDE_LED_RING)
#if defined(USE_NEOPIXELBUS_LIBRARY)
NeoPixelBus<NeoGrbFeature, Neo800KbpsMethod> strip(PIX_NUM, SOC_GPIO_PIN_LED);
#else /* USE_ADAFRUIT_NEO_LIBRARY */
Expand All @@ -95,6 +96,7 @@ NeoPixelBus<NeoGrbFeature, Neo800KbpsMethod> strip(PIX_NUM, SOC_GPIO_PIN_LED);
Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIX_NUM, SOC_GPIO_PIN_LED,
NEO_GRB + NEO_KHZ800);
#endif /* USE_NEOPIXELBUS_LIBRARY */
#endif /* EXCLUDE_LED_RING */

#if defined(USE_OLED)
U8X8_OLED_I2C_BUS_TYPE u8x8_ttgo (TTGO_V2_OLED_PIN_RST);
Expand Down Expand Up @@ -464,14 +466,18 @@ static void ESP32_setup()
esp_err_t ret = ESP_OK;
uint8_t null_mac[6] = {0};

#if defined(CONFIG_IDF_TARGET_ESP32C6)
ret = esp_read_mac(efuse_mac, ESP_MAC_WIFI_STA);
if (ret != ESP_OK) {
#else
ret = esp_efuse_mac_get_custom(efuse_mac);
if (ret != ESP_OK) {
ESP_LOGE(TAG, "Get base MAC address from BLK3 of EFUSE error (%s)", esp_err_to_name(ret));
/* If get custom base MAC address error, the application developer can decide what to do:
* abort or use the default base MAC address which is stored in BLK0 of EFUSE by doing
* nothing.
*/

#endif /* CONFIG_IDF_TARGET_ESP32C6 */
ESP_LOGI(TAG, "Use base MAC address which is stored in BLK0 of EFUSE");
chipmacid = ESP.getEfuseMac();
} else {
Expand Down Expand Up @@ -545,7 +551,7 @@ static void ESP32_setup()
*/

if (psramFound()) {
switch(flash_id)
switch (flash_id)
{
case MakeFlashId(GIGADEVICE_ID, GIGADEVICE_GD25LQ32):
/* ESP32-WROVER module with ESP32-NODEMCU-ADAPTER */
Expand All @@ -565,19 +571,18 @@ static void ESP32_setup()
#elif defined(CONFIG_IDF_TARGET_ESP32S3)
case MakeFlashId(GIGADEVICE_ID, GIGADEVICE_GD25Q128):
/* specific to psram_type=opi enabled custom build */
hw_info.model = SOFTRF_MODEL_HAM;
hw_info.model = SOFTRF_MODEL_HAM;
break;
/* Both Ai-Thinker ESP-S3-12K and LilyGO S3 Core have QSPI PSRAM onboard */
case MakeFlashId(GIGADEVICE_ID, GIGADEVICE_GD25Q64):
default:
hw_info.model = SOFTRF_MODEL_PRIME_MK3;
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
case MakeFlashId(ST_ID, XMC_XM25QH32B):
default:
esp32_board = ESP32_C3_DEVKIT;
#elif defined(CONFIG_IDF_TARGET_ESP32C6)
/* TBD */
default:
esp32_board = ESP32_C6_DEVKIT;
#else
#error "This ESP32 family build variant is not supported!"
#endif
Expand All @@ -599,7 +604,7 @@ static void ESP32_setup()
#elif defined(CONFIG_IDF_TARGET_ESP32S2)
esp32_board = ESP32_S2_T8_V1_1;
#elif defined(CONFIG_IDF_TARGET_ESP32S3)
switch(flash_id)
switch (flash_id)
{
case MakeFlashId(GIGADEVICE_ID, GIGADEVICE_GD25Q128):
/*
Expand All @@ -619,7 +624,22 @@ static void ESP32_setup()
break;
}
#elif defined(CONFIG_IDF_TARGET_ESP32C3)
esp32_board = ESP32_C3_DEVKIT;
switch (flash_id)
{
case MakeFlashId(ST_ID, XMC_XM25QH32B):
default:
esp32_board = ESP32_C3_DEVKIT;
break;
}
#elif defined(CONFIG_IDF_TARGET_ESP32C6)
switch (flash_id)
{
case MakeFlashId(ZBIT_ID, ZBIT_ZB25VQ32B): /* WT0132C6 */
case MakeFlashId(ST_ID, XMC_XM25QH32B): /* ESP32-C6-MINI-1U */
default:
esp32_board = ESP32_C6_DEVKIT;
break;
}
#endif /* CONFIG_IDF_TARGET_ESP32 */
}

Expand Down Expand Up @@ -1245,6 +1265,17 @@ static void ESP32_setup()
/* TBD */

#endif /* CONFIG_IDF_TARGET_ESP32C3 */

#if defined(CONFIG_IDF_TARGET_ESP32C6)
} else if (esp32_board == ESP32_C6_DEVKIT) {

lmic_pins.nss = SOC_GPIO_PIN_C6_SS;
lmic_pins.rst = LMIC_UNUSED_PIN;
lmic_pins.busy = SOC_GPIO_PIN_C6_TXE;

/* TBD */

#endif /* CONFIG_IDF_TARGET_ESP32C6 */
}

#if defined(CONFIG_IDF_TARGET_ESP32S3)
Expand Down Expand Up @@ -2850,6 +2881,10 @@ static void ESP32_SPI_begin()
SPI.begin(SOC_GPIO_PIN_HELTRK_SCK, SOC_GPIO_PIN_HELTRK_MISO,
SOC_GPIO_PIN_HELTRK_MOSI, SOC_GPIO_PIN_HELTRK_SS);
break;
case ESP32_C6_DEVKIT:
SPI.begin(SOC_GPIO_PIN_C6_SCK, SOC_GPIO_PIN_C6_MISO,
SOC_GPIO_PIN_C6_MOSI, SOC_GPIO_PIN_C6_SS);
break;
default:
SPI.begin(SOC_GPIO_PIN_SCK, SOC_GPIO_PIN_MISO,
SOC_GPIO_PIN_MOSI, SOC_GPIO_PIN_SS);
Expand Down Expand Up @@ -2931,6 +2966,10 @@ static void ESP32_swSer_begin(unsigned long baud)
Serial_GNSS_In.begin(115200, SERIAL_IN_BITS,
SOC_GPIO_PIN_HELTRK_GNSS_RX,
SOC_GPIO_PIN_HELTRK_GNSS_TX);
} else if (esp32_board == ESP32_C6_DEVKIT) {
Serial.println(F("INFO: ESP32-C6 DevKit is detected."));
Serial_GNSS_In.begin(baud, SERIAL_IN_BITS,
SOC_GPIO_PIN_C6_GNSS_RX, SOC_GPIO_PIN_C6_GNSS_TX);
} else {
/* open Standalone's GNSS port */
Serial_GNSS_In.begin(baud, SERIAL_IN_BITS,
Expand Down Expand Up @@ -3761,7 +3800,7 @@ static float ESP32_Battery_param(uint8_t param)
(esp32_board == ESP32_TTGO_V2_OLED && hw_info.revision == 16) ||
esp32_board == ESP32_S2_T8_V1_1) {
voltage += voltage;
} else if (esp32_board == ESP32_C3_DEVKIT) {
} else if (esp32_board == ESP32_C3_DEVKIT || esp32_board == ESP32_C6_DEVKIT) {
/* NodeMCU has voltage divider 100k/220k on board */
voltage *= 3.2;
} else if (esp32_board == ESP32_HELTEC_TRACKER) {
Expand Down Expand Up @@ -3821,6 +3860,10 @@ static bool ESP32_Baro_setup()

Wire.setPins(SOC_GPIO_PIN_HELTRK_SDA, SOC_GPIO_PIN_HELTRK_SCL);

} else if (esp32_board == ESP32_C6_DEVKIT) {

Wire.setPins(SOC_GPIO_PIN_C6_SDA, SOC_GPIO_PIN_C6_SCL);

} else if (hw_info.model != SOFTRF_MODEL_PRIME_MK2) {

if ((hw_info.rf != RF_IC_SX1276 && hw_info.rf != RF_IC_SX1262) ||
Expand Down
12 changes: 11 additions & 1 deletion software/firmware/source/SoftRF/src/platform/ESP32.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,11 @@
*/
#if !defined(CONFIG_IDF_TARGET_ESP32C6)
#define USE_NEOPIXELBUS_LIBRARY
#else
#define EXCLUDE_LED_RING
#endif /* CONFIG_IDF_TARGET_ESP32C6 */

#if !defined(EXCLUDE_LED_RING)
#if defined(USE_NEOPIXELBUS_LIBRARY)
#include <NeoPixelBus.h>

Expand All @@ -107,6 +110,7 @@ extern NeoPixelBus<NeoGrbFeature, Neo800KbpsMethod> strip;

extern Adafruit_NeoPixel strip;
#endif /* USE_NEOPIXELBUS_LIBRARY */
#endif /* EXCLUDE_LED_RING */

#define LEDC_CHANNEL_BUZZER 0
#define BACKLIGHT_CHANNEL ((uint8_t)1)
Expand Down Expand Up @@ -281,6 +285,10 @@ struct rst_info {
#define ST_ID 0x20
#define XMC_XM25QH32B 0x4016

/* Zbit Semiconductor, Inc. */
#define ZBIT_ID 0x5E
#define ZBIT_ZB25VQ32B 0x4016

#define MakeFlashId(v,d) ((v << 16) | d)

#define MPU6886_REG_PWR_MGMT_1 (0x6B)
Expand Down Expand Up @@ -379,7 +387,9 @@ extern const USB_Device_List_t supported_USB_devices[];
#undef USE_OLED
#undef USE_TFT
#if defined(CONFIG_IDF_TARGET_ESP32C6)
#define EXCLUDE_LED_RING
#define EXCLUDE_EGM96
#define EXCLUDE_TEST_MODE
#undef USE_NMEALIB
#endif /* C6 */
#endif /* CONFIG_IDF_TARGET_ESP32SX | C3 | C6 */
#else
Expand Down
4 changes: 3 additions & 1 deletion software/firmware/source/SoftRF/src/ui/Web.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1257,11 +1257,13 @@ void Web_setup()
yield();
});

/* FLASH memory usage optimization */
#if !defined(ARDUINO_ARCH_RP2040) && !defined(CONFIG_IDF_TARGET_ESP32C6)
server.on ( "/logo.png", []() {
server.send_P ( 200, "image/png", Logo, sizeof(Logo) );
} );
#endif /* ARDUINO_ARCH_RP2040 CONFIG_IDF_TARGET_ESP32C6 */

/* FLASH memory usage optimization */
#if !defined(ARDUINO_ARCH_RP2040)
server.on ( "/jquery.min.js", []() {

Expand Down

0 comments on commit 36e07dd

Please sign in to comment.