1
Discussion - EVE / Re: ESD 4.8 - STM32 - Image
« on: July 23, 2020, 06:50:15 AM »
That flash part was not for other micro controllers, it was for FT micro controllers and I am working with ST micro controller. I could upload the image, it calls those functions itself. For my case, my image's resourceInfo->Compressed type was ESD_RESOURCE_DEFLATE, so for that image generated code calls EVE_Util_loadInflateFile(EVE_HalContext *phost, uint32_t address, const char *filename) function. It handles *phost and address part, we should take care of filename. Here filename is unique and it comes from source file that I used in ESD 4.8 . I changed that function like below
and now I can upload any image to RAM_G.
Code: [Select]
bool EVE_Util_loadInflateFile(EVE_HalContext *phost, uint32_t address, const char *filename)
{
uint32_t ftsize = 0;
uint8_t pbuff[8192];
uint16_t blocklen;
for (int i = 0; i < (sizeof(fileArray) / sizeof(fileInfo)); i++)
{
if (0 == memcmp(fileArray[i].name, filename, sizeof(filename)))
{
if (!EVE_Cmd_waitSpace(phost, 8))
return false; // Space for CMD_INFLATE
EVE_Cmd_wr32(phost, CMD_INFLATE);
EVE_Cmd_wr32(phost, address);
ftsize = fileArray[i].size;
while (ftsize > 0)
{
blocklen = ftsize > 8192 ? 8192 : ftsize;
memcpy(pbuff, fileArray[i].address + (fileArray[i].size- ftsize), blocklen);
ftsize -= blocklen;
if (!EVE_Cmd_wrMem(phost, (char *)pbuff, blocklen)) /* copy data continuously into command memory */
break;
}
return EVE_Cmd_waitFlush(phost);
}
}
return false;
}
and now I can upload any image to RAM_G.