Skip to content

Add board "WEMOS D1 MINI ESP32". #2710

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

Merged
merged 4 commits into from
Apr 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3648,4 +3648,73 @@ ttgo-t-watch.menu.DebugLevel.verbose.build.code_debug=5

##############################################################

d1_mini32.name=WEMOS D1 MINI ESP32

d1_mini32.upload.tool=esptool_py
d1_mini32.upload.maximum_size=1310720
d1_mini32.upload.maximum_data_size=327680
d1_mini32.upload.wait_for_upload_port=true

d1_mini32.serial.disableDTR=true
d1_mini32.serial.disableRTS=true

d1_mini32.build.mcu=esp32
d1_mini32.build.core=esp32
d1_mini32.build.variant=d1_mini32
d1_mini32.build.board=D1_MINI32

d1_mini32.build.f_cpu=240000000L
d1_mini32.build.flash_mode=dio
d1_mini32.build.flash_size=4MB
d1_mini32.build.boot=dio
d1_mini32.build.partitions=default
d1_mini32.build.defines=

d1_mini32.menu.FlashFreq.80=80MHz
d1_mini32.menu.FlashFreq.80.build.flash_freq=80m
d1_mini32.menu.FlashFreq.40=40MHz
d1_mini32.menu.FlashFreq.40.build.flash_freq=40m

d1_mini32.menu.PartitionScheme.default=Default
d1_mini32.menu.PartitionScheme.default.build.partitions=default
d1_mini32.menu.PartitionScheme.no_ota=No OTA (Large APP)
d1_mini32.menu.PartitionScheme.no_ota.build.partitions=no_ota
d1_mini32.menu.PartitionScheme.no_ota.upload.maximum_size=2097152
d1_mini32.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA)
d1_mini32.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs
d1_mini32.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080

d1_mini32.menu.CPUFreq.240=240MHz (WiFi/BT)
d1_mini32.menu.CPUFreq.240.build.f_cpu=240000000L
d1_mini32.menu.CPUFreq.160=160MHz (WiFi/BT)
d1_mini32.menu.CPUFreq.160.build.f_cpu=160000000L
d1_mini32.menu.CPUFreq.80=80MHz (WiFi/BT)
d1_mini32.menu.CPUFreq.80.build.f_cpu=80000000L
d1_mini32.menu.CPUFreq.40=40MHz (40MHz XTAL)
d1_mini32.menu.CPUFreq.40.build.f_cpu=40000000L
d1_mini32.menu.CPUFreq.26=26MHz (26MHz XTAL)
d1_mini32.menu.CPUFreq.26.build.f_cpu=26000000L
d1_mini32.menu.CPUFreq.20=20MHz (40MHz XTAL)
d1_mini32.menu.CPUFreq.20.build.f_cpu=20000000L
d1_mini32.menu.CPUFreq.13=13MHz (26MHz XTAL)
d1_mini32.menu.CPUFreq.13.build.f_cpu=13000000L
d1_mini32.menu.CPUFreq.10=10MHz (40MHz XTAL)
d1_mini32.menu.CPUFreq.10.build.f_cpu=10000000L

d1_mini32.menu.UploadSpeed.921600=921600
d1_mini32.menu.UploadSpeed.921600.upload.speed=921600
d1_mini32.menu.UploadSpeed.115200=115200
d1_mini32.menu.UploadSpeed.115200.upload.speed=115200
d1_mini32.menu.UploadSpeed.256000.windows=256000
d1_mini32.menu.UploadSpeed.256000.upload.speed=256000
d1_mini32.menu.UploadSpeed.230400.windows.upload.speed=256000
d1_mini32.menu.UploadSpeed.230400=230400
d1_mini32.menu.UploadSpeed.230400.upload.speed=230400
d1_mini32.menu.UploadSpeed.460800.linux=460800
d1_mini32.menu.UploadSpeed.460800.macosx=460800
d1_mini32.menu.UploadSpeed.460800.upload.speed=460800
d1_mini32.menu.UploadSpeed.512000.windows=512000
d1_mini32.menu.UploadSpeed.512000.upload.speed=512000

##############################################################

3 changes: 3 additions & 0 deletions package/package_esp32_index.template.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
},
{
"name": "WEMOS LoLin32"
},
{
"name": "WEMOS D1 MINI ESP32"
}
],
"toolsDependencies": [
Expand Down
33 changes: 33 additions & 0 deletions variants/d1_mini32/pins_arduino.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#ifndef Pins_Arduino_h
#define Pins_Arduino_h

#include <stdint.h>
#include <../d32/d32_core.h>

static const uint8_t LED_BUILTIN = 2;
#define BUILTIN_LED LED_BUILTIN // backward compatibility
static const uint8_t _VBAT = 35; // battery voltage

#define PIN_WIRE_SDA SDA // backward compatibility
#define PIN_WIRE_SCL SCL // backward compatibility

static const uint8_t D0 = 26;
static const uint8_t D1 = 22;
static const uint8_t D2 = 21;
static const uint8_t D3 = 17;
static const uint8_t D4 = 16;
static const uint8_t D5 = 18;
static const uint8_t D6 = 19;
static const uint8_t D7 = 23;
static const uint8_t D8 = 5;
static const uint8_t RXD = 3;
static const uint8_t TXD = 1;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't remember where I found pin numbers 9 and 10 for RXD0/TXD0 - RX and TX are in d32_core.h already. I am unsuccessful in redirecting Serial to vacate 3 and 1, in order to use EspSoftwareSerial for the USB logging port, and have all three HW UARTs freely available. Is this not supported, to redirect the pin assignment of Serial?

Copy link
Member

@me-no-dev me-no-dev Apr 27, 2019

Choose a reason for hiding this comment

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

if you make them to be defines, they will overwrite the default pins for the UARTs:

//this will make Serial1.begin(baud) to run on pins 21 and 22
//add RX2/TX2 to overwrite Serial2
#define RX1 21
#define TX1 22

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, thank you for explaining, I understand that from reading the code in HardwareSerial.(h|cpp) and esp32-hal-uart.(h|cpp).
But: the code suggests that Serial (0) can be redirected from 3 (RX) and 1 (TX), for the love of it, I can't that to work. Is the UART0 somehow hardwired to these ports and cannot be redirected, even if the code tries to, and fails silently?
As far as the PR is concerned, I've completed it, would you merge it now as it is?

Copy link
Member

Choose a reason for hiding this comment

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

if you want to run Serial on other pins, you really need to specify them in Serial.begin
RX and TX are hardcoded to 1 and 3 otherwise as that is the real Serial port (like AVR arduinos and such)


#define PIN_SPI_SS SS // backward compatibility
#define PIN_SPI_MOSI MOSI // backward compatibility
#define PIN_SPI_MISO MISO // backward compatibility
#define PIN_SPI_SCK SCK // backward compatibility

#define PIN_A0 A0 // backward compatibility

#endif /* Pins_Arduino_h */