Code Monkey home page Code Monkey logo

stm32_hal_ramdisk_usb_iap's Introduction

[TOC]

kirito 2020-11-29 V1.1

USB RAMDISK模拟U盘升级V1.0

原理

把内部RAM弄一个缓冲区, 先格式化为FATFS, 然后用USB模拟为U盘, 把升级文件丢过去, 然后断开USB完成升级

如果复位后3S内没检查到USB,直接运行上一个APP

流程

1 准备APP:

cubemx的DEMO为这个目录:

C:\Users\Administrator\STM32Cube\Repository\STM32Cube_FW_F4_V1.25.1\Projects\STM32446E_EVAL\Applications\IAP

更改中断向量表的偏移为ox10000

image-20201129214606480

2 更改生成bin的地址为0x8010000

image-20201129214703862

3 编译生成hex文件

4 目录下有一个bat, 双击生成bin文件

image-20201129214804493

这个bat源码为

SET FROM_ELF_PATH="D:\programfile\productive_soft\keil\ARM\ARMCC\Bin\fromelf.exe"
%FROM_ELF_PATH% ".\STM32446E_EVAL\STM32446E_EVAL.axf" --bin --output ".\STM32446E_EVAL.bin"

最终生成了STM32446E_EVAL.bin

5 更改bin名字为update.bin

6 开发板重启,插入电脑, 把update.bin拖进模拟的U盘, 然后拔出USB线, 完成升级

image-20201129215006146

bootloader注意事项

1 更改APP地址后

app地址设置在flash-if.h里面设置, 如果更改了地址, 要注意更改flah_if.c的NbSectors

image-20201129215130492

image-20201129215222275

stm32_hal_ramdisk_usb_iap's People

Contributors

openzf avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.