How to download a large file

sidekick
Posts: 3
Joined: Fri Jun 19, 2015 3:11 pm

How to download a large file

Postby sidekick » Thu May 12, 2016 6:35 am

Hi,

I'm implementing DFU OTA (over wifi) for a MCU (STM32F0). My target MCU is connected to ESP8266 over UART interface. The firmware for my target MCU is kept on a remote server which I can access over HTTP. So, the idea is to let ESP8266 download the firmware image and transfer it to STM32F0. The bootloader on STM32F40 takes care of erasing and programming the main flash memory of STM32F0. However, since I cannot have a very large buffer (Firmware binary file could be much larger than the maximum stack size of STM32F0) for storing the data received over UART, i would like to download the entire f/w image in multiple of smaller chunks. How should I go about doing this. For example, when I send AT+CIPSEND in following manner, I see the entire binary file on the wire

AT+CIPSEND=<len>
> GET /pub/data/testurl/stm32f0.bin HTTP/1.1
Host:abc.xyz.com

This does not help, as I cannot create a large receive buffer. Ideally, I would like to instruct somehow, the offset and length of the HTTP data, but I haven't found a way to achieve this.

Note that, this is not an arduino board. It's a resource constrained ARM Cortex M0 based SOC, http://www2.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/mcu-eval-tools/stm32-mcu-eval-tools/stm32-mcu-discovery-kits/stm32f0discovery.html connected with ESP8266 over UART interface.

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: How to download a large file

Postby ESP_Faye » Fri May 13, 2016 4:48 pm

Hi,

i would like to download the entire f/w image in multiple of smaller chunks.

It needs your upgrade server to support this function.

And it is suggested that erasing the flash first, then download a small chunk of FW and write it into flash, and then download a small chunk of FW and write it into flash and so on.

Who is online

Users browsing this forum: No registered users and 189 guests