91欧美超碰AV自拍|国产成年人性爱视频免费看|亚洲 日韩 欧美一厂二区入|人人看人人爽人人操aV|丝袜美腿视频一区二区在线看|人人操人人爽人人爱|婷婷五月天超碰|97色色欧美亚州A√|另类A√无码精品一级av|欧美特级日韩特级

電子發(fā)燒友App

硬聲App

掃碼添加小助手

加入工程師交流群

0
  • 聊天消息
  • 系統(tǒng)消息
  • 評論與回復(fù)
登錄后你可以
  • 下載海量資料
  • 學(xué)習(xí)在線課程
  • 觀看技術(shù)視頻
  • 寫文章/發(fā)帖/加入社區(qū)
會員中心
創(chuàng)作中心

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

3天內(nèi)不再提示
創(chuàng)作
電子發(fā)燒友網(wǎng)>電子資料下載>電子資料>如何在STM32中編寫我們的自定義引導(dǎo)加載程序

如何在STM32中編寫我們的自定義引導(dǎo)加載程序

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

資料介紹

STM32 MCU中的Bootloader實現(xiàn)

在這里,我已經(jīng)解釋了如何在 STM32 中編寫我們的自定義引導(dǎo)加載程序。

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步:

分離閃存

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

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

?

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

?

下圖描述了閃存映射,

pYYBAGSAY9GAGZkMAACnsOVF9tM929.png

閃存映射

第 3 步:

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

將此源添加到引導(dǎo)加載程序和用戶應(yīng)用程序以切換內(nèi)存地址

?

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

?

在我的例子中,內(nèi)存地址,

引導(dǎo)加載程序,

?

#define MEM_ADDR         0x08009000

?

用戶申請

?

#define MEM_ADDR         0x08000000

?

為各自的項目添加以上內(nèi)容。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.

我創(chuàng)建了兩個基本項目。我想這可以讓您很好地理解引導(dǎo)加載程序的概念。

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

輸出

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

?

mcu 內(nèi)存 STM32
加入交流群
微信小助手二維碼

掃碼添加小助手

加入工程師交流群

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

評論

查看更多

下載排行

本周

  1. 1新一代網(wǎng)絡(luò)可視化(NPB 2.0)
  2. 3.40 MB  |  1次下載  |  免費
  3. 2冷柜-電氣控制系統(tǒng)講解
  4. 13.68 MB   |  1次下載  |  10 積分
  5. 3MDD品牌三極管MMBT3906數(shù)據(jù)手冊
  6. 2.33 MB  |  次下載  |  免費
  7. 4MDD品牌三極管S9012數(shù)據(jù)手冊
  8. 2.62 MB  |  次下載  |  免費
  9. 5LAT1218 如何選擇和設(shè)置外部晶體適配 BlueNRG-X
  10. 0.60 MB   |  次下載  |  3 積分
  11. 6LAT1216 Blue NRG-1/2 系列芯片 Flash 操作與 BLE 事件的互斥處理
  12. 0.89 MB   |  次下載  |  3 積分
  13. 7收音環(huán)繞擴音機 AVR-1507手冊
  14. 2.50 MB   |  次下載  |  免費
  15. 8MS1000TA 超聲波測量模擬前端芯片技術(shù)手冊
  16. 0.60 MB   |  次下載  |  免費

本月

  1. 1愛華AIWA HS-J202維修手冊
  2. 3.34 MB   |  37次下載  |  免費
  3. 2PC5502負載均流控制電路數(shù)據(jù)手冊
  4. 1.63 MB   |  23次下載  |  免費
  5. 3NB-IoT芯片廠商的資料說明
  6. 0.31 MB   |  22次下載  |  1 積分
  7. 4UWB653Pro USB口測距通信定位模塊規(guī)格書
  8. 838.47 KB  |  5次下載  |  免費
  9. 5蘇泊爾DCL6907(即CHK-S007)單芯片電磁爐原理圖資料
  10. 0.04 MB   |  4次下載  |  1 積分
  11. 6蘇泊爾DCL6909(即CHK-S009)單芯片電磁爐原理圖資料
  12. 0.08 MB   |  2次下載  |  1 積分
  13. 7100W準諧振反激式恒流電源電路圖資料
  14. 0.09 MB   |  2次下載  |  1 積分
  15. 8FS8025B USB的PD和OC快充協(xié)議電壓誘騙控制器IC技術(shù)手冊
  16. 1.81 MB   |  1次下載  |  免費

總榜

  1. 1matlab軟件下載入口
  2. 未知  |  935137次下載  |  10 積分
  3. 2開源硬件-PMP21529.1-4 開關(guān)降壓/升壓雙向直流/直流轉(zhuǎn)換器 PCB layout 設(shè)計
  4. 1.48MB  |  420064次下載  |  10 積分
  5. 3Altium DXP2002下載入口
  6. 未知  |  233089次下載  |  10 積分
  7. 4電路仿真軟件multisim 10.0免費下載
  8. 340992  |  191439次下載  |  10 積分
  9. 5十天學(xué)會AVR單片機與C語言視頻教程 下載
  10. 158M  |  183353次下載  |  10 積分
  11. 6labview8.5下載
  12. 未知  |  81602次下載  |  10 積分
  13. 7Keil工具MDK-Arm免費下載
  14. 0.02 MB  |  73822次下載  |  10 積分
  15. 8LabVIEW 8.6下載
  16. 未知  |  65991次下載  |  10 積分