3 Make sure the binary file size does not exceed the total size of the STM32

3 make sure the binary file size does not exceed the

This preview shows page 11 - 14 out of 19 pages.

3. Make sure the binary file size does not exceed the total size of the STM32 user Flash area. 4. When clicking the Upload button (see Figure 5 ), a POST request is sent to the server. At this moment the server starts erasing all the user Flash area and waits for the binary file raw data. The received data is then written into the user Flash area. 5. Note that the total length of the data to be received is extracted from the HTTP header data sent at the beginning of the transfer. 6. At the end of IAP operation, a web page indicates the success of IAP operation, displaying a button which allows you to reset the MCU. Figure 7. File upload done Figure 8 summarizes the IAP method using HTTP.
Image of page 11
IAP using HTTP UM1709 12/19 DocID025701 Rev 3 Figure 8. Flowchart of IAP using HTTP 067844394 (QWHU#,$3#PRGH (QWHU#,$3#PRGH +<<3#VHUYHU#,QLWLDOL]DWLRQ +<<3#VHUYHU#,QLWLDOL]DWLRQ ,QGH[#SDJH# UHTXHVW" ,QGH[#SDJH# UHTXHVW" ,QGH[#SDJH#VHQW#WR#ZHE FOLHQW ,QGH[#SDJH#VHQW#WR#ZHE# FOLHQW )LOH#XSORDG#SDJH#VHQW#WR ZHE#FOLHQW )LOH#XSORDG#SDJH#VHQW#WR# ZHE#FOLHQW +<0/#3;6<#### UHTXHVW#UHFHLYHG## IRU#ILOH#XSORDG +<0/#3;6<#### UHTXHVW#UHFHLYHG## IRU#ILOH#XSORDG (UDVH#WKH#WRWDO#)ODVK#DUHD (UDVH#WKH#WRWDO#)ODVK#DUHD =ULWH#GDWD#LQWR#IODVK PHPRU\ =ULWH#GDWD#LQWR#IODVK# PHPRU\ $OO#GDWD# UHFHLYHG" $OO#GDWD# UHFHLYHG" (QG#RI#ILOH#WUDQVIHU (QG#RI#ILOH#WUDQVIHU 1R 1R 1R &RUUHFW#:VHU#,'2# & W : ,'2 3=#VXEPLWWHG" &RUUHFW#:VHU#,'2# 3=#VXEPLWWHG" 5DZ#GDWD# UHFHLYHG" 5DZ#GDWD# UHFHLYHG" 1R 1R
Image of page 12
DocID025701 Rev 3 13/19 UM1709 IAP using HTTP 18 3.3 Using the firmware In order to test the IAP using HTTP, follow these steps: 1. Make sure the jumpers on the evaluation board are set correctly (see Section 4.2 ). 2. In the main.h file, uncomment the option USE_IAP_HTTP , also depending on your needs you can uncomment/comment other options like USE_DHCP or USE_LCD. 3. Recompile the firmware. Using the generated map file, make sure there is no overlap between the IAP code area (starting from address 0x0) and the user Flash area starting from address: USER_FLASH_FIRST_PAGE_ADDRESS (defined in main.h). 4. Program the firmware into STM32F4xx Flash and run it. 5. To enter IAP mode, press then release the Reset button while keeping the Key button pressed. 6. If USE_LCD is defined in main.h file then the LCD screen displays a message indicating that IAP mode has been entered. Also in the case of using DHCP ( USE_DHCP defined in main.h), a message is displayed on the LCD screen indicating the success or failure of DHCP IP address allocation. 7. After IP address assignment (either static or dynamic address), the user can start the IAP process. 8. Open a web client (Mozilla Firefox or Microsoft Internet Explorer) and enter the STM32 IP address. 9. A login web page will be shown. In the User ID field enter “user” and in the Password field enter “stm32” then press the Login button. 10. The fileupload.html web page is then loaded. Browse for a binary image to be loaded into STM32 Flash then press the Upload button in order to start the IAP process.
Image of page 13
Image of page 14

You've reached the end of your free preview.

Want to read all 19 pages?

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture