I have written a simple code for ESP8266-12E using ESP8266_NONOS_SDK_V2.0.0_16_07_19. With the code below (user_main.c)
#include <osapi.h>
#include <ets_sys.h> //NEEDS TO BE THERE IN EVERY ESP8266 PROGRAM
#include "user_interface.h" //NEEDS TO BE THERE IN EVERY ESP8266 PROGRAM
#include "uart.h"
void module_init_complete(void);
//void set_wifi_parameters(void);
//void wifi_event_handler_function(System_Event_t* event);
void setupPins(void);
void user_init(void)
{
uart_div_modify(0, UART_CLK_FREQ / 115200);
//register callback function for when environment
//100% functional
system_init_done_cb(module_init_complete);
}
void setupPins(void)
{
}
void module_init_complete(void)
{
os_printf("hello world !\n");
ets_printf("hello hello !\n");
}
uint32 ICACHE_FLASH_ATTR
user_rf_cal_sector_set(void)
{
enum flash_size_map size_map = system_get_flash_size_map();
uint32 rf_cal_sec = 0;
switch (size_map) {
case FLASH_SIZE_4M_MAP_256_256:
rf_cal_sec = 128 - 5;
break;
case FLASH_SIZE_8M_MAP_512_512:
rf_cal_sec = 256 - 5;
break;
case FLASH_SIZE_16M_MAP_512_512:
case FLASH_SIZE_16M_MAP_1024_1024:
rf_cal_sec = 512 - 5;
break;
case FLASH_SIZE_32M_MAP_512_512:
case FLASH_SIZE_32M_MAP_1024_1024:
rf_cal_sec = 1024 - 5;
break;
default:
rf_cal_sec = 0;
break;
}
return rf_cal_sec;
}
From what I have understood, with the new SDK one more 4kb sector is reserved for RF calibration data, that needs to be programmed with blank.bin.
As per the function user_rf_cal_sector_set in my code (taken from examples), that sector is 123 ie. address 0x7B000. However as per the getting started guide, blank.bin should be programmed at the address 0x3FE000 (https://espressif.com/en/support/explor ... rted-guide, under FLASH MAP NON FOTA).
So which one is correct?
I tried programming my code using NODE MCU flasher (eagle.flash.bin @ 0x00000, eagle.irom0text.bin @ 0x10000 and blank.bin at both the above 2 address), but when I power on the esp8266 the blue light continuously flashes and i get stream of garbage data on UART0.
please help !