一区二区三区三上|欧美在线视频五区|国产午夜无码在线观看视频|亚洲国产裸体网站|无码成年人影视|亚洲AV亚洲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è)備

?

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

評論

查看更多

下載排行

本周

  1. 1DD3118電路圖紙資料
  2. 0.08 MB   |  1次下載  |  免費
  3. 2AD庫封裝庫安裝教程
  4. 0.49 MB   |  1次下載  |  免費
  5. 3PC6206 300mA低功耗低壓差線性穩(wěn)壓器中文資料
  6. 1.12 MB   |  1次下載  |  免費
  7. 4網(wǎng)絡(luò)安全從業(yè)者入門指南
  8. 2.91 MB   |  1次下載  |  免費
  9. 5DS-CS3A P00-CN-V3
  10. 618.05 KB  |  1次下載  |  免費
  11. 6海川SM5701規(guī)格書
  12. 1.48 MB  |  次下載  |  免費
  13. 7H20PR5電磁爐IGBT功率管規(guī)格書
  14. 1.68 MB   |  次下載  |  1 積分
  15. 8IP防護等級說明
  16. 0.08 MB   |  次下載  |  免費

本月

  1. 1貼片三極管上的印字與真實名稱的對照表詳細說明
  2. 0.50 MB   |  103次下載  |  1 積分
  3. 2涂鴉各WiFi模塊原理圖加PCB封裝
  4. 11.75 MB   |  89次下載  |  1 積分
  5. 3錦銳科技CA51F2 SDK開發(fā)包
  6. 24.06 MB   |  43次下載  |  1 積分
  7. 4錦銳CA51F005 SDK開發(fā)包
  8. 19.47 MB   |  19次下載  |  1 積分
  9. 5PCB的EMC設(shè)計指南
  10. 2.47 MB   |  16次下載  |  1 積分
  11. 6HC05藍牙原理圖加PCB
  12. 15.76 MB   |  13次下載  |  1 積分
  13. 7802.11_Wireless_Networks
  14. 4.17 MB   |  12次下載  |  免費
  15. 8蘋果iphone 11電路原理圖
  16. 4.98 MB   |  6次下載  |  2 積分

總榜

  1. 1matlab軟件下載入口
  2. 未知  |  935127次下載  |  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  |  191390次下載  |  10 積分
  9. 5十天學(xué)會AVR單片機與C語言視頻教程 下載
  10. 158M  |  183342次下載  |  10 積分
  11. 6labview8.5下載
  12. 未知  |  81588次下載  |  10 積分
  13. 7Keil工具MDK-Arm免費下載
  14. 0.02 MB  |  73815次下載  |  10 積分
  15. 8LabVIEW 8.6下載
  16. 未知  |  65989次下載  |  10 積分