Skip to content

Commit

Permalink
Fix esp8266 'no network' build of HostTests (#2702)
Browse files Browse the repository at this point in the history
Implementations of `system_get_sdk_version()` and `system_get_chip_id()` required.
  • Loading branch information
mikee47 authored Jan 10, 2024
1 parent 49c9aa5 commit 2233b3d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Sming/Arch/Esp8266/Components/esp_no_wifi/component.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ EXTRA_OBJ := extra.o
$(COMPONENT_RULE)$(EXTRA_OBJ): sdk/user_interface.o
$(Q) $(OBJCOPY) \
-j *UND* \
-j .sdk.version.* \
$(addprefix -j .text.,$(NOWIFI_SYMS)) \
$(foreach f,$(NOWIFI_SYMS),--rename-section .text.$f=.iram.text) \
$< $@
Expand All @@ -40,7 +41,10 @@ endef
LIBMAIN_COMMANDS += $(NOWIFI_LIBMAIN_COMMANDS)

LIBDIRS += $(COMPONENT_PATH)
EXTRA_LDFLAGS := -Tno.wifi.ld -u call_user_start_local
EXTRA_LDFLAGS := \
-Tno.wifi.ld \
-u call_user_start_local \
-u SDK_VERSION

##

Expand Down
13 changes: 13 additions & 0 deletions Sming/Arch/Esp8266/Components/esp_no_wifi/user_interface.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <esp_systemapi.h>
#include <spi_flash.h>
#include <eagle_soc.h>
#include <esp8266_peri.h>

bool protect_flag;
bool timer2_ms_flag;
Expand Down Expand Up @@ -337,3 +338,15 @@ int os_printf_plus(const char* format, ...)

return n;
}

const char* system_get_sdk_version()
{
extern char SDK_VERSION[];
return SDK_VERSION;
}

uint32_t system_get_chip_id()
{
// from chip_id() method in esptool.py
return (MAC0 >> 24) | ((MAC1 & 0x00ffffff) << 8);
}

0 comments on commit 2233b3d

Please sign in to comment.