diff --git a/source/Makefile.am b/source/Makefile.am index 466bcac..aa6725d 100644 --- a/source/Makefile.am +++ b/source/Makefile.am @@ -21,6 +21,6 @@ bin_PROGRAMS = XconfHttpDl AM_CPPFLAGS = -I$(top_srcdir)/hal/include AM_CFLAGS = $(AM_CPPFLAGS) AM_LDFLAGS = -lccsp_common -AM_LDFLAGS += -lcm_mgnt -lsysevent -lsyscfg +AM_LDFLAGS += -lcm_mgnt -lsysevent -lsyscfg -lfw_download_chk XconfHttpDl_SOURCES = cm_http_dl.c diff --git a/source/cm_http_dl.c b/source/cm_http_dl.c index f7a3d3b..e5629e7 100644 --- a/source/cm_http_dl.c +++ b/source/cm_http_dl.c @@ -21,6 +21,7 @@ #include #include +#include "fw_download_check.h" #include #include "cm_hal.h" @@ -636,8 +637,12 @@ int main(int argc,char *argv[]) } else if (type == HTTP_DOWNLOAD) { - http_status = HTTP_Download(); - + if(can_proceed_fw_download() == FW_DWNLD_MEMCHK_NOT_ENOUGH_MEM){ + printf("Available memory is not enough to proceed with firmware download\n"); + }else{ + http_status = HTTP_Download(); + } + // The return code is after RETRY_HTTP_DOWNLOAD_LIMIT has been reached // For 200, return SUCCESS, else FAILURE and retry in the next window if(http_status == 200)