ESP8266 in crash loop - SDK v3.0

Stational
Posts: 41
Joined: Sat Jul 02, 2016 10:54 pm

ESP8266 in crash loop - SDK v3.0

Postby Stational » Fri Jan 25, 2019 5:08 pm

I installed crosstools-NG successfully after fixing some bugs (I had the same problems as this guy here: https://github.com/esp8266/esp8266-wiki/issues/74). After that I downloaded the latest SDK (v3.0) from GitHub like this:

Code: Select all

cd /opt/esp8266 &&
wget --no-check-certificate -O esp8266_nonos_sdk_v3.0.zip https://github.com/espressif/ESP8266_NONOS_SDK/archive/v3.0.zip &&
unzip esp8266_nonos_sdk_v3.0.zip 'ESP8266_NONOS_SDK-3.0/*' &&
mv ESP8266_NONOS_SDK-3.0 sdk &&
rm esp8266*


I am using this Makefile: https://github.com/esp8266/source-code- ... y/Makefile

I am a little confused by the fact that the compiler produces a 0x00000.bin and 0x10000.bin. I had to adjust FW_FILE_2_ADDR from 0x40000 to 0x10000 to make this work. I just recently found out that there are partitions since SDK v3.0.

I adpoted some of the partition-table code from this example: https://github.com/espressif/ESP8266_NO ... imple_pair

So basically my code looks like this now:

Code: Select all

#include "osapi.h"
#include "user_interface.h"

#define EAGLE_FLASH_BIN_ADDR            (SYSTEM_PARTITION_CUSTOMER_BEGIN + 1)
#define EAGLE_IROM0TEXT_BIN_ADDR         (SYSTEM_PARTITION_CUSTOMER_BEGIN + 2)
#define SPI_FLASH_SIZE_MAP 4

#if ((SPI_FLASH_SIZE_MAP == 0) || (SPI_FLASH_SIZE_MAP == 1))
#error "The flash map is not supported"
#elif (SPI_FLASH_SIZE_MAP == 2)
#define SYSTEM_PARTITION_OTA_SIZE                     0x6A000
#define SYSTEM_PARTITION_OTA_2_ADDR                     0x81000
#define SYSTEM_PARTITION_RF_CAL_ADDR                  0xfb000
#define SYSTEM_PARTITION_PHY_DATA_ADDR                  0xfc000
#define SYSTEM_PARTITION_SYSTEM_PARAMETER_ADDR            0xfd000
#elif (SPI_FLASH_SIZE_MAP == 3)
#define SYSTEM_PARTITION_OTA_SIZE                     0x6A000
#define SYSTEM_PARTITION_OTA_2_ADDR                     0x81000
#define SYSTEM_PARTITION_RF_CAL_ADDR                  0x1fb000
#define SYSTEM_PARTITION_PHY_DATA_ADDR                  0x1fc000
#define SYSTEM_PARTITION_SYSTEM_PARAMETER_ADDR            0x1fd000
#elif (SPI_FLASH_SIZE_MAP == 4)
#define SYSTEM_PARTITION_OTA_SIZE                     0x6A000
#define SYSTEM_PARTITION_OTA_2_ADDR                     0x81000
#define SYSTEM_PARTITION_RF_CAL_ADDR                  0x3fb000
#define SYSTEM_PARTITION_PHY_DATA_ADDR                  0x3fc000
#define SYSTEM_PARTITION_SYSTEM_PARAMETER_ADDR            0x3fd000
#elif (SPI_FLASH_SIZE_MAP == 5)
#define SYSTEM_PARTITION_OTA_SIZE                     0x6A000
#define SYSTEM_PARTITION_OTA_2_ADDR                     0x101000
#define SYSTEM_PARTITION_RF_CAL_ADDR                  0x1fb000
#define SYSTEM_PARTITION_PHY_DATA_ADDR                  0x1fc000
#define SYSTEM_PARTITION_SYSTEM_PARAMETER_ADDR            0x1fd000
#elif (SPI_FLASH_SIZE_MAP == 6)
#define SYSTEM_PARTITION_OTA_SIZE                     0x6A000
#define SYSTEM_PARTITION_OTA_2_ADDR                     0x101000
#define SYSTEM_PARTITION_RF_CAL_ADDR                  0x3fb000
#define SYSTEM_PARTITION_PHY_DATA_ADDR                  0x3fc000
#define SYSTEM_PARTITION_SYSTEM_PARAMETER_ADDR            0x3fd000
#else
#error "The flash map is not supported"
#endif

static const partition_item_t at_partition_table[] = {
   { SYSTEM_PARTITION_BOOTLOADER, 0x0, 0x1000 },
   { SYSTEM_PARTITION_OTA_1, 0x1000, SYSTEM_PARTITION_OTA_SIZE },
   { SYSTEM_PARTITION_OTA_2, SYSTEM_PARTITION_OTA_2, SYSTEM_PARTITION_OTA_SIZE },
   { SYSTEM_PARTITION_RF_CAL, SYSTEM_PARTITION_RF_CAL_ADDR, 0x1000 },
   { SYSTEM_PARTITION_PHY_DATA, SYSTEM_PARTITION_PHY_DATA_ADDR, 0x1000 },
   { SYSTEM_PARTITION_SYSTEM_PARAMETER, SYSTEM_PARTITION_SYSTEM_PARAMETER_ADDR, 0x3000 }
};

void ICACHE_FLASH_ATTR user_pre_init(void) {
   if(!system_partition_table_regist(at_partition_table, sizeof(at_partition_table) / sizeof(at_partition_table[0]), SPI_FLASH_SIZE_MAP)){
      os_printf("system_partition_table_regist fail\r\n");
      while(1);
   }
}

void ICACHE_FLASH_ATTR user_init(void) {
   
}


This is the console output:

Code: Select all

test@Device:/mnt/c/Users/Standardbenutzer/Documents/ESP8266/test2$ make
CC user/user_main.c
AR build/app_app.a
LD build/app.out
FW firmware/
esptool.py v2.6
Creating image for ESP8266...


After that I flashed 0x00000.bin to 0x0 and 0x10000.bin to 0x10000 (with NodeMCU Flash Tool).

Unfortunately my ESP8266 keeps crashing and restarting itself with this message (always the same):

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x3ffe8000, len 1288, room 16
tail 8
chksum 0x4a
load 0x3ffe8510, len 880, room 0
tail 0
chksum 0xb7
load 0x40100000, len 26184, room 8
tail 0
chksum 0xb3
csum 0xb3
>> 0x0,0x0rf_cal[0] !=0x05,is 0xE9



Does anyone know what I am doing wrong?

Her Majesty
Posts: 366
Joined: Mon Oct 27, 2014 11:09 am

Re: ESP8266 in crash loop - SDK v3.0

Postby Her Majesty » Tue Jan 29, 2019 5:53 pm

Maybe you should use ESP8266 RTOS SDK instead, it is much more active. https://github.com/espressif/ESP8266_RTOS_SDK

Who is online

Users browsing this forum: No registered users and 9 guests