<acronym id="s8ci2"><small id="s8ci2"></small></acronym>
<rt id="s8ci2"></rt><rt id="s8ci2"><optgroup id="s8ci2"></optgroup></rt>
<acronym id="s8ci2"></acronym>
<acronym id="s8ci2"><center id="s8ci2"></center></acronym>

電子發燒友App

硬聲App

0
  • 聊天消息
  • 系統消息
  • 評論與回復
登錄后你可以
  • 下載海量資料
  • 學習在線課程
  • 觀看技術視頻
  • 寫文章/發帖/加入社區
創作中心

完善資料讓更多小伙伴認識你,還能領取20積分哦,立即完善>

3天內不再提示
電子發燒友網>電子資料下載>電子資料>如何在STM32中編寫我們的自定義引導加載程序

如何在STM32中編寫我們的自定義引導加載程序

2023-06-21 | zip | 0.00 MB | 次下載 | 免費

資料介紹

STM32 MCU中的Bootloader實現

在這里,我已經解釋了如何在 STM32 中編寫我們的自定義引導加載程序。

A bootloader is an application whose primary purpose is to allow the systems software that has to be updated without using any specialized hardware such as a JTAG programmer.

The bootloader manages the system's images.

It receives new program information externally via some communication means and writes that information to the program memory of the processor.

Bootloader Structure

The above figure shows a Bootloader for the microcontroller to program it. A bootloader is an optional way to program the application firmware onto the device.

STEP 1:

Creating New Projects

We are going to create two separate projects for implementing a bootloader using STM32CubeIDE. If you are a beginner, Here is an example to create a new project in stm32CubeIDE.

L0_APP1 Project - Bootloader

L0_APP2 Project - User Application

pYYBAGSAY8-AKxxNAACy1DQK9nc637.png

STM32CubeIDE 中的項目

第2步:

分離閃存

我們需要根據 MCU 內存布局將內存部分分開。就我而言,我使用的是 STM32L0 微控制器。單擊此處獲取數據表,并在此處找到STM32L0 的硬件用戶手冊。

我把它從總的閃存大小分成了兩部分。

?

1. Bootloader            0x8000000 - 0x08008FFF
2. User Application      0x8009000 - 0x0802FFFF

?

下圖描述了閃存映射,

pYYBAGSAY9GAGZkMAACnsOVF9tM929.png

閃存映射

第 3 步:

將此部分分離到源代碼中。

將此源添加到引導加載程序和用戶應用程序以切換內存地址

?

uint32_t go_address = *((volatile uint32_t*) (MEM_ADDR+ 4));
void (*jump_to_app)(void) = (void *)go_address;
jump_to_app();

?

在我的例子中,內存地址,

引導加載程序,

?

#define MEM_ADDR         0x08009000

?

用戶申請

?

#define MEM_ADDR         0x08000000

?

為各自的項目添加以上內容。MACRO

步驟4:

Changing the Vector Table OFFSET for User Application as per your separated memory sections. Bootloader OFFSETremains the same,

To change the OFFSETplease go to the below file,

L0_APP2\Src\system_stm32l0xx.c

VECT_TAB_OFFSET

STEP 5:

Change the ORIGIN to keep the bootloader section erasable while we are uploading the User application program from STM32CubeIDE.

To change the ORIGIN, please go to the below file,

L0_APP1 \STM32L073RZ_FLASH.ld

STM32L073RZ_FLASH.ld

connect the board to your computer and flash the application source code into your STM32 microcontroller one by one.

Here we go we are done with all changes. we can write our bootloader application program in the L0_APP0 project.

It is possible to write two different applications and able to switch alternatively depending on user applications.

我創建了兩個基本項目。我想這可以讓您很好地理解引導加載程序的概念。

最后,這是切換在同一個 STM32 微控制器中運行的兩個應用程序的輸出。

輸出

NOTE :在從一個應用程序切換到另一個應用程序之前,請確保禁用所有 ISR 并使用外圍設備

?

下載該資料的人也在下載 下載該資料的人還在閱讀
更多 >

評論

查看更多

下載排行

本周

  1. 1山景DSP芯片AP8248A2數據手冊
  2. 1.06 MB  |  532次下載  |  免費
  3. 2RK3399完整板原理圖(支持平板,盒子VR)
  4. 3.28 MB  |  339次下載  |  免費
  5. 3TC358743XBG評估板參考手冊
  6. 1.36 MB  |  330次下載  |  免費
  7. 4DFM軟件使用教程
  8. 0.84 MB  |  295次下載  |  免費
  9. 5元宇宙深度解析—未來的未來-風口還是泡沫
  10. 6.40 MB  |  227次下載  |  免費
  11. 6迪文DGUS開發指南
  12. 31.67 MB  |  194次下載  |  免費
  13. 7元宇宙底層硬件系列報告
  14. 13.42 MB  |  182次下載  |  免費
  15. 8FP5207XR-G1中文應用手冊
  16. 1.09 MB  |  178次下載  |  免費

本月

  1. 1OrCAD10.5下載OrCAD10.5中文版軟件
  2. 0.00 MB  |  234315次下載  |  免費
  3. 2555集成電路應用800例(新編版)
  4. 0.00 MB  |  33566次下載  |  免費
  5. 3接口電路圖大全
  6. 未知  |  30323次下載  |  免費
  7. 4開關電源設計實例指南
  8. 未知  |  21549次下載  |  免費
  9. 5電氣工程師手冊免費下載(新編第二版pdf電子書)
  10. 0.00 MB  |  15349次下載  |  免費
  11. 6數字電路基礎pdf(下載)
  12. 未知  |  13750次下載  |  免費
  13. 7電子制作實例集錦 下載
  14. 未知  |  8113次下載  |  免費
  15. 8《LED驅動電路設計》 溫德爾著
  16. 0.00 MB  |  6656次下載  |  免費

總榜

  1. 1matlab軟件下載入口
  2. 未知  |  935054次下載  |  免費
  3. 2protel99se軟件下載(可英文版轉中文版)
  4. 78.1 MB  |  537798次下載  |  免費
  5. 3MATLAB 7.1 下載 (含軟件介紹)
  6. 未知  |  420027次下載  |  免費
  7. 4OrCAD10.5下載OrCAD10.5中文版軟件
  8. 0.00 MB  |  234315次下載  |  免費
  9. 5Altium DXP2002下載入口
  10. 未知  |  233046次下載  |  免費
  11. 6電路仿真軟件multisim 10.0免費下載
  12. 340992  |  191187次下載  |  免費
  13. 7十天學會AVR單片機與C語言視頻教程 下載
  14. 158M  |  183279次下載  |  免費
  15. 8proe5.0野火版下載(中文版免費下載)
  16. 未知  |  138040次下載  |  免費
亚洲欧美日韩精品久久_久久精品AⅤ无码中文_日本中文字幕有码在线播放_亚洲视频高清不卡在线观看
<acronym id="s8ci2"><small id="s8ci2"></small></acronym>
<rt id="s8ci2"></rt><rt id="s8ci2"><optgroup id="s8ci2"></optgroup></rt>
<acronym id="s8ci2"></acronym>
<acronym id="s8ci2"><center id="s8ci2"></center></acronym>