STM32 DFU USB – 在无需硬件复位的情况下运行上传的代码?

huangapple go评论62阅读模式
英文:

STM32 DFU USB - run uploaded code without HW reset?

问题

使用标准的DFU USB内置引导加载程序来刷新STM32F412的新固件后,是否可以在无需硬件重置或更改其他GPIO的情况下运行已上传的代码?

或者,是否可以通过仅使用USB信号(D+/-)来触发复位STM32,或者有其他方法?切断电源不是一个选项。

英文:

If using the standard DFU USB inbuilt bootloader to STM32F412, after uploading the new firmware, is it possible to run the uploaded code without a HW reset or changing other GPIOs?

Or alternatively, some way I can trigger a reset using only the USB signals to STM32 (D+/-)? Cutting the power is not an option.

答案1

得分: 1

应用笔记AN2606涵盖了系统引导加载程序。

从第31页:

> 系统存储器引导模式可以通过退出引导加载程序激活条件并生成硬件复位,或者使用Go命令来执行用户代码而退出。
>
>注意:当执行Go命令时,引导加载程序使用的外设寄存器在跳转到用户应用程序之前不会初始化为它们的默认复位值。
> 如果它们被使用,必须在用户应用程序中重新配置它们。
> 因此,如果应用程序使用IWDG,IWDG预分频器值必须适应应用程序的要求(因为预分频器已设置为其最大值)。
> 对于某些产品,不是所有的复位值都被设置。
> 有关更多信息,请参阅每个产品引导加载程序版本的详细已知限制。

第43页:

STM32 DFU USB – 在无需硬件复位的情况下运行上传的代码?

接下来,让我们查看AN3156 USB DFU引导加载程序应用笔记,第19页(在该页和之前有关于退出DFU到特定地址或进行系统复位所需使用的具体命令的更多有用信息):

> 离开DFU模式
> 可以通过DFU下载请求退出DFU模式(和引导加载程序),并跳转到加载的应用程序(在内部闪存内存或嵌入式RAM中)。

英文:

Application note AN2606 covers the system bootloader.

From page 31:

> System memory boot mode can be exited by getting out from bootloader
> activation condition and generating hardware reset or using Go command
> to execute user code.
>
>Note: When executing the Go command, the
> peripheral registers used by the bootloader are not initialized to
> their default reset values before jumping to the user application.
> They must be reconfigured in the user application if they are used.
> So, if the application uses the IWDG, the IWDG prescaler value must
> beadapted to meet the requirements of the application (since the
> prescaler was set to its maximum value). For some products, not all
> reset values are set. For more information, refer to the known
> limitations detailed for each product bootloader version.

Page 43:

STM32 DFU USB – 在无需硬件复位的情况下运行上传的代码?

Next, let's take a look at AN3156 USB DFU Bootloader Application Note, page 19 (there is more useful info on that page and just before it on specific commands you need to use to exit DFU to specific address, or do a system reset):

> Leave DFU mode
> It is possible to exit DFU mode (and bootloader) and
> jump to a loaded application (in the internal flash memory or in the
> embedded RAM) using the DFU download request.

huangapple
  • 本文由 发表于 2023年7月13日 00:33:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/76672742.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定