Issues with FOTA Update due to Insufficient Space on EC200U

Hello,
I am using the EC200U_EU_AA module and I want to update the firmware through FTOP on the module. The module has a demo file called ftp_fota in which we define the FTP server name, user, password, and file path, and use the predefined functions to perform the update, as shown below:

fota_ftp_client_t *fota_ftp_cli_p = &fota_ftp_cli;

if(fota_ftp_result_process() == QL_FOTA_FINISHED)
{
goto init_error_exit;
}

ret = fota_ftp_client_init(fota_ftp_cli_p);
if (QL_FTP_FOTA_SUCCESS != ret)
{
goto init_error_exit;
}

ret = fota_ftp_net_connect_ready(fota_ftp_cli_p);
if (QL_FTP_FOTA_SUCCESS != ret)
{
goto exit;
}

fota_ftp_file_download(fota_ftp_cli_p);

fota_ftp_file_check(fota_ftp_cli_p);

exit:
ql_ftp_client_release(fota_ftp_cli_p->ftp_handle);

When executing the function fota_ftp_net_connect_ready, I get the following error indicating that there is not enough free space to download the firmware:

residual_space_size: 1480856 ftp file total_size: 5447418
There is not enough free space to download FOTA files

The new firmware that I uploaded to the server is only a small program consisting of two test functions: one for blinking an LED and the other for printing via USART. However, the firmware size is still 5MB. I have commented out all the other libraries in the init section, and only my functions should be executing.

I suspect that the compiler might be including unnecessary demo libraries in the firmware, which is why the size has increased so much. Is this the case? If so, how can I optimize the firmware size?

I am using the VS Code compiler, and the firmware file is a .pac file that I upload from the SDK and the target folder.

Is there a way to make the compiler optimize the code and reduce the size of the firmware? If so, how can I do that?

Thank you in advance for your help.

May I ask if you are upgrading with a full package or a differential package?
The FOTA function only supports differential upgrades.

yes i was upgrading with a full package so if it only supports differential upgrades how can i upgrade it in differential? in the SDK demo there is only one lib named fota. how can i use differential fota?

Do you need a complete package of upgrade tools? Or you just need FOTA upgrade

i just need a FOTA upgrade in differential mode.

hi Tariq , you got any solution from them? if yes, pls tell me how to reduce the file size? because I’m also struggled to reduce.

unfortunately not :slightly_frowning_face: :slightly_frowning_face: :slightly_frowning_face:

hi tariq , i got solution ,now dfota it been work

I’d appreciate it if you could tell me how. :folded_hands:

hi pls check your chat box