diff --git a/project/Core/Src/tftp.c b/project/Core/Src/tftp.c index 765b597..81e5859 100644 --- a/project/Core/Src/tftp.c +++ b/project/Core/Src/tftp.c @@ -244,9 +244,6 @@ void init_index(void) { str_cat(virt_file[0].data, len, '\n'); root = root->next; } - - virt_file[2].data = malloc(100); - virt_file[2].len = 100; } struct tftp_context tftpContext_s = {.open = tftp_open, .close = tftp_close, .read = tftp_read, .write = tftp_write}; @@ -258,6 +255,9 @@ void tftp_server_init(void) { LOG_INFO(TAG, "Initializing tftp server"); // init the index.txt virt_file init_index(); + // init the virtImage.raw virt_file + virt_file[2].data = malloc(81920 * sizeof(char)); + virt_file[2].len = 81920; // Init the tftp server if (tftp_init(&tftpContext_s) != ERR_OK) {