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

Revert to nonos-sdk 2.2.1, new selection menu for generic board only #5763

Merged
merged 10 commits into from
Feb 19, 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
5 changes: 5 additions & 0 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ menu.vt=VTables
menu.exception=Exceptions
menu.led=Builtin Led
menu.wipe=Erase Flash
menu.sdk=Espressif FW

##############################################################
generic.name=Generic ESP8266 Module
Expand Down Expand Up @@ -349,6 +350,10 @@ generic.menu.led.14=14
generic.menu.led.14.build.led=-DLED_BUILTIN=14
generic.menu.led.15=15
generic.menu.led.15.build.led=-DLED_BUILTIN=15
generic.menu.sdk.nonosdk221=nonos-sdk 2.2.1
generic.menu.sdk.nonosdk221.build.sdk=NONOSDK221
generic.menu.sdk.nonosdk3v0=nonos-sdk pre-3
generic.menu.sdk.nonosdk3v0.build.sdk=NONOSDK3V0
generic.menu.ip.lm2f=v2 Lower Memory
generic.menu.ip.lm2f.build.lwip_include=lwip2/include
generic.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat
Expand Down
16 changes: 16 additions & 0 deletions libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,13 @@ int32_t ESP8266WiFiGenericClass::channel(void) {
* @param type sleep_type_t
* @return bool
*/
#ifdef NONOSDK221
bool ESP8266WiFiGenericClass::setSleepMode(WiFiSleepType_t type, uint8_t listenInterval) {
(void)type;
(void)listenInterval;
return false;
}
#else // !defined(NONOSDK221)
bool ESP8266WiFiGenericClass::setSleepMode(WiFiSleepType_t type, uint8_t listenInterval) {

/**
Expand Down Expand Up @@ -315,6 +322,7 @@ bool ESP8266WiFiGenericClass::setSleepMode(WiFiSleepType_t type, uint8_t listenI
}
return ret;
}
#endif // !defined(NONOSDK221)

/**
* get Sleep mode
Expand Down Expand Up @@ -499,15 +507,23 @@ bool ESP8266WiFiGenericClass::forceSleepWake() {
* @return interval
*/
uint8_t ESP8266WiFiGenericClass::getListenInterval () {
#ifdef NONOSDK221
return 0;
#else
return wifi_get_listen_interval();
#endif
}

/**
* Get sleep level of modem sleep and light sleep
* @return true if max level
*/
bool ESP8266WiFiGenericClass::isSleepLevelMax () {
#ifdef NONOSDK221
return false;
#else
return wifi_get_sleep_level() == MAX_SLEEP_T;
#endif
}


Expand Down
2 changes: 2 additions & 0 deletions libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ wl_status_t ESP8266WiFiSTAClass::begin(const char* ssid, const char *passphrase,
}

conf.threshold.rssi = -127;
#ifndef NONOSDK221
conf.open_and_wep_mode_disable = !(_useInsecureWEP || *conf.password == 0);
#endif

if(bssid) {
conf.bssid_set = 1;
Expand Down
10 changes: 6 additions & 4 deletions platform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ build.stdcpp_lib=-lstdc++

build.float=-u _printf_float -u _scanf_float
build.led=
build.sdk=NONOSDK221

compiler.path={runtime.tools.xtensa-lx106-elf-gcc.path}/bin/
compiler.sdk.path={runtime.platform.path}/tools/sdk

compiler.libc.path={runtime.platform.path}/tools/sdk/libc/xtensa-lx106-elf
compiler.cpreprocessor.flags=-D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-I{compiler.sdk.path}/include" "-I{compiler.sdk.path}/{build.lwip_include}" "-I{compiler.libc.path}/include" "-I{build.path}/core"

Expand All @@ -46,7 +48,7 @@ compiler.c.flags=-c {compiler.warning_flags} -Os -g -Wpointer-arith -Wno-implici
compiler.S.cmd=xtensa-lx106-elf-gcc
compiler.S.flags=-c -g -x assembler-with-cpp -MMD -mlongcalls

compiler.c.elf.flags=-g {compiler.warning_flags} -Os -nostdlib -Wl,--no-check-sections -u app_entry {build.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
compiler.c.elf.flags=-g {compiler.warning_flags} -Os -nostdlib -Wl,--no-check-sections -u app_entry {build.float} -Wl,-static "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/lib/{build.sdk}" "-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

compiler.c.elf.cmd=xtensa-lx106-elf-gcc
compiler.c.elf.libs=-lhal -lphy -lpp -lnet80211 {build.lwip_lib} -lwpa -lcrypto -lmain -lwps -lbearssl -laxtls -lespnow -lsmartconfig -lairkiss -lwpa2 {build.stdcpp_lib} -lm -lc -lgcc
Expand Down Expand Up @@ -88,13 +90,13 @@ recipe.hooks.core.prebuild.2.pattern="{runtime.tools.python}" "{runtime.tools.ma
recipe.hooks.linking.prelink.1.pattern="{compiler.path}{compiler.c.cmd}" -CC -E -P {build.vtable_flags} "{runtime.platform.path}/tools/sdk/ld/eagle.app.v6.common.ld.h" -o "{build.path}/local.eagle.app.v6.common.ld"

## Compile c files
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.c.flags} -DF_CPU={build.f_cpu} {build.lwip_flags} {build.debug_port} {build.debug_level} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" {build.led} {build.flash_flags} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.c.flags} -D{build.sdk}=1 -DF_CPU={build.f_cpu} {build.lwip_flags} {build.debug_port} {build.debug_level} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" {build.led} {build.flash_flags} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"

## Compile c++ files
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpreprocessor.flags} {compiler.cpp.flags} -DF_CPU={build.f_cpu} {build.lwip_flags} {build.debug_port} {build.debug_level} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" {build.led} {build.flash_flags} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpreprocessor.flags} {compiler.cpp.flags} -D{build.sdk}=1 -DF_CPU={build.f_cpu} {build.lwip_flags} {build.debug_port} {build.debug_level} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" {build.led} {build.flash_flags} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"

## Compile S files
recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.S.flags} -DF_CPU={build.f_cpu} {build.lwip_flags} {build.debug_port} {build.debug_level} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" {build.led} {build.flash_flags} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.S.flags} -D{build.sdk}=1 -DF_CPU={build.f_cpu} {build.lwip_flags} {build.debug_port} {build.debug_level} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" {build.led} {build.flash_flags} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"

## Create archives
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}"
Expand Down
1 change: 1 addition & 0 deletions tests/host/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ endif
FLAGS += $(DEBUG) -Wall -coverage $(OPTZ) -fno-common -g $(M32)
FLAGS += -DHTTPCLIENT_1_1_COMPATIBLE=0
FLAGS += -DLWIP_IPV6=0
FLAGS += -DNONOSDK221=1
FLAGS += $(MKFLAGS)
CXXFLAGS += -std=c++11 $(FLAGS)
CFLAGS += -std=c99 $(FLAGS)
Expand Down
29 changes: 22 additions & 7 deletions tools/boards.txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
'flashmode_menu',
'512K', '1M', '2M', '4M', '8M', '16M',
'led',
'sdk',
],
'desc': [ 'These modules come in different form factors and pinouts. See the page at ESP8266 community wiki for more info: `ESP8266 Module Family <http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family>`__.',
'',
Expand Down Expand Up @@ -1326,6 +1327,18 @@ def led (default,max):
]))
return { 'led': led }

################################################################
# sdk selection

def sdk ():
return { 'sdk': collections.OrderedDict([
('.menu.sdk.nonosdk221', 'nonos-sdk 2.2.1'),
('.menu.sdk.nonosdk221.build.sdk', 'NONOSDK221'),
('.menu.sdk.nonosdk3v0', 'nonos-sdk pre-3'),
('.menu.sdk.nonosdk3v0.build.sdk', 'NONOSDK3V0'),
])
}

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

def all_boards ():
Expand All @@ -1344,6 +1357,7 @@ def all_boards ():
macros.update(all_flash_map())
macros.update(all_debug())
macros.update(led(led_default, led_max))
macros.update(sdk())

print('#')
print('# Do not create pull-requests for this file only, CI will not accept them.')
Expand All @@ -1367,6 +1381,7 @@ def all_boards ():
print('menu.exception=Exceptions')
print('menu.led=Builtin Led')
print('menu.wipe=Erase Flash')
print('menu.sdk=Espressif FW')
print('')

for id in boards:
Expand Down Expand Up @@ -1498,12 +1513,12 @@ def usage (name,ret):
print("usage: %s [options]" % name)
print("")
print(" -h, --help")
print(" --lwip - preferred default lwIP version (default %d)" % lwip)
print(" --led - preferred default builtin led for generic boards (default %d)" % led_default)
print(" --board b - board to modify:")
print(" --speed s - change default serial speed")
print(" --customspeed s - new serial speed for all boards")
print(" --nofloat - disable float support in printf/scanf")
print(" --lwip - preferred default lwIP version (default %d)" % lwip)
print(" --led - preferred default builtin led for generic boards (default %d)" % led_default)
print(" --board <b> - board to modify:")
print(" --speed <s> - change default serial speed")
print(" --customspeed <s> - new serial speed for all boards")
print(" --nofloat - disable float support in printf/scanf")
print("")
print(" mandatory option (at least one):")
print("")
Expand Down Expand Up @@ -1610,7 +1625,7 @@ def usage (name,ret):
elif o in ("--noextra4kheap", "--allowWPS"):
print('option ' + o + ' is now deprecated, without effect, and will be removed')

elif o in ("--ldshow"):
elif o in ("--ld"):
ldshow = True

elif o in ("--ldgen"):
Expand Down
15 changes: 15 additions & 0 deletions tools/platformio-build.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,21 @@ def scons_patched_match_splitext(path, suffixes=None):

flatten_cppdefines = env.Flatten(env['CPPDEFINES'])

#
# SDK
#
if "PIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK3" in flatten_cppdefines:
env.Append(
CPPDEFINES=[("NONOSDK3V0", 1)],
LIBPATH=[join(FRAMEWORK_DIR, "tools", "sdk", "lib", "NONOSDK3V0"),]
)
# PIO_FRAMEWORK_ARDUINO_ESPRESSIF_SDK221 (default)
else:
env.Append(
CPPDEFINES=[("NONOSDK221", 1)],
LIBPATH=[join(FRAMEWORK_DIR, "tools", "sdk", "lib", "NONOSDK221"),]
)

#
# lwIP
#
Expand Down
180 changes: 0 additions & 180 deletions tools/sdk/include/at_custom.h

This file was deleted.

Loading