Skip to content

Commit

Permalink
Fix flash size/mode/frequency initialization order
Browse files Browse the repository at this point in the history
-bo command used to reset flash size/mode/frequency to default values
  • Loading branch information
igrr committed May 18, 2015
1 parent 95c1906 commit d335209
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions binimage/esptool_binimage.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,12 @@
#include "infohelper.h"
#include "esptool_binimage.h"

static bin_image b_image;
static bin_image b_image = {
.magic = 0xe9,
.num_segments = 0,
.flash_mode = FLASH_MODE_QIO,
.flash_size_freq = FLASH_SIZE_512K | FLASH_FREQ_40
};

int binimage_add_segment(uint32_t address, uint32_t size, unsigned char *data)
{
Expand Down Expand Up @@ -80,12 +85,7 @@ int binimage_prepare(const char *fname, uint32_t entry)
return 0;
}

b_image.magic = 0xE9;
b_image.num_segments = 0;
b_image.flash_mode = FLASH_MODE_QIO;
b_image.flash_size_freq = FLASH_SIZE_512K | FLASH_FREQ_40;
b_image.entry = entry;

b_image.entry = entry;

if(fname[0])
{
Expand Down

0 comments on commit d335209

Please sign in to comment.