You can chat about native SDK questions and issues here.

User avatar
By Agentsmithers
#84279
rzajac wrote:You can try to use my repo: https://github.com/kicdev/esp-open-sdk
I added 3.0.1 and a patch for c_types.h


Thanks!! I keep getting could not find bash >= 3.1 for some reason and I see your configure.ac regex is correct. any idea what may cause this? (Maybe because Im running Ubuntu 18?)
User avatar
By Agentsmithers
#85071 So last night Davyd and I connected and I ran the following commands and got 3.0.0 SDK to work for me

[osboxes@osboxes ~]$ git clone "https://github.com/pfalcon/esp-open-sdk.git"
Cloning into 'esp-open-sdk'...
[osboxes@osboxes ~]$ cd esp-open-sdk
git fetch origin pull/344/head
git checkout -b pullrequest FETCH_HEAD
git submodule update --init
make clean-sdk clean-sysroot all


I then needed a partition table in my main.c
I used this with the following burn addresses
NOTE: I am not an expert I barely got this to work! I used this with a Wemos D1 Mini Pro and I think it actually has a solid amount of 16MB of memory, Any suggestions to tweak this please feel free to let me know!

The image was generated with esptool using --version 2 flag and the same physical image was burned to both address 0x1000 and a duped copy burned to 0x81000 (This is for 32m flash_size, This address I feel will change if I update the map to a larger size for which this wemos supports?)

Code: Select allesptool.py write_flash --flash_size 32m 0 boot_v1.7.bin 0x1000 Main-0x01000.bin 0x3fb000 ../library/blank.bin 0x3FE000 ../library/blank.bin 0x3FC000 esp_init_data_default_v08.bin


Code: Select all#define SDK_RF_CAL_ADDR 0x3FB000
#define SDK_PHY_DATA_ADDR 0x3FC000
#define SDK_PARAM_ADDR 0x3FD000
#define SPI_FLASH_SIZE_MAP FLASH_SIZE_32M_MAP_512_512 // FLASH_SIZE_128M_MAP_1024_1024//FLASH_SIZE_32M_MAP_512_512 // 4
#define SDK_PRIV_PARAM_ADDR 0x7C000
#define SYSTEM_PARTITION_CUSTOMER_PRIV_PARAM SYSTEM_PARTITION_CUSTOMER_BEGIN

#define SYSTEM_PARTITION_OTA_SIZE                    0x6A000  // upper limit for user.bin
#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
#define SYSTEM_PARTITION_AT_PARAMETER_ADDR.                     0x7d000
#define SYSTEM_PARTITION_SSL_CLIENT_CERT_PRIVKEY_ADDR           0x7c000
#define SYSTEM_PARTITION_SSL_CLIENT_CA_ADDR.                    0x7b000
#define SYSTEM_PARTITION_WPA2_ENTERPRISE_CERT_PRIVKEY_ADDR      0x7a000
#define SYSTEM_PARTITION_WPA2_ENTERPRISE_CA_ADDR                0x79000

//static const partition_item_t p_table[] = { { SYSTEM_PARTITION_BOOTLOADER, 0x0, 0x1000 }, { SYSTEM_PARTITION_RF_CAL, SDK_RF_CAL_ADDR, 0x1000 }, { SYSTEM_PARTITION_PHY_DATA, SDK_PHY_DATA_ADDR, 0x1000 }, { SYSTEM_PARTITION_SYSTEM_PARAMETER, SDK_PARAM_ADDR, 0x3000 }, { SYSTEM_PARTITION_CUSTOMER_PRIV_PARAM, SDK_PRIV_PARAM_ADDR, 0x1000 }, };
#define EAGLE_FLASH_BIN_ADDR            (SYSTEM_PARTITION_CUSTOMER_BEGIN + 1)
#define EAGLE_IROM0TEXT_BIN_ADDR         (SYSTEM_PARTITION_CUSTOMER_BEGIN + 2)

// user_pre_init is required from SDK v3.0.0 onwards
// It is used to register the parition map with the SDK, primarily to allow
// the app to use the SDK's OTA capability.  We don't make use of that in
// otb-iot and therefore the only info we provide is the mandatory stuff:
// - RF calibration data
// - Physical data
// - System parameter
// The location and length of these are from the 2A SDK getting started guide
void ICACHE_FLASH_ATTR user_pre_init(void)
{
  static const partition_item_t part_table[] = {
    { SYSTEM_PARTITION_BOOTLOADER,          0x0,                 0x1000 },
    { SYSTEM_PARTITION_RF_CAL,              SDK_RF_CAL_ADDR,     0x1000 },
    { SYSTEM_PARTITION_PHY_DATA,            SDK_PHY_DATA_ADDR,   0x1000 },
    { SYSTEM_PARTITION_SYSTEM_PARAMETER,    SDK_PARAM_ADDR,      0x3000 },
    { SYSTEM_PARTITION_CUSTOMER_PRIV_PARAM, SDK_PRIV_PARAM_ADDR, 0x1000 },
   };
 

  // This isn't an ideal approach but there's not much point moving on unless
  // or until this has succeeded cos otherwise the SDK will just barf and
  // refuse to call user_init()

   if(!system_partition_table_regist(part_table, sizeof(part_table)/sizeof(part_table[0]),SPI_FLASH_SIZE_MAP))
   {
      os_printf("system_partition_table_regist fail\r\n");
      while(1);
   }
     
   os_printf("system_partition_table_regist has been registered!");

  return;
}