Skip to content

Commit a922426

Browse files
sergiotomaselloigrr
authored andcommitted
Arduino boards with ESP8266 (#3121)
default crystal freq 26M for all boards, 40M for arduino
1 parent a01638f commit a922426

File tree

5 files changed

+155
-4
lines changed

5 files changed

+155
-4
lines changed

boards.txt

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
menu.BoardModel=Model
12
menu.UploadSpeed=Upload Speed
23
menu.CpuFrequency=CPU Frequency
4+
menu.CrystalFreq=Crystal Frequency
35
menu.FlashSize=Flash Size
46
menu.FlashMode=Flash Mode
57
menu.FlashFreq=Flash Frequency
@@ -1892,3 +1894,71 @@ coredev.menu.DebugLevel.OTA2____=OTA + Updater
18921894
coredev.menu.DebugLevel.OTA2____.build.debug_level=-DDEBUG_ESP_OTA -DDEBUG_ESP_UPDATER
18931895
coredev.menu.DebugLevel.all_____=All
18941896
coredev.menu.DebugLevel.all_____.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_TLS_MEM
1897+
1898+
############ Arduino boards with Esp8266 ############
1899+
1900+
arduino-esp8266.name=Arduino
1901+
1902+
arduino-esp8266.upload.tool=esptool
1903+
arduino-esp8266.upload.speed=9600
1904+
arduino-esp8266.upload.resetmethod=ck
1905+
arduino-esp8266.upload.maximum_size=1044464
1906+
arduino-esp8266.upload.maximum_data_size=81920
1907+
arduino-esp8266.upload.wait_for_upload_port=true
1908+
arduino-esp8266.serial.disableDTR=true
1909+
arduino-esp8266.serial.disableRTS=true
1910+
1911+
arduino-esp8266.build.mcu=esp8266
1912+
arduino-esp8266.build.f_cpu=80000000L
1913+
#arduino-esp8266.build.f_crystal=40000000
1914+
arduino-esp8266.build.core=esp8266
1915+
arduino-esp8266.build.flash_mode=qio
1916+
arduino-esp8266.build.flash_size=4M
1917+
arduino-esp8266.build.flash_freq=40
1918+
arduino-esp8266.build.debug_port=
1919+
arduino-esp8266.build.debug_level=
1920+
arduino-esp8266.build.board=ESP8266_ARDUINO
1921+
1922+
arduino-esp8266.menu.BoardModel.starottodeved=Star OTTO
1923+
arduino-esp8266.menu.BoardModel.starottodeved.build.board=ESP8266_ARDUINO_STAR_OTTO
1924+
arduino-esp8266.menu.BoardModel.starottodeved.build.variant=arduino_uart
1925+
arduino-esp8266.menu.BoardModel.starottodeved.build.extra_flags=-DF_CRYSTAL=40000000
1926+
1927+
arduino-esp8266.menu.BoardModel.primo=Primo
1928+
arduino-esp8266.menu.BoardModel.primo.build.board=ESP8266_ARDUINO_PRIMO
1929+
arduino-esp8266.menu.BoardModel.primo.build.variant=arduino_spi
1930+
arduino-esp8266.menu.BoardModel.primo.build.extra_flags=-DF_CRYSTAL=40000000
1931+
1932+
arduino-esp8266.menu.BoardModel.unowifideved=Uno WiFi
1933+
arduino-esp8266.menu.BoardModel.unowifideved.build.board=ESP8266_ARDUINO_UNOWIFI
1934+
arduino-esp8266.menu.BoardModel.unowifideved.build.variant=arduino_uart
1935+
arduino-esp8266.menu.BoardModel.unowifideved.build.extra_flags=-DF_CRYSTAL=40000000
1936+
1937+
arduino-esp8266.menu.UploadSpeed.9600=9600
1938+
arduino-esp8266.menu.UploadSpeed.9600.upload.speed=9600
1939+
arduino-esp8266.menu.UploadSpeed.19200=19200
1940+
arduino-esp8266.menu.UploadSpeed.19200.upload.speed=19200
1941+
arduino-esp8266.menu.UploadSpeed.57600=57600
1942+
arduino-esp8266.menu.UploadSpeed.57600.upload.speed=57600
1943+
arduino-esp8266.menu.UploadSpeed.115200=115200
1944+
arduino-esp8266.menu.UploadSpeed.115200.upload.speed=115200
1945+
arduino-esp8266.menu.UploadSpeed.230400=230400
1946+
arduino-esp8266.menu.UploadSpeed.230400.upload.speed=230400
1947+
arduino-esp8266.menu.UploadSpeed.460800=460800
1948+
arduino-esp8266.menu.UploadSpeed.460800.upload.speed=460800
1949+
1950+
arduino-esp8266.menu.FlashSize.4M1M=4M (1M SPIFFS)
1951+
arduino-esp8266.menu.FlashSize.4M1M.build.flash_size=4M
1952+
arduino-esp8266.menu.FlashSize.4M1M.build.flash_ld=eagle.flash.4m1m.ld
1953+
arduino-esp8266.menu.FlashSize.4M1M.build.spiffs_start=0x300000
1954+
arduino-esp8266.menu.FlashSize.4M1M.build.spiffs_end=0x3FB000
1955+
arduino-esp8266.menu.FlashSize.4M1M.build.spiffs_blocksize=8192
1956+
arduino-esp8266.menu.FlashSize.4M1M.build.spiffs_pagesize=256
1957+
1958+
arduino-esp8266.menu.FlashSize.4M3M=4M (3M SPIFFS)
1959+
arduino-esp8266.menu.FlashSize.4M3M.build.flash_size=4M
1960+
arduino-esp8266.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
1961+
arduino-esp8266.menu.FlashSize.4M3M.build.spiffs_start=0x100000
1962+
arduino-esp8266.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
1963+
arduino-esp8266.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
1964+
arduino-esp8266.menu.FlashSize.4M3M.build.spiffs_pagesize=256

cores/esp8266/core_esp8266_phy.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,11 @@ static const uint8_t ICACHE_FLASH_ATTR phy_init_data[128] =
8888
// 0: 40MHz
8989
// 1: 26MHz
9090
// 2: 24MHz
91-
[48] = 1,
91+
#if F_CRYSTAL == 40000000
92+
[48] = 0,
93+
#else
94+
[48] = 1,
95+
#endif
9296

9397

9498

@@ -312,4 +316,3 @@ void user_rf_pre_init()
312316

313317

314318
void ICACHE_RAM_ATTR user_spi_flash_dio_to_qio_pre_init() {}
315-

platform.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ compiler.c.flags=-c {compiler.warning_flags} -Os -g -Wpointer-arith -Wno-implici
3131
compiler.S.cmd=xtensa-lx106-elf-gcc
3232
compiler.S.flags=-c -g -x assembler-with-cpp -MMD -mlongcalls
3333

34-
compiler.c.elf.flags=-g {compiler.warning_flags} -Os -nostdlib -Wl,--no-check-sections -u call_user_start -u _printf_float -u _scanf_float -Wl,-static "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" "-L{compiler.libc.path}/lib" "-T{build.flash_ld}" -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,spi_flash_read
34+
compiler.c.elf.flags=-g {compiler.warning_flags} -Os -nostdlib -Wl,--no-check-sections -u call_user_start -u _printf_float -u _scanf_float -Wl,-static "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" "-L{compiler.libc.path}/lib" "-T{build.flash_ld}" -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,spi_flash_read
3535

3636
compiler.c.elf.cmd=xtensa-lx106-elf-gcc
37-
compiler.c.elf.libs=-lhal -lphy -lpp -lnet80211 {build.lwip_lib} -lwpa -lcrypto -lmain -lwps -laxtls -lespnow -lsmartconfig -lmesh -lwpa2 -lstdc++ -lm -lc -lgcc
37+
compiler.c.elf.libs=-lhal -lphy -lpp -lnet80211 {build.lwip_lib} -lwpa -lcrypto -lmain -lwps -laxtls -lespnow -lsmartconfig -lmesh -lwpa2 -lstdc++ -lm -lc -lgcc
3838

3939
compiler.cpp.cmd=xtensa-lx106-elf-g++
4040
compiler.cpp.flags=-c {compiler.warning_flags} -Os -g -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -MMD -ffunction-sections -fdata-sections

variants/arduino_spi/pins_arduino.h

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
pins_arduino.h - Pin definition functions for Arduino
3+
Part of Arduino - http://www.arduino.cc/
4+
5+
Copyright (c) 2007 David A. Mellis
6+
Modified for ESP8266 platform by Ivan Grokhotkov, 2014-2015.
7+
8+
This library is free software; you can redistribute it and/or
9+
modify it under the terms of the GNU Lesser General Public
10+
License as published by the Free Software Foundation; either
11+
version 2.1 of the License, or (at your option) any later version.
12+
13+
This library is distributed in the hope that it will be useful,
14+
but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16+
Lesser General Public License for more details.
17+
18+
You should have received a copy of the GNU Lesser General
19+
Public License along with this library; if not, write to the
20+
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
21+
Boston, MA 02111-1307 USA
22+
23+
$Id: wiring.h 249 2007-02-03 16:52:51Z mellis $
24+
*/
25+
26+
/*
27+
Modified 23 March 2017
28+
by Sergio Tomasello and Andrea Cannistrá
29+
*/
30+
31+
#ifndef Pins_Arduino_h
32+
#define Pins_Arduino_h
33+
34+
#include "../generic/common.h"
35+
36+
static const uint8_t LED_BUILTIN = 2;
37+
static const uint8_t BUILTIN_LED = 2;
38+
39+
#endif /* Pins_Arduino_h */

variants/arduino_uart/pins_arduino.h

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
pins_arduino.h - Pin definition functions for Arduino
3+
Part of Arduino - http://www.arduino.cc/
4+
5+
Copyright (c) 2007 David A. Mellis
6+
Modified for ESP8266 platform by Ivan Grokhotkov, 2014-2015.
7+
8+
This library is free software; you can redistribute it and/or
9+
modify it under the terms of the GNU Lesser General Public
10+
License as published by the Free Software Foundation; either
11+
version 2.1 of the License, or (at your option) any later version.
12+
13+
This library is distributed in the hope that it will be useful,
14+
but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16+
Lesser General Public License for more details.
17+
18+
You should have received a copy of the GNU Lesser General
19+
Public License along with this library; if not, write to the
20+
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
21+
Boston, MA 02111-1307 USA
22+
23+
$Id: wiring.h 249 2007-02-03 16:52:51Z mellis $
24+
*/
25+
26+
/*
27+
Modified 23 March 2017
28+
by Sergio Tomasello and Andrea Cannistrá
29+
*/
30+
31+
#ifndef Pins_Arduino_h
32+
#define Pins_Arduino_h
33+
34+
#include "../generic/common.h"
35+
36+
static const uint8_t LED_BUILTIN = 14;
37+
static const uint8_t BUILTIN_LED = 14;
38+
39+
#endif /* Pins_Arduino_h */

0 commit comments

Comments
 (0)