Hi, I am writing an application which downloads a new image (over-the-air update) from a HTTP server.
The size of the new image is a bit larger than 400 kbytes. After approximately 100-200 kbytes the write to the flash memory fails/stalls. I cannot get any useful information from the debugger.
I disable the interrupts and enable between each write to the flash as shown below:
unsigned char https_buf[1024];
int read_request()
{
do
{
len = sizeof(https_buf);
memset(https_buf, 0, sizeof(https_buf));
ret = lwip_recv(tlsDataParams.fd, https_buf, len, 0);
if (ret == 0)
{
PRINTF("\n\nEOF\r\n");
goto exit;
}
uint32_t regPrimask = DisableGlobalIRQ();
result = mflash_drv_write(chunk_addr, (uint8_t*)https_buf, len);
EnableGlobalIRQ(regPrimask);
} while (1);
I am using a Embedded Artists imx-rt1062-developers-kit with the following SDK: eaimxrt1062_sdk_2.9.3_freertos. The flash memory is a Adesto XIP.
Could you give any hints on why the write to flash stalls?