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.