【E258】STM32F4 USB HOST实现U盘 IAP

2021-08-17 19:37:23      索炜达电子      519     

项目编号:E258

文件大小:12M

源码说明:带中文注释

开发环境:C编译器

简要概述:

本程序是基于STM32F4x7的USB_HOST_IAP程序


在开发板上调试通过


其中应用程序起始地址为 


#define USER_FLASH_IAP_ADDRESS        0x08040000


用户应用程序起始地址为 0x08040000 请在KEIL中进行设置

 

如果想进行升级操作必须将所要更新的程序转换为BIN文件,

并以ROM.bin的文件名存入U盘中。在KEIL中自动生成BIN文件的命令为


C:\Keil\ARM\ARMCC\bin\fromelf.exe --bin -o OTGROM.bin outut/OTG.axf


程序流程:


系统上电之后先从BOOT程序开始执行,BOOT程序判断U盘是否插入,如果没有插入则认为

没有进行IAP操作,PC跳到应用程序区执行用户程序


如果插入U盘,则判断U盘中是否存在ROM.bin文件,如果有则进行升级,升级成功后

PC自动跳到应用程序区开始执行。


文件列表:

目录│文件列表:

 └ U-IAP-V0.2

    │ readme.txt

    │ 程序说明.txt

    ├ IAP

    │  │ flashapp.c

    │  └ flashapp.h

    ├ inc

    │  │ lcd_log_conf.h

    │  │ stm32f10x_conf.h

    │  │ stm32f2xx_conf.h

    │  │ stm32f4xx_conf.h

    │  │ stm32fxxx_it.h

    │  │ usbh_conf.h

    │  │ usbh_usr.h

    │  └ usb_conf.h

    ├ Libraries

    │  ├ CMSIS

    │  │  │ CMSIS END USER LICENCE AGREEMENT.pdf

    │  │  │ index.htm

    │  │  │ README.txt

    │  │  ├ Device

    │  │  │  └ ST

    │  │  │     ├ STM32F10x

    │  │  │     │  │ Release_Notes.html

    │  │  │     │  ├ Include

    │  │  │     │  │  │ stm32f10x.h

    │  │  │     │  │  └ system_stm32f10x.h

    │  │  │     │  └ Source

    │  │  │     │     └ Templates

    │  │  │     │        │ system_stm32f10x.c

    │  │  │     │        ├ arm

    │  │  │     │        │  │ startup_stm32f10x_cl.s

    │  │  │     │        │  │ startup_stm32f10x_hd.s

    │  │  │     │        │  │ startup_stm32f10x_hd_vl.s

    │  │  │     │        │  │ startup_stm32f10x_ld.s

    │  │  │     │        │  │ startup_stm32f10x_ld_vl.s

    │  │  │     │        │  │ startup_stm32f10x_md.s

    │  │  │     │        │  │ startup_stm32f10x_md_vl.s

    │  │  │     │        │  └ startup_stm32f10x_xl.s

    │  │  │     │        ├ gcc_ride7

    │  │  │     │        │  │ startup_stm32f10x_cl.s

    │  │  │     │        │  │ startup_stm32f10x_hd.s

    │  │  │     │        │  │ startup_stm32f10x_hd_vl.s

    │  │  │     │        │  │ startup_stm32f10x_ld.s

    │  │  │     │        │  │ startup_stm32f10x_ld_vl.s

    │  │  │     │        │  │ startup_stm32f10x_md.s

    │  │  │     │        │  │ startup_stm32f10x_md_vl.s

    │  │  │     │        │  └ startup_stm32f10x_xl.s

    │  │  │     │        ├ iar

    │  │  │     │        │  │ startup_stm32f10x_cl.s

    │  │  │     │        │  │ startup_stm32f10x_hd.s

    │  │  │     │        │  │ startup_stm32f10x_hd_vl.s

    │  │  │     │        │  │ startup_stm32f10x_ld.s

    │  │  │     │        │  │ startup_stm32f10x_ld_vl.s

    │  │  │     │        │  │ startup_stm32f10x_md.s

    │  │  │     │        │  │ startup_stm32f10x_md_vl.s

    │  │  │     │        │  └ startup_stm32f10x_xl.s

    │  │  │     │        ├ TASKING

    │  │  │     │        │  └ cstart_thumb2.asm

    │  │  │     │        └ TrueSTUDIO

    │  │  │     │           │ startup_stm32f10x_cl.s

    │  │  │     │           │ startup_stm32f10x_hd.s

    │  │  │     │           │ startup_stm32f10x_hd_vl.s

    │  │  │     │           │ startup_stm32f10x_ld.s

    │  │  │     │           │ startup_stm32f10x_ld_vl.s

    │  │  │     │           │ startup_stm32f10x_md.s

    │  │  │     │           │ startup_stm32f10x_md_vl.s

    │  │  │     │           └ startup_stm32f10x_xl.s

    │  │  │     ├ STM32F2xx

    │  │  │     │  │ Release_Notes.html

    │  │  │     │  ├ Include

    │  │  │     │  │  │ stm32f2xx.h

    │  │  │     │  │  └ system_stm32f2xx.h

    │  │  │     │  └ Source

    │  │  │     │     └ Templates

    │  │  │     │        │ system_stm32f2xx.c

    │  │  │     │        ├ arm

    │  │  │     │        │  └ startup_stm32f2xx.s

    │  │  │     │        ├ gcc_ride7

    │  │  │     │        │  └ startup_stm32f2xx.s

    │  │  │     │        ├ iar

    │  │  │     │        │  └ startup_stm32f2xx.s

    │  │  │     │        ├ TASKING

    │  │  │     │        │  └ cstart_thumb2.asm

    │  │  │     │        └ TrueSTUDIO

    │  │  │     │           └ startup_stm32f2xx.s

    │  │  │     └ STM32F4xx

    │  │  │        │ Release_Notes.html

    │  │  │        ├ Include

    │  │  │        │  │ stm32f4xx.h

    │  │  │        │  └ system_stm32f4xx.h

    │  │  │        └ Source

    │  │  │           └ Templates

    │  │  │              │ system_stm32f4xx.c

    │  │  │              ├ arm

    │  │  │              │  └ startup_stm32f4xx.s

    │  │  │              ├ gcc_ride7

    │  │  │              │  └ startup_stm32f4xx.s

    │  │  │              ├ iar

    │  │  │              │  └ startup_stm32f4xx.s

    │  │  │              ├ TASKING

    │  │  │              │  └ cstart_thumb2.asm

    │  │  │              └ TrueSTUDIO

    │  │  │                 └ startup_stm32f4xx.s

    │  │  ├ Documentation

    │  │  │  │ CMSIS-SVD_Schema_1_0.xsd

    │  │  │  │ CMSIS_CM4_SIMD.htm

    │  │  │  │ CMSIS_Core.htm

    │  │  │  │ CMSIS_DebugSupport.htm

    │  │  │  │ CMSIS_History.htm

    │  │  │  │ CMSIS_Logo_Final.jpg

    │  │  │  └ CMSIS_System_View_Description.htm

    │  │  └ Include

    │  │     │ arm_common_tables.h

    │  │     │ arm_math.h

    │  │     │ core_cm0.h

    │  │     │ core_cm3.h

    │  │     │ core_cm4.h

    │  │     │ core_cm4_simd.h

    │  │     │ core_cmFunc.h

    │  │     └ core_cmInstr.h

    │  ├ STM32F10x_StdPeriph_Driver

    │  │  │ Release_Notes.html

    │  │  ├ inc

    │  │  │  │ misc.h

    │  │  │  │ stm32f10x_adc.h

    │  │  │  │ stm32f10x_bkp.h

    │  │  │  │ stm32f10x_can.h

    │  │  │  │ stm32f10x_cec.h

    │  │  │  │ stm32f10x_crc.h

    │  │  │  │ stm32f10x_dac.h

    │  │  │  │ stm32f10x_dbgmcu.h

    │  │  │  │ stm32f10x_dma.h

    │  │  │  │ stm32f10x_exti.h

    │  │  │  │ stm32f10x_flash.h

    │  │  │  │ stm32f10x_fsmc.h

    │  │  │  │ stm32f10x_gpio.h

    │  │  │  │ stm32f10x_i2c.h

    │  │  │  │ stm32f10x_iwdg.h

    │  │  │  │ stm32f10x_pwr.h

    │  │  │  │ stm32f10x_rcc.h

    │  │  │  │ stm32f10x_rtc.h

    │  │  │  │ stm32f10x_sdio.h

    │  │  │  │ stm32f10x_spi.h

    │  │  │  │ stm32f10x_tim.h

    │  │  │  │ stm32f10x_usart.h

    │  │  │  └ stm32f10x_wwdg.h

    │  │  └ src

    │  │     │ misc.c

    │  │     │ stm32f10x_adc.c

    │  │     │ stm32f10x_bkp.c

    │  │     │ stm32f10x_can.c

    │  │     │ stm32f10x_cec.c

    │  │     │ stm32f10x_crc.c

    │  │     │ stm32f10x_dac.c

    │  │     │ stm32f10x_dbgmcu.c

    │  │     │ stm32f10x_dma.c

    │  │     │ stm32f10x_exti.c

    │  │     │ stm32f10x_flash.c

    │  │     │ stm32f10x_fsmc.c

    │  │     │ stm32f10x_gpio.c

    │  │     │ stm32f10x_i2c.c

    │  │     │ stm32f10x_iwdg.c

    │  │     │ stm32f10x_pwr.c

    │  │     │ stm32f10x_rcc.c

    │  │     │ stm32f10x_rtc.c

    │  │     │ stm32f10x_sdio.c

    │  │     │ stm32f10x_spi.c

    │  │     │ stm32f10x_tim.c

    │  │     │ stm32f10x_usart.c

    │  │     └ stm32f10x_wwdg.c

    │  ├ STM32F2xx_StdPeriph_Driver

    │  │  │ Release_Notes.html

    │  │  ├ inc

    │  │  │  │ misc.h

    │  │  │  │ stm32f2xx_adc.h

    │  │  │  │ stm32f2xx_can.h

    │  │  │  │ stm32f2xx_crc.h

    │  │  │  │ stm32f2xx_cryp.h

    │  │  │  │ stm32f2xx_dac.h

    │  │  │  │ stm32f2xx_dbgmcu.h

    │  │  │  │ stm32f2xx_dcmi.h

    │  │  │  │ stm32f2xx_dma.h

    │  │  │  │ stm32f2xx_exti.h

    │  │  │  │ stm32f2xx_flash.h

    │  │  │  │ stm32f2xx_fsmc.h

    │  │  │  │ stm32f2xx_gpio.h

    │  │  │  │ stm32f2xx_hash.h

    │  │  │  │ stm32f2xx_i2c.h

    │  │  │  │ stm32f2xx_iwdg.h

    │  │  │  │ stm32f2xx_pwr.h

    │  │  │  │ stm32f2xx_rcc.h

    │  │  │  │ stm32f2xx_rng.h

    │  │  │  │ stm32f2xx_rtc.h

    │  │  │  │ stm32f2xx_sdio.h

    │  │  │  │ stm32f2xx_spi.h

    │  │  │  │ stm32f2xx_syscfg.h

    │  │  │  │ stm32f2xx_tim.h

    │  │  │  │ stm32f2xx_usart.h

    │  │  │  └ stm32f2xx_wwdg.h

    │  │  └ src

    │  │     │ misc.c

    │  │     │ stm32f2xx_adc.c

    │  │     │ stm32f2xx_can.c

    │  │     │ stm32f2xx_crc.c

    │  │     │ stm32f2xx_cryp.c

    │  │     │ stm32f2xx_cryp_aes.c

    │  │     │ stm32f2xx_cryp_des.c

    │  │     │ stm32f2xx_cryp_tdes.c

    │  │     │ stm32f2xx_dac.c

    │  │     │ stm32f2xx_dbgmcu.c

    │  │     │ stm32f2xx_dcmi.c

    │  │     │ stm32f2xx_dma.c

    │  │     │ stm32f2xx_exti.c

    │  │     │ stm32f2xx_flash.c

    │  │     │ stm32f2xx_fsmc.c

    │  │     │ stm32f2xx_gpio.c

    │  │     │ stm32f2xx_hash.c

    │  │     │ stm32f2xx_hash_md5.c

    │  │     │ stm32f2xx_hash_sha1.c

    │  │     │ stm32f2xx_i2c.c

    │  │     │ stm32f2xx_iwdg.c

    │  │     │ stm32f2xx_pwr.c

    │  │     │ stm32f2xx_rcc.c

    │  │     │ stm32f2xx_rng.c

    │  │     │ stm32f2xx_rtc.c

    │  │     │ stm32f2xx_sdio.c

    │  │     │ stm32f2xx_spi.c

    │  │     │ stm32f2xx_syscfg.c

    │  │     │ stm32f2xx_tim.c

    │  │     │ stm32f2xx_usart.c

    │  │     └ stm32f2xx_wwdg.c

    │  ├ STM32F4xx_StdPeriph_Driver

    │  │  │ Release_Notes.html

    │  │  ├ inc

    │  │  │  │ misc.h

    │  │  │  │ stm32f4xx_adc.h

    │  │  │  │ stm32f4xx_can.h

    │  │  │  │ stm32f4xx_crc.h

    │  │  │  │ stm32f4xx_cryp.h

    │  │  │  │ stm32f4xx_dac.h

    │  │  │  │ stm32f4xx_dbgmcu.h

    │  │  │  │ stm32f4xx_dcmi.h

    │  │  │  │ stm32f4xx_dma.h

    │  │  │  │ stm32f4xx_exti.h

    │  │  │  │ stm32f4xx_flash.h

    │  │  │  │ stm32f4xx_fsmc.h

    │  │  │  │ stm32f4xx_gpio.h

    │  │  │  │ stm32f4xx_hash.h

    │  │  │  │ stm32f4xx_i2c.h

    │  │  │  │ stm32f4xx_iwdg.h

    │  │  │  │ stm32f4xx_pwr.h

    │  │  │  │ stm32f4xx_rcc.h

    │  │  │  │ stm32f4xx_rng.h

    │  │  │  │ stm32f4xx_rtc.h

    │  │  │  │ stm32f4xx_sdio.h

    │  │  │  │ stm32f4xx_spi.h

    │  │  │  │ stm32f4xx_syscfg.h

    │  │  │  │ stm32f4xx_tim.h

    │  │  │  │ stm32f4xx_usart.h

TAGSTM32F4
  • 16 次
  • 1 分