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

Add Olimex ESP32 Gateway #583

Merged
merged 15 commits into from Nov 30, 2022
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/build.yaml
Expand Up @@ -64,6 +64,9 @@ jobs:
# mh et esp32 mini kit
- target: "d1_mini_mhetesp32minikit"
chip: "esp32"
# Olimex ESP32 Gateway
target: "olimex_esp32_gw"
forkineye marked this conversation as resolved.
Show resolved Hide resolved
chip: "esp32"
# Twilight Lord
- target: "d1_mini_twilightlord"
chip: "esp32"
Expand Down
4 changes: 3 additions & 1 deletion ESPixelStick/src/GPIO_Defs.hpp
Expand Up @@ -90,7 +90,9 @@ typedef enum
# include "platformDefinitions/GPIO_Defs_ESP32_MH_ET_LIVE_MiniKit.hpp"
#elif defined (BOARD_ESP32_QUINLED_DIG_OCTA)
# include "platformDefinitions/GPIO_Defs_ESP32_QUINLED_Dig-Octa.hpp"
#elif defined (BOARD_ESP32_QUINLED_QUAD_ETH)
#elif defined (BOARD_ESP32_OLIMEX_GATEWAY)
# include "platformDefinitions/GPIO_Defs_ESP32_Olimex_Gateway.hpp"
#elif defined(BOARD_ESP32_QUINLED_QUAD_ETH)
# include "platformDefinitions/GPIO_Defs_ESP32_QUINLED_QUAD_ETH.hpp"
#elif defined (BOARD_ESP32_QUINLED_QUAD_AE_PLUS)
# include "platformDefinitions/GPIO_Defs_ESP32_QUINLED_QUAD_AE_Plus.hpp"
Expand Down
@@ -0,0 +1,106 @@
#pragma once
/*
* GPIO_Defs_ESP32_Olimex_Gateway.hpp - Output Management class
*
* Project: ESPixelStick - An ESP8266 / ESP32 and E1.31 based pixel driver
* Copyright (c) 2021 Shelby Merrick
* http://www.forkineye.com
*
* This program is provided free for you to use in any way that you wish,
* subject to the laws and regulations where you are using it. Due diligence
* is strongly suggested before using this code. Please give credit where due.
*
* The Author makes no warranty of any kind, express or implied, with regard
* to this program or the documentation contained in this document. The
* Author shall not be liable in any event for incidental or consequential
* damages in connection with, or arising out of, the furnishing, performance
* or use of these programs.
*
*/

/*
* Pinout for Olimex ESP32-GATEWAY
* https://www.olimex.com/Products/IoT/ESP32/ESP32-GATEWAY/open-source-hardware
*/
#define SUPPORT_ETHERNET

//Output Manager
#define SUPPORT_UART_OUTPUT
#define DEFAULT_UART_1_GPIO gpio_num_t::GPIO_NUM_4 // Supposed to be SD Card, but R10 not populated
#define UART_LAST OutputChannelId_UART_1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This label is no longer used



#define SUPPORT_RMT_OUTPUT
#define DEFAULT_RMT_0_GPIO gpio_num_t::GPIO_NUM_12 // Tested working
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have removed the use of RMT channel 0 due to a conflict with the UDP processing (Root cause unknown at this time). Also, You should use as many UART channels as possible (in this case two) because they have far lower ISR processing loads.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved GPIO12 to UART 2

#define DEFAULT_RMT_1_GPIO gpio_num_t::GPIO_NUM_13 // Tested working
#define DEFAULT_RMT_2_GPIO gpio_num_t::GPIO_NUM_16 // Tested working
#define DEFAULT_RMT_3_GPIO gpio_num_t::GPIO_NUM_32 // Tested working
/*
Notes:
- Got exceptions and board resets when using either of GPIO_NUM_36 or GPIO_NUM_35
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GPIO 35 & 36 are input only. They cannot be used as outputs.

as an RMT output
- GPIOs 4, 12, 13 are for SD Card, but are not actually wired to the SD Card on
board rev G (resistors R10, R11, R9 are not populated on the board)
*/
// TODO: 39 is also available on the header, maybe also use 33 (LED output)
#define RMT_LAST OutputChannelId_RMT_4
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no longer used


// #define SUPPORT_OutputType_WS2801 // requires a change in the html directory
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Output type definitions have been moved to the end of the file. Please keep them consistent with the existing file layout. This makes future maintenance easier. I suggest taking a current version from another ethernet capable platform like the GPIO_Defs_ESP32_ESP3DEUXQuattro_DMX and adjusting it to your needs.

// #define SUPPORT_OutputType_APA102 // requires a change in the html directory
// #define SUPPORT_OutputType_TM1814 // requires a change in the html directory
// #define SUPPORT_OutputType_TLS3001 // requires a change in the html directory
#define SUPPORT_OutputType_WS2811 // UART / RMT

// #define SUPPORT_RELAY_OUTPUT

#if defined(SUPPORT_OutputType_WS2801) || defined(SUPPORT_OutputType_APA102)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic has been moved to the GPIO_Defs file

# define SUPPORT_SPI_OUTPUT

// SPI Output
#define SUPPORT_SPI_OUTPUT
#define DEFAULT_SPI_DATA_GPIO gpio_num_t::GPIO_NUM_15
#define DEFAULT_SPI_CLOCK_GPIO gpio_num_t::GPIO_NUM_25

#endif // defined(SUPPORT_OutputType_WS2801) || defined(SUPPORT_OutputType_TM1814)

// File Manager
// Have not been able to get the SD card working, yet.
// CS pin would be GPIO13, but is not connected (resistor R9 not populated); instead CS is pulled up through R2
#define SUPPORT_SD
#define SD_CARD_MISO_PIN gpio_num_t::GPIO_NUM_2
#define SD_CARD_MOSI_PIN gpio_num_t::GPIO_NUM_15
#define SD_CARD_CLK_PIN gpio_num_t::GPIO_NUM_14
#define SD_CARD_CS_PIN gpio_num_t::GPIO_NUM_NC

#include <ETH.h>

/*
* ETH_CLOCK_GPIO0_IN - default: external clock from crystal oscillator
* ETH_CLOCK_GPIO0_OUT - 50MHz clock from internal APLL output on GPIO0 - possibly an inverter is needed for LAN8720
* ETH_CLOCK_GPIO16_OUT - 50MHz clock from internal APLL output on GPIO16 - possibly an inverter is needed for LAN8720
* ETH_CLOCK_GPIO17_OUT - 50MHz clock from internal APLL inverted output on GPIO17 - tested with LAN8720
*/
#define DEFAULT_ETH_CLK_MODE eth_clock_mode_t::ETH_CLOCK_GPIO17_OUT

// Pin# of the enable signal for the external crystal oscillator (-1 to disable for internal APLL source)
// #define DEFAULT_ETH_POWER_PIN gpio_num_t(gpio_num_t::GPIO_NUM_NC)
#define DEFAULT_ETH_POWER_PIN gpio_num_t(gpio_num_t::GPIO_NUM_5)
#define DEFAULT_ETH_POWER_PIN_ACTIVE LOW

// Type of the Ethernet PHY (LAN8720 or TLK110)
#define DEFAULT_ETH_TYPE eth_phy_type_t::ETH_PHY_LAN8720

// I2C-address of Ethernet PHY (0 or 1 for LAN8720, 31 for TLK110)
#define ETH_ADDR_PHY_LAN8720 0
//#define ETH_ADDR_PHY_LAN8720 1
#define ETH_ADDR_PHY_TLK110 31
#define DEFAULT_ETH_ADDR ETH_ADDR_PHY_LAN8720
#define DEFAULT_ETH_TXEN gpio_num_t::GPIO_NUM_21
#define DEFAULT_ETH_TXD0 gpio_num_t::GPIO_NUM_19
#define DEFAULT_ETH_TXD1 gpio_num_t::GPIO_NUM_22
#define DEFAULT_ETH_CRSDV gpio_num_t::GPIO_NUM_27
#define DEFAULT_ETH_RXD0 gpio_num_t::GPIO_NUM_25
#define DEFAULT_ETH_RXD1 gpio_num_t::GPIO_NUM_26
#define DEFAULT_ETH_MDC_PIN gpio_num_t::GPIO_NUM_23
#define DEFAULT_ETH_MDIO_PIN gpio_num_t::GPIO_NUM_18

35 changes: 35 additions & 0 deletions dist/firmware/firmware.json
Expand Up @@ -83,6 +83,41 @@
"offset": "0x3B0000"
}
},
{
MartinMueller2003 marked this conversation as resolved.
Show resolved Hide resolved
"name": "Olimex ESP32 Gateway",
"description": "Olimex board with ESP32, Ethernet, SD slot, and GPIO headers",
"chip": "esp32",
"appbin": "esp32/olimex_esp32_gw-app.bin",
"esptool": {
"baudrate": "460800",
"options": "--before default_reset --after hard_reset",
"flashcmd": "write_flash -z"
},
"binfiles": [
{
"name": "esp32/olimex_esp32_gw-bootloader.bin",
"offset": "0x1000"
},
{
"name": "esp32/olimex_esp32_gw-partitions.bin",
"offset": "0x8000"
},
{
"name": "esp32/boot_app0.bin",
"offset": "0xe000"
},
{
"name": "esp32/olimex_esp32_gw-app.bin",
"offset": "0x10000"
}
],
"filesystem": {
"page": "256",
"block": "4096",
"size": "0x50000",
"offset": "0x3B0000"
}
},
{
"name": "D1 Mini32 ETH",
"description": "D1 ESP32 module with PSRAM support for DIY builds",
Expand Down
11 changes: 10 additions & 1 deletion platformio.ini
Expand Up @@ -4,7 +4,7 @@
; Local configuration should be done in platformio_user.ini

[platformio]
default_envs = espsv3, d1_mini, d32_pro, d32_pro_eth, esp32_cam, esp32_ttgo_t8, d1_mini32, d1_mini32_eth, esp32_wt32eth01, esp32_quinled_quad, esp32_quinled_quad_ae_plus, esp32_quinled_quad_eth, esp32_quinled_uno, esp32_quinled_uno_ae_plus, esp32_quinled_uno_eth, esp32_quinled_dig_octa, esp01s, d1_mini_mhetesp32minikit, d1_mini_twilightlord, d1_mini_twilightlord_eth, esp32_devkitc, esp32_quinled_uno_eth_espsv3, esp32_quinled_uno_espsv3, m5stack_atom, esp3deuxquatro_dmx
default_envs = espsv3, d1_mini, d32_pro, d32_pro_eth, esp32_cam, esp32_ttgo_t8, d1_mini32, d1_mini32_eth, esp32_wt32eth01, esp32_quinled_quad, esp32_quinled_quad_ae_plus, esp32_quinled_quad_eth, esp32_quinled_uno, esp32_quinled_uno_ae_plus, esp32_quinled_uno_eth, esp32_quinled_dig_octa, esp01s, d1_mini_mhetesp32minikit, olimex_esp32_gw, d1_mini_twilightlord, d1_mini_twilightlord_eth, esp32_devkitc, esp32_quinled_uno_eth_espsv3, esp32_quinled_uno_espsv3, m5stack_atom, esp3deuxquatro_dmx
src_dir = ./ESPixelStick
data_dir = ./ESPixelStick/data
build_cache_dir = ./.pio/.buildcache
Expand Down Expand Up @@ -323,6 +323,15 @@ build_flags =
${esp32git.build_flags}
-D BOARD_ESP32_QUINLED_UNO_ETH

; Olimex ESP32 Gateway
[env:olimex_esp32_gw]
extends = esp32git
board = esp32-gateway
build_flags =
${esp32git.build_flags}
; -D BOARD_ESP32_QUINLED_UNO_ETH
-D BOARD_ESP32_OLIMEX_GATEWAY

[env:d1_mini_twilightlord]
extends = esp32git
board = wemos_d1_mini32
Expand Down