扎心是什么意思| 世界八大奇迹分别是什么| 桔梗是什么东西| 小日子是什么意思| 手机买什么好| 海字五行属什么| 什么品牌的空气炸锅好| 痱子粉什么牌子好| sq是什么意思| 病理切片是什么意思| 孕妇吃海带有什么好处| 叶黄素对眼睛有什么功效| 腹泻吃什么药最好| 火命适合佩戴什么首饰| 支付宝余额和余额宝有什么区别| 发烧吃什么药退烧快| 什么是胰腺癌| 豇豆不能和什么一起吃| 2月9号什么星座| 女人每天吃什么抗衰老| 为什么不能下午看病人| 宠幸是什么意思| 皮肤松弛是什么原因造成的| 做完痔疮手术吃什么好| venus是什么星球| 甘油三酯高吃什么食物| 什么是扁平足图片| 社保指什么| 珠海有什么好玩的| 相对湿度是什么意思| 去医院打耳洞挂什么科| 女人左手掌有痣代表什么| 北京晚上有什么好玩的景点| 卢森堡为什么那么有钱| 芹菜什么时候种| u盘什么牌子好| 公丁香和母丁香有什么区别| 月桂酰两性基乙酸钠是什么| 站久了脚后跟疼是什么原因| 甘油三酯高是什么原因造成的| 不完全性右束支阻滞是什么意思| 先兆性流产有什么症状| 胃热是什么原因| 驻京办是干什么的| 第一次怀孕有什么反应| 十面埋伏是什么生肖| 勿忘心安是什么意思| 气喘吁吁什么意思| 被蜱虫咬了挂什么科| 荷叶和什么搭配最减肥| 秦皇岛是什么海| 心功能一级什么意思| 什么的黎明| 乙型肝炎表面抗体高是什么意思| 海誓山盟是什么意思| 世界上什么动物牙齿最多| 乙肝表面抗体弱阳性什么意思| 子宫肌瘤是什么原因造成的| 富翁是什么意思| 脂肪肝不能吃什么| 猪肝能钓什么鱼| 什么感冒药效果最好| 老年人适合吃什么水果| 什么东西养胃又治胃病| 湿疹用什么药最有效| 不解大便是什么原因| 甲亢是什么原因| 漏斗胸是什么病| 什么原因导致高血压| 一黑一白是什么蛇| 为什么井盖是圆的| 月经期不能吃什么水果| 10月25是什么星座| 三查八对的内容是什么| 网球肘是什么症状| 疱疹挂号挂什么科室| 甲亢甲减有什么症状| 为什么心里总想一个人| 鸡冲什么生肖| 孕期同房需要注意什么| 什么是外包| 沉沦是什么意思| 绿茶男是什么意思| 地黄长什么样子图| 尼姑是什么生肖| 皮肤瘙痒是什么原因| 皮肤瘙痒用什么药治疗| 立是什么结构的字| 脚上长鸡眼是什么原因| 巨蟹男和什么星座最配| 四月二号是什么星座| 快递属于什么行业| 什么药治牙疼最快| 有机是什么意思| 鼻干眼干口干属于什么症状| 什么样的毛刺是良性的| 霸是什么生肖| 有什么软件可以赚钱| 二月出生是什么星座| 宫颈筛查是什么意思| 一眼万年什么意思| 发髻是什么意思| 附件炎是什么原因引起的| 食物发霉是什么菌| 什么是心理健康| 什么叫间质瘤| 胃里有胀气吃什么药| 喝茉莉花茶有什么好处| 什么是烤瓷牙| 副脾对身体有什么影响| 扁桃体结石长什么样| 为难的难是什么意思| 6月7号什么星座| 8月23号是什么星座| 什么是桑黄| 身份证上的数字是什么字体| 颅内出血有什么症状| 然五行属什么| 为什么人要喝水| 尿糖一个加号是什么意思| 超敏crp高是什么原因| 一个米一个参念什么| 芥末黄是什么颜色| 己未五行属什么| 蛇冲什么生肖| 什么叫胰岛素抵抗| 南瓜不能和什么同吃| 寅木是什么木| 生不如死什么意思| cea是什么意思| 风湿关节炎吃什么药| 孕早期生气对胎儿有什么影响| 无印良品属于什么档次| 2月25号是什么星座| 打狗看主人打虎看什么答案| 车牌字体是什么字体| coolmax是什么面料| ace是什么| 补气血喝什么口服液好| emba是什么| 口真念什么| 肺和大肠相表里是什么意思| ab什么意思| 舌头上有裂纹是什么原因| 受用是什么意思| 郁是什么生肖| 费力不讨好是什么生肖| 胃疼喝什么粥| 眼睛总是流泪是什么原因| 女儿茶属于什么茶| 尿黄尿味大难闻是什么原因| 为什么手会发麻| 氨纶丝是什么面料| 丨什么意思| 缘起缘灭是什么意思| 2008年是属什么| 内推是什么意思| 世界上最大的湖是什么湖| 外交是什么意思| hivab是什么检测| 金鱼藻是什么植物| 晚上喝酸奶有什么好处和坏处| ctc是什么意思| 血脂厚有什么症状| 月经期间同房有什么危害| 梦见买鞋子是什么意思| 球蛋白适合什么人打| 年柱将星是什么意思| 9527什么意思| 属鼠的是什么命| 梦见自己得了绝症预示着什么| 什么通便效果最快最好| 什么是疱疹| 什么是环境影响评价| 电瓶车充不进电是什么原因| 黑无常叫什么| 热病是什么病| 五彩绳什么时候扔掉| 眼睛闪光是什么症状| 小五行属性是什么| 女人排卵期什么时候| 无话不谈是什么意思| 吃什么可以让胸部变大| 为什么呀| 子宫偏小有什么影响| 叶黄素是什么| 脚肿是什么病| 海绵体供血不足吃什么药| wifi用户名是什么| 放屁多是什么原因呢| 奇脉见于什么病| 囊胚是什么意思| 短杆菌是什么意思| 大脑供血不足吃什么药最好| 肛裂用什么药治最好效果最快| au750是什么材质| 爱是什么偏旁| 有机和无机是什么意思| 为什么大便不成形| 月经什么颜色的血是正常的| 肌腱是什么| 肌无力是什么病| 海肠是什么动物| 北伐是什么意思| 心动过缓吃什么药最好| 乳腺结节吃什么药好| 阴茎供血不足吃什么药| 清明吃什么| 五大仙家什么仙最厉害| 盐酸舍曲林片治疗什么程度的抑郁| 法盲是什么意思| 八哥吃什么| 运单号是什么| ivu是什么检查| 什么叫同理心| 怀孕16周要做什么检查| 什么是soho| 拔牙后需要注意什么| 卵巢筛查要做什么检查| 孕吐什么时候结束| k9是什么意思| 朝秦暮楚是什么生肖| 罪恶感什么意思| 人体缺钾是什么原因引起的| 岁月的痕迹是什么意思| suki是什么意思| 鼻鼽病是什么意思| 跌宕起伏什么意思| 成吉思汗和忽必烈是什么关系| 2024年属什么生肖| 六点是什么时辰| 什么叫认知| 十一月二十九是什么星座| mts是什么单位| 降息是什么意思| 七十岁是什么之年| 咦惹是什么意思| 免疫球蛋白e高说明什么| 神经性呕吐是什么症状| 逆商是什么| 女人吃什么养颜又美白| 结婚9年是什么婚| 梦到捡菌子是什么意思| 什么鸡最好吃| 双花红棍是什么意思| ipf是什么病| 卤什么东西好吃| 血红蛋白低吃什么| 玫瑰花有什么功效| 耳鸣什么原因引起| 酌情处理是什么意思| 夏天喝盐水有什么好处| bmo是什么意思| 耽美什么意思| 尿道炎吃什么药好| 下午一点半是什么时辰| 花甲是什么意思| 七手八脚是什么意思| jb什么意思| 桫椤是什么植物| 榴莲有什么功效| 为什么会长腋毛| 痈疡是什么意思| 口腔溃疡缺什么维生素| 百度
打印
[STM32H7]

3.15卢比/千瓦时!法国光伏企业创造印度历史最低报价

[复制链接]
1533|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
     STM32H7R7/S7系列是一款基于bootflash的MCU,具有Cortex?-M7内核,运行频率高达600 MHz,拥有64 KB用户bootflash、可灵活配置的620 KB SRAM以及带Flex ECC的32 x 32 KB缓存。STM32H7R7/S7系列支持高速外部存储器接口和XiP,提供5种不同封装,以在极低成本下实现出色性能。专用图形系列可利用NeoChrom GPU、JPEG编解码器和LTDC实现类似MPU的GUI,最大程度减少CPU的介入。
  • Bootflash闪存 STM32H7R7/S7系列MCU配备了64KB的Bootflash(用户Flash),可用于存储用户代码或外部存储器配置。这种设计提供了更大的灵活性和可扩展性。
  • SRAM:MCU还集成了高达620KB的SRAM(其中部分可配置为TCM),支持实时应用中所需的零等待访问。这确保了高速的数据处理能力。
  • 外部存储器接口:MCU提供了高速外部存储器接口,如FMC(支持NAND、NOR、SDRAM的并行接口)和xSPI接口,允许连接任何类型的外部存储器。这种设计使得MCU能够灵活匹配未来不同的应用需求。

Bootflash的MCU具有以下特点:
  • 内置Bootflash存储器:这是Bootflash MCU的核心特色,它提供了可靠的存储空间,用于保存启动代码、配置参数或其他关键数据。这种存储器通常具有较长的数据保持时间,即使在断电的情况下也能保持数据不丢失。
  • 高性能:Bootflash的MCU通常采用高性能的处理器核心,如ARM Cortex-M系列等,具有强大的处理能力和丰富的外设接口。这使得它们能够处理复杂的任务,并满足各种应用需求。
  • 安全性:由于Bootflash存储器中存储了启动代码和其他关键数据,因此Bootflash的MCU通常具有较高的安全性。它们可能采用各种安全机制来保护这些数据,如加密、解密、认证等,以防止未经授权的访问或篡改。
  • 灵活性:Bootflash的MCU提供了灵活的启动选项。例如,它们可能支持从内部存储器(如Bootflash)或外部存储器(如SD卡、eMMC等)启动系统。这种灵活性使得它们能够适应不同的应用场景和需求。
  • 广泛的应用领域:由于Bootflash的MCU具有高性能、安全性和灵活性等特点,它们被广泛应用于各种领域,如工业自动化、智能家居、医疗设备、汽车电子等。在这些领域中,Bootflash的MCU能够发挥重要作用,提高系统的可靠性和稳定性。
   STM32的XIP(eXecute In Place,原地执行)是一种允许代码直接在非易失性存储器(如Flash)中执行的技术,而无需将代码复制到易失性存储器(如SRAM)中。这种执行方式具有一些独特的优点和特性,下面将对其进行详细解释:
一、XIP的基本概念
  XIP技术允许CPU直接从存储代码的存储器(如Flash)中读取并执行指令,而无需先将代码加载到RAM中。这对于资源受限的单片机系统来说尤其重要,因为它可以减少对RAM的需求,从而降低成本并优化系统性能。
二、STM32中的XIP实现
在STM32单片机中,XIP通常通过特定的存储器映射和启动配置来实现。以下是一些关键点:
存储器映射:STM32的存储器架构允许将外部或内部Flash存储器映射到CPU可以访问的地址空间。当使用XIP时,代码被存储在Flash中,并通过存储器映射直接由CPU访问和执行。
启动配置:STM32的启动配置可以通过设置BOOT引脚来选择不同的启动模式。例如,可以选择从主闪存(Flash)启动,或者从系统存储器(通常包含Bootloader)启动。在XIP模式下,通常是从包含代码的Flash区域启动。
中断向量表:在XIP模式下,中断向量表(IVT)通常也存储在Flash中。当CPU响应中断时,它会从IVT中读取中断处理程序的地址,并跳转到相应的处理程序执行。因此,在XIP模式下,IVT的地址必须与Flash中的代码地址相匹配。
三、XIP的优点
减少RAM需求:由于代码直接在Flash中执行,因此无需将代码复制到RAM中。这可以显著减少对RAM的需求,从而降低系统成本。
快速启动:由于代码已经存储在Flash中,并且可以直接执行,因此系统可以更快地启动并运行。
易于更新:由于代码存储在Flash中,因此可以通过简单的编程操作来更新代码,而无需拆卸硬件或更换存储器芯片。
四、XIP的应用场景
XIP技术特别适用于以下场景:
   资源受限的系统:在这些系统中,RAM的容量有限,而Flash存储器则相对充裕。使用XIP可以减少对RAM的需求,从而优化系统性能。
需要快速启动的系统:在这些系统中,启动时间是一个关键因素。使用XIP可以加快启动速度,从而缩短系统的响应时间。
需要频繁更新代码的系统:在这些系统中,代码需要经常更新以修复漏洞或添加新功能。使用XIP可以通过简单的编程操作来更新代码,而无需拆卸硬件。
代码分析:
  STM32CubeH7RS软件包中提供了XIP项目模板,项目专有文件位于子目录。Projects\STM32H7S78-DK\Templates\Template_XIP


项目表述
Templates_XIP Example Description</b>

- This project provides a reference template based on the STM32Cube HAL API that can be used
to build any firmware application to execute from external Flash (Sub-project Appli). It boots from internal Flash
and jumps to the application code in external Flash (Sub-project Boot).
- This project is targeted to run on STM32H7S7xx device on STM32H7S78-DK board from STMicroelectronics.
At the beginning of the main program, the HAL_Init() function is called to reset
all the peripherals and initialize the systick used as 1ms HAL timebase.
- This project runs from the external Flash memory. It is launched from a first boot stage and inherits from this boot project
configuration (caches, MPU regions [regions 0, 1 and 2 here], system clock at 600 MHz and external memory interface at the highest speed).
Note that the boot part is automatically downloaded from the IDE environment via the board project Templates/Template_XIP/Binary/Boot_XIP.hex file.
- The template project calls also SCB_EnableICache() and SCB_EnableDCache() functions in order to enable
the Layer 1 Core Instruction and Data Caches. This is provided as template implementation that the User may
integrate in his application in order to enhance the performance.

#### <b>Notes</b>

1. Care must be taken when using HAL_Delay(), this function provides accurate delay (in milliseconds)
    based on variable incremented in SysTick ISR. This implies that if HAL_Delay() is called from
    a peripheral ISR process, then the SysTick interrupt must have higher priority (numerically lower)
    than the peripheral interrupt. Otherwise the caller ISR process will be blocked.
    To change the SysTick interrupt priority you have to use HAL_NVIC_SetPriority() function.

2. The application needs to ensure that the SysTick time base is always set to 1 millisecond
    to have correct HAL operation.

3. Whenever the application is using ITCM/DTCM memories (@0x0000000 / @0x20000000: not cacheable and only accessible
    by the Cortex M7 and the GPDMA/HPDMA), there is no need for cache maintenance.
    If the application needs to put DMA buffers in AXI SRAM (starting from @0x24000000), the user has to:
    - either define a non-cacheable region in the MPU and linker configuration file to locate DMA buffers
      (a proposed noncacheable_buffer section is available from CMSIS Device linker template file and its size must
      be adapted to the application requirements)
    - or to ensure cache maintenance operations to ensure the cache coherence between the CPU and the DMAs.
    This is true also for any other data buffers accessed by the CPU and other masters (DMA2D, LTDC).
    The addresses and the size of cacheable buffers (shared between CPU and other masters)
    must be properly defined to be aligned to data cache line size (32 bytes) and of a size of being multiple
    of this cache line size.
    Please refer to the AN4838 "Managing memory protection unit (MPU) in STM32 MCUs".
    Please refer to the AN4839 "Level 1 cache on STM32F7 Series".

### <b>Keywords</b>

Reference, Template, Boot, Loader, XiP

### <b>Directory contents</b>

#### <b>Sub-project Boot</b>

File | Description
--- | ---
  Templates/Template_XIP/Boot/Inc/main.h                       |  Header for main.c module
  Templates/Template_XIP/Boot/Inc/extmem_manager.h             |  Header for extmem_manager.c module
  Templates/Template_XIP/Boot/Inc/stm32h7rsxx_hal_conf.h       |  HAL Configuration file
  Templates/Template_XIP/Boot/Inc/stm32h7rsxx_it.h             |  Interrupt handlers header file
  Templates/Template_XIP/Boot/Inc/stm32h7s78_discovery_conf.h  |  BSP Configuration file
  Templates/Template_XIP/Boot/Inc/stm32_extmem_conf.h          |  External memory manager Configuration file
  Templates/Template_XIP/Boot/Src/main.c                       |  Main program
  Templates/Template_XIP/Boot/Src/extmem_manager.c             |  code to initialize external memory
  Templates/Template_XIP/Boot/Src/stm32h7rsxx_hal_msp.c        |  HAL MSP module
  Templates/Template_XIP/Boot/Src/stm32h7rsxx_it.c             |  Interrupt handlers
  Templates/Template_XIP/Boot/Src/system_stm32h7rsxx.c         |  STM32H7RSxx system source file

#### <b>Sub-project Appli</b>

File | Description
--- | ---
  Templates/Template_XIP/Appli/Inc/main.h                      |  Header for main.c module
  Templates/Template_XIP/Appli/Inc/stm32h7rsxx_hal_conf.h      |  HAL Configuration file
  Templates/Template_XIP/Appli/Inc/stm32h7rsxx_it.h            |  Interrupt handlers header file
  Templates/Template_XIP/Appli/Inc/stm32h7s78_discovery_conf.h |  BSP Configuration file
  Templates/Template_XIP/Appli/Src/main.c                      |  Main program
  Templates/Template_XIP/Appli/Src/stm32h7rsxx_hal_msp.c       |  HAL MSP module
  Templates/Template_XIP/Appli/Src/stm32h7rsxx_it.c            |  Interrupt handlers
  Templates/Template_XIP/Appli/Src/system_stm32h7rsxx.c        |  STM32H7RSxx system source file

#### <b>Sub-project ExtMemLoader</b>

File | Description
--- | ---
  Templates/Template_XIP/ExtMemLoader/Inc/extmem_manager.h             |  Header for extmem_manager.c module
  Templates/Template_XIP/ExtMemLoader/Inc/extmemloader_init.h          |  Header for system initialization
  Templates/Template_XIP/ExtMemLoader/Inc/stm32_extmem_conf.h          |  External memory manager Configuration file
  Templates/Template_XIP/ExtMemLoader/Inc/stm32_extmemloader_conf.h    |  Header with externam memory device information
  Templates/Template_XIP/ExtMemLoader/Inc/stm32h7rsxx_hal_conf.h       |  HAL Configuration file
  Templates/Template_XIP/ExtMemLoader/Src/extmem_manager.c             |  code to initialize external memory
  Templates/Template_XIP/ExtMemLoader/Src/extmemloader_init.c          |  code to perform system initialization
  Templates/Template_XIP/ExtMemLoader/Src/stm32h7rsxx_hal_msp.c        |  HAL MSP module
  Templates/Template_XIP/ExtMemLoader/Src/system_stm32h7rsxx.c         |  STM32H7RSxx system source file
  Templates/Template_XIP/ExtMemLoader/Config/extmemloader.board        |  Configuration file
  Templates/Template_XIP/ExtMemLoader/Config/extmemloader.flash        |  Configuration file
  Templates/Template_XIP/ExtMemLoader/Config/extmemloader.mac          |  Configuration file

### <b>Hardware and Software environment</b>

  - This template runs on STM32H7S7xx devices.

  - This template has been tested with STMicroelectronics STM32H7S78-DK
    boards and can be easily tailored to any other supported device
    and development board.

  - On STM32H7S78-DK board, the BOOT0 mechanical slide switch must be set to SW1.

  - User Option Bytes requirement (with STM32CubeProgrammer tool):

    - XSPI1_HSLV=1     I/O XSPIM_P1 High speed option enabled
    - XSPI2_HSLV=1     I/O XSPIM_P2 High speed option enabled
    - VDDIO_HSLV=0     I/O speed optimized to operate at 3.3V

### <b>How to use it ?</b>

In order to make the program work, you must do the following:

#### <b>IAR</b>
  1. Open your toolchain
  2. Open Multi-projects workspace file Project.eww

> <b>Optional:</b>
>
> - Select first "Template_XIP_Boot" workspace
> - Rebuild all files from sub-project Boot
> - If no modification is done on boot project, this step could be skipped.

  3. Select then "Template_XIP_Appli" workspace
  4. Rebuild all files from sub-project Appli and load your images into memories: This sub-project
     will first load the Appli part in External memory available on STM32H7S78-DK board, then load
     the Template_XIP_Boot.hex in internal Flash.
  5. Run the example

NB: For this target, following switches are set in C/C++ preprocessor settings:

- STM32_EXTMEMLOADER_EWARMTARGET
- STM32_EXTMEMLOADER_STM32CUBETARGET_NA
- STM32_EXTMEMLOADER_STM32CUBEOPENBLTARGET_NA

#### <b>MDK-ARM</b>
  1. Open your toolchain
  2. Open Multi-projects workspace file Project.uvmpw

> <b>Optional:</b>
>
> - Select first "Template_XIP_Boot" workspace
> - Rebuild all files from sub-project Boot
> - If no modification is done on boot project, this step could be skipped.

  3. Select then "Template_XIP_Appli" workspace
  4. Rebuild all files from sub-project Appli and load your images into memories: This sub-project
     will first load the Appli part in External memory available on STM32H7S78-DK board, then load
     the Boot_XIP.hex in internal Flash.
  5. Run the example

NB: For this target, following switches are set in C/C++
preprocessor settings:

- STM32_EXTMEMLOADER_MDKARMTARGET
- STM32_EXTMEMLOADER_STM32CUBETARGET_NA
- STM32_EXTMEMLOADER_STM32CUBEOPENBLTARGET_NA

#### <b>STM32CubeIDE</b>
  1. Open your toolchain
  2. Open Multi-projects workspace file .project

> <b>Optional:</b>
>
> - Select the "Template_XIP_Boot" project
> - Build the project
> - If the project is not compiled, Appli debugging will manage its compilation
>   for debugging
> - With the debug icon select the configuration “Template_XIP_Boot Debug”.
>   This operation loads the boot in internal Flash.

  3. Select the "Template_XIP_Appli" project
  4. Build the project
  5. With the Debug icon select the configuration “Template_XIP_Appli Debug”. This sub-project
     will first load the Boot binary in internal Flash, then load the Appli binary in
     External memory available on STM32H7S78-DK board
  6. Run the example


#### <b>STM32CubeProgrammer</b>

> The ExtMemLoader project uses an environment variable to copy the generated stdlr file inside
> the cube programmer tool.
> This variable is defined by the tool during its installation but if the version used does not
> include this functionality, the environment variable can be declared manually.
>
> STM32_PRG_PATH=C:/Program Files/STMicroelectronics/STM32Cube/STM32CubeProgrammer/bin

When targeting to build ExtMemLoader to be used in Cubepogrammer, please ensure the following switches are set in C/C++ preprocessor settings:

- STM32_EXTMEMLOADER_EWARMTARGET_NA
- STM32_EXTMEMLOADER_STM32CUBETARGET
- STM32_EXTMEMLOADER_STM32CUBEOPENBLTARGET_NA


#### <b>External memory programming using BootLoader Interfaces</b>

> When using a bootloader interface such as USB or USART, the standard ExtMemLoader cannot be used.
>Instead, a specific ExtMemLoader must be built for use with OpenBootloader. To accomplish this, you should carry out the following steps:
>
>- Modify the target switches in the C/C++ preprocessor settings to:
>
>   - STM32_EXTMEMLOADER_EWARMTARGET_NA
>   - STM32_EXTMEMLOADER_STM32CUBETARGET
>   - STM32_EXTMEMLOADER_STM32CUBEOPENBLTARGET
>- Choose the appropriate file for your linker script based on the file extension (.sct, .ld, or .icf). The file should be renamed to match the following pattern, depending on the extension:
>   * stm32h7rsxx_extmemloader_stm32cubeopenbl.sct
>   * stm32h7rsxx_extmemloader_stm32cubeopenbl.ld
>   * stm32h7rsxx_extmemloader_stm32cubeopenbl.icf
>- The initialization section of extmemloader_init() should be updated as follows:
>
>      #if !defined(STM32_EXTMEMLOADER_STM32CUBEOPENBLTARGET)
>
>      /* Init system */
>      SystemInit();
>
>      /* disable all the IRQ */
>
>      __disable_irq();
>
>      /* MCU Configuration--------------------------------------------------------*/
>
>      /* Enable the CPU Cache */
>
>      /* Enable I-Cache---------------------------------------------------------*/
>
>      SCB_EnableICache();
>
>      /* Enable D-Cache---------------------------------------------------------*/
>
>      SCB_EnableDCache();
>
>      /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
>
>      HAL_Init();
>
>      /* USER CODE BEGIN Init */
>
>      /* USER CODE END Init */
>
>      /* Configure the system clock  */
>
>      SystemClock_Config();
>
>      #else
>      /* Reset of all peripherals, Initializes the Flash interface. */
>
>      __HAL_RCC_SBS_CLK_ENABLE();
>
>      /* System interrupt init*/
>
>      /* Enable the XSPIM_P2 interface */
>
>      HAL_PWREx_EnableXSPIM2();
>
>      /* high speed low voltage config */
>
>      HAL_SBS_EnableIOSpeedOptimize(SBS_IO_XSPI1_HSLV);
>
>      HAL_SBS_EnableIOSpeedOptimize(SBS_IO_XSPI2_HSLV);
>
>      #endif
本项目提供了一个基于 STM32Cube HAL API 的参考模板,可用于构建任何固件应用程序以从外部闪存执行(子项目应用程序)。它从内部 Flash 启动,并跳转到外部 Flash 中的应用程序代码(子项目启动)。 本项目提供了一个基于 STM32Cube HAL API 的参考模板,可用于构建任何固件应用程序以从外部闪存执行(子项目应用程序)。它从内部 Flash 启动,并跳转到外部 Flash 中的应用程序代码(子项目启动)。

该项目的目标是在 STMicroelectronics 的 STM32H7S78-DK 板上的 STM32H7S7xx 器件上运行。在主程序开始时,调用 HAL_Init() 函数来重置所有外围设备并初始化用作 1ms HAL 时基的系统。 该项目的目标是在 STMicroelectronics 的 STM32H7S78-DK 板上的 STM32H7S7xx 器件上运行。在主程序开始时,调用 HAL_Init() 函数来重置所有外围设备并初始化用作 1ms HAL 时基的系统。

此项目从外部 Flash 存储器运行。它从第一个引导阶段启动,并继承自此引导项目配置(缓存、MPU 区域 [此处为区域 0、1 和 2]、600 MHz 的系统时钟和最高速度的外部存储器接口)。请注意,引导部件是通过板项目 Templates/Template_XIP/Binary/Boot_XIP.hex 文件从 IDE 环境自动下载的。 此项目从外部 Flash 存储器运行。它从第一个引导阶段启动,并继承自此引导项目配置(缓存、MPU 区域 [此处为区域 0、1 和 2]、600 MHz 的系统时钟和最高速度的外部存储器接口)。请注意,引导部件是通过板项目 Templates/Template_XIP/Binary/Boot_XIP.hex 文件从 IDE 环境自动下载的。

模板项目还调用 SCB_EnableICache() 和 SCB_EnableDCache() 函数,以启用第 1 层内核指令和数据缓存。这是作为模板实现提供的,用户可以将其集成到其应用程序中以提高性能。 模板项目还调用 SCB_EnableICache() 和 SCB_EnableDCache() 函数,以启用第 1 层内核指令和数据缓存。这是作为模板实现提供的,用户可以将其集成到其应用程序中以提高性能。

Notes 注意
使用 HAL_Delay() 时必须小心,此函数根据 SysTick ISR 中递增的变量提供准确的延迟(以毫秒为单位)。这意味着,如果 HAL_Delay() 是从外围 ISR 进程调用的,则 SysTick 中断必须具有比外围中断更高的优先级(数值上更低)。否则,调用方 ISR 进程将被阻止。要更改 SysTick 中断优先级,您必须使用 HAL_NVIC_SetPriority() 函数。 使用 HAL_Delay() 时必须小心,此函数根据 SysTick ISR 中递增的变量提供准确的延迟(以毫秒为单位)。这意味着,如果 HAL_Delay() 是从外围 ISR 进程调用的,则 SysTick 中断必须具有比外围中断更高的优先级(数值上更低)。否则,调用方 ISR 进程将被阻止。要更改 SysTick 中断优先级,您必须使用 HAL_NVIC_SetPriority() 函数。
应用程序需要确保 SysTick 时基始终设置为 1 毫秒,才能执行正确的 HAL 操作。 应用程序需要确保 SysTick 时基始终设置为 1 毫秒,才能执行正确的 HAL 操作。
每当应用程序使用 ITCM/DTCM 内存(@0x0000000 / @0x20000000:不可缓存,只能由 Cortex M7 和 GPDMA/HPDMA 访问)时,就不需要缓存维护。如果应用程序需要将 DMA 缓冲区放入 AXI SRAM 中(从 @0x24000000 开始),用户必须: 每当应用程序使用 ITCM/DTCM 内存(@0x0000000 / @0x20000000:不可缓存,只能由 Cortex M7 和 GPDMA/HPDMA 访问)时,无需缓存维护。如果应用程序需要将 DMA 缓冲区放入 AXI SRAM 中(从 @0x24000000 开始),用户必须:
在 MPU 和链接器配置文件中定义不可缓存区域以查找 DMA 缓冲区(CMSIS 设备链接器模板文件中提供了建议的 noncacheable_buffer 部分,其大小必须适应应用程序要求) 在 MPU 和链接器配置文件中定义不可缓存区域以查找 DMA 缓冲区(CMSIS 设备链接器模板文件中提供了建议的 noncacheable_buffer 部分,其大小必须适应应用程序要求)
或确保缓存维护操作,以确保 CPU 和 DMA 之间的缓存一致性。这也适用于 CPU 和其他主站(DMA2D、LTDC)访问的任何其他数据缓冲区。地址和可缓存缓冲区的大小(在 CPU 和其他 masters之间共享)必须正确定义,以便与数据缓存行大小(32 字节)保持一致,并且大小是此缓存行大小的倍数。请参阅 AN4838“在 STM32 MCU 中管理内存保护单元 (MPU)”。请参阅 AN4839 “STM32F7 系列上的 1 级缓存”。 或确保缓存维护操作,以确保 CPU 和 DMA 之间的缓存一致性。这也适用于 CPU 和其他主站(DMA2D、LTDC)访问的任何其他数据缓冲区。地址和可缓存缓冲区的大小(在 CPU 和其他 masters之间共享)必须正确定义,以便与数据缓存行大小(32 字节)保持一致,并且大小是此缓存行大小的倍数。请参阅 AN4838“在 STM32 MCU 中管理内存保护单元 (MPU)”。请参阅 AN4839 “STM32F7 系列上的 1 级缓存”。
针对核心代码:
void MX_EXTMEM_MANAGER_Init(void)
{

  /* USER CODE BEGIN MX_EXTMEM_Init_PreTreatment */

  /* USER CODE END MX_EXTMEM_Init_PreTreatment */
  HAL_RCCEx_DisableClockProtection(RCC_CLOCKPROTECT_XSPI);

  /* Initialization of the memory parameters */
  memset(extmem_list_config, 0x0, sizeof(extmem_list_config));

  /* EXTMEMORY_1 */
  extmem_list_config[0].MemType = EXTMEM_NOR_SFDP;
  extmem_list_config[0].Handle = (void*)&hxspi2;
  extmem_list_config[0].ConfigType = EXTMEM_LINK_CONFIG_8LINES;

  EXTMEM_Init(EXTMEMORY_1, HAL_RCCEx_GetPeriphCLKFreq(RCC_PERIPHCLK_XSPI2));

  /* USER CODE BEGIN MX_EXTMEM_Init_PostTreatment */

  /* USER CODE END MX_EXTMEM_Init_PostTreatment */
}




BootROM 模型基于从选定的易失性存储器中执行代码。当二进制数据存储在非内存映射模式的存储器(比SDCARD)中时,该执行模型非常适合。当二进制数据存储在低吞吐量的存储器(比如 SPI-NOR(使用单线 QSPI进行仿真))中时,此模型也适用。外部存储器启动应用程序基于 memory.h 文件中的用户配置对下列其中两个易失存储器进行配置:SDRAM、SRAM、PSRAM 或内部 SRAM。在该模型中,二进制数据从一个非易失性存储器复制到一个易失性存储器,然后由外部存储器启动应用程序执行。第二个易失性存储器用于数据。
下面的流程图说明了 BootROM 模型的操作流程:






附件文件为原理详细解读,会用即可,原理理解需要假以时日。
外部代码执行原理.pdf (1.32 MB)



沙发
星辰大海不退缩| | 2024-10-8 22:19 | 只看该作者
MCU还集成了高达620KB的SRAM
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

认证:项目经理
简介:资深嵌入式开发工程师

95

主题

181

帖子

3

粉丝
丙氨酸氨基转移酶高是什么原因 什么是情劫 吃什么升血小板最快最好 上挂是什么意思 喜讯是什么意思
黄花菜都凉了是什么意思 食指发麻是什么原因 结肠炎吃什么食物好 epo是什么意思 秋天能干什么
情绪波动是什么意思 什么事每人每天都必须认真的做 做腋臭手术挂什么科室 头晕吃什么食物好 胱抑素是什么
失眠是什么原因导致的 什么玉最好有灵性养人 什么是业障 满族八大碗都有什么菜 红艳煞是什么意思
皋读什么hcv8jop7ns3r.cn 放飞自我是什么意思hcv8jop1ns0r.cn gpd是什么意思hcv7jop9ns8r.cn c1是什么意思hcv8jop3ns5r.cn 贫血是什么原因0297y7.com
阳历1月份是什么星座mmeoe.com 女性得乙肝有什么症状hcv8jop5ns3r.cn 鹿茸和什么泡酒壮阳hcv7jop9ns9r.cn 肌肉劳损用什么药hcv9jop1ns7r.cn 角化棘皮瘤是什么病hcv9jop4ns2r.cn
光年是什么单位hcv9jop2ns6r.cn 精神支柱是什么意思hcv7jop9ns5r.cn 什么牌子的护肝药最好hcv9jop5ns5r.cn 高血压吃什么中药hcv7jop9ns8r.cn 宫颈炎吃什么药好得快hcv8jop2ns3r.cn
人乳头瘤病毒是什么hcv8jop9ns9r.cn 落叶像什么飘落下来hcv8jop6ns8r.cn 1970属什么hcv7jop9ns5r.cn 南北朝后面是什么朝代hcv9jop8ns3r.cn 为什么生理期不能做huizhijixie.com
百度