Could you please try adding this line into components/esp32/ld/esp32.common.ld, near line 88 (next to *libesp32.a:core_dump.o):
Code: Select all
*libesp32.a:heap_alloc_caps.o(.literal .text .literal.* .text.*)
Code: Select all
*libesp32.a:heap_alloc_caps.o(.literal .text .literal.* .text.*)
Code: Select all
/************************************************************
@Func:
@Inputs:
@Outputs:
*************************************************************/
static BOOL VerifyBinFileFromFlash(const esp_partition_t* p , size_t FileLen , unsigned char * FileHash)
{
struct MD5Context MyMD5;
unsigned char MyDigest[16];
MD5Init(&MyMD5);
uint32_t FlashBuf[4];
esp_err_t SpiErr = 0;
//read 4 bytes at a time
TRACE_D("Verifying File MD5 Hash\n");
if( FileLen % 4 != 0)
{
TRACE_D("Bad File Length \n");
return False;
}
for(uint32_t i = 0 ; i!= FileLen ; i+=4)
{
if( (SpiErr = esp_partition_read(p, i,FlashBuf, 4)) == ESP_OK)
{
MD5Update(&MyMD5 , (unsigned char const*)FlashBuf , 4);
}
else
{
TRACE_D("FATAL : Error reading SPI flash \n");
return False;
}
}
MD5Final(MyDigest , &MyMD5);
for(uint8_t i=0;i<16;i++)
{
printf("MD5 %d = Calc : %x , Rec : %x \n",i,MyDigest[i],FileHash[i]);
}
if(memcmp(MyDigest , FileHash , 16) == 0)
{
printf("File Hash Match \n");
return True;
}
else
{
printf("File Hash MisMatch !!!!!!!!!!!! \n");
return False;
}
}
Can you please post the exact output you get when it resets?imtiaz wrote: I had a function that verifies the downloaded file from the spi flash using MD5 which has always worked - and it just stopped working with the update - it just freezes now when you call it and after a while I get a WDT reset - do you guys have any idea what could be happening.
Code: Select all
spi_flash_mmap_handle_t handle;
const void *image_data;
esp_partition_mmap(p, 0, FileLen, SPI_FLASH_MMAP_DATA, &image_data, &handle);
assert(image_data != NULL);
MD5Update(&MyMD5 , image_data, FileLen);
spi_flash_munmap(handle);
MD5Final(MyDigest , &MyMD5);
Users browsing this forum: No registered users and 114 guests