diff --git a/cpu/esp8266/Makefile.include b/cpu/esp8266/Makefile.include index b4a134cc0c..43f185b040 100644 --- a/cpu/esp8266/Makefile.include +++ b/cpu/esp8266/Makefile.include @@ -54,6 +54,14 @@ ifneq (, $(filter littlefs, $(USEMODULE))) export RIOT_TEST_TIMEOUT = 200 endif +ifneq (,$(filter log_color,$(USEMODULE))) + USEMODULE += esp_log_colored +endif + +ifneq (,$(filter 4 5,$(LOG_LEVEL))) + USEMODULE += esp_log_startup +endif + # regular Makefile export TARGET_ARCH ?= xtensa-esp8266-elf @@ -62,6 +70,7 @@ export TARGET_ARCH ?= xtensa-esp8266-elf PSEUDOMODULES += esp_gdb PSEUDOMODULES += esp_log_colored PSEUDOMODULES += esp_log_tagged +PSEUDOMODULES += esp_log_startup PSEUDOMODULES += esp_qemu PSEUDOMODULES += esp_sw_timer PSEUDOMODULES += esp_spiffs @@ -204,16 +213,20 @@ PREFFLAGS += ls -l $(FLASHFILE).bin | awk '{ print $$5 }' >> $(BINDIR)/partition PREFFLAGS += python $(RIOTCPU)/$(CPU)/vendor/esp-idf/partition_table/gen_esp32part.py PREFFLAGS += --verify $(BINDIR)/partitions.csv $(BINDIR)/partitions.bin -ifneq (, $(filter esp_log_colored, $(USEMODULE))) - BOOTLOADER ?= bootloader_dout_115200_color.bin -else - BOOTLOADER ?= bootloader_dout_115200_no_color.bin +ifneq (,$(filter esp_log_colored,$(USEMODULE))) + BOOTLOADER_COLOR = _colors endif +ifneq (,$(filter esp_log_startup,$(USEMODULE))) + BOOTLOADER_INFO = _info +endif + +BOOTLOADER_BIN = bootloader$(BOOTLOADER_COLOR)$(BOOTLOADER_INFO).bin + ifneq (, $(filter esp_qemu, $(USEMODULE))) FLASHER = dd FFLAGS += if=/dev/zero bs=1M count=1 | tr "\\000" "\\377" > tmp.bin && - FFLAGS += cat $(RIOTCPU)/$(CPU)/bin/$(BOOTLOADER) tmp.bin | + FFLAGS += cat $(RIOTCPU)/$(CPU)/bin/$(BOOTLOADER_BIN) tmp.bin | FFLAGS += head -c $$((0x8000)) | FFLAGS += cat - $(BINDIR)/partitions.bin tmp.bin | FFLAGS += head -c $$((0x10000)) | @@ -228,7 +241,7 @@ else FFLAGS += --before default_reset write_flash -z FFLAGS += --flash_size detect FFLAGS += --flash_mode $(FLASH_MODE) --flash_freq $(FLASH_FREQ) - FFLAGS += 0x0000 $(RIOTCPU)/$(CPU)/bin/$(BOOTLOADER) + FFLAGS += 0x0000 $(RIOTCPU)/$(CPU)/bin/$(BOOTLOADER_BIN) FFLAGS += 0x8000 $(BINDIR)/partitions.bin FFLAGS += 0x10000 $(FLASHFILE).bin endif diff --git a/cpu/esp8266/bin/bootloader.bin b/cpu/esp8266/bin/bootloader.bin new file mode 100644 index 0000000000..cc2a7be951 Binary files /dev/null and b/cpu/esp8266/bin/bootloader.bin differ diff --git a/cpu/esp8266/bin/bootloader_colors.bin b/cpu/esp8266/bin/bootloader_colors.bin new file mode 100644 index 0000000000..3c8557fbe6 Binary files /dev/null and b/cpu/esp8266/bin/bootloader_colors.bin differ diff --git a/cpu/esp8266/bin/bootloader_dout_115200_color.bin b/cpu/esp8266/bin/bootloader_colors_info.bin similarity index 100% rename from cpu/esp8266/bin/bootloader_dout_115200_color.bin rename to cpu/esp8266/bin/bootloader_colors_info.bin diff --git a/cpu/esp8266/bin/bootloader_dout_115200_no_color.bin b/cpu/esp8266/bin/bootloader_info.bin similarity index 100% rename from cpu/esp8266/bin/bootloader_dout_115200_no_color.bin rename to cpu/esp8266/bin/bootloader_info.bin diff --git a/cpu/esp8266/periph/flash.c b/cpu/esp8266/periph/flash.c index 8df422ea43..c39ea75fb1 100644 --- a/cpu/esp8266/periph/flash.c +++ b/cpu/esp8266/periph/flash.c @@ -183,8 +183,8 @@ void spi_flash_drive_init (void) _flash_end = _flashchip->chip_size - 5 * _flashchip->sector_size; _flash_size = _flash_end - _flash_beg; /* MUST be at least 3 sectors (0x3000) */ - LOG_TAG_INFO("spi_flash", "MTD in SPI flash starts at address 0x%08x " - "with a size of %d kbytes\n", _flash_beg, _flash_size >> 10); + LOG_TAG_DEBUG("spi_flash", "MTD in SPI flash starts at address 0x%08x " + "with a size of %d kbytes\n", _flash_beg, _flash_size >> 10); _flash_dev.driver = &_flash_driver; _flash_dev.sector_count = _flash_size / _flashchip->sector_size; diff --git a/cpu/esp8266/startup.c b/cpu/esp8266/startup.c index a1649b595e..31534dcd82 100644 --- a/cpu/esp8266/startup.c +++ b/cpu/esp8266/startup.c @@ -67,12 +67,14 @@ void esp_riot_init(void) } ets_printf("\n"); +#ifdef MODULE_ESP_LOG_STARTUP ets_printf("Starting ESP8266 CPU with ID: %08x\n", system_get_chip_id()); ets_printf("ESP8266-RTOS-SDK Version %s\n\n", system_get_sdk_version()); ets_printf("CPU clock frequency: %d MHz\n", system_get_cpu_freq()); extern void heap_stats(void); heap_stats(); ets_printf("\n"); +#endif /* set exception handlers */ init_exceptions (); @@ -102,8 +104,10 @@ void esp_riot_init(void) /* trigger board initialization */ board_init(); +#ifdef MODULE_ESP_LOG_STARTUP /* print the board config */ board_print_config(); +#endif /* initialize ESP system event loop */ extern void esp_event_handler_init(void);