当前位置: 首页 > news >正文

深圳网站建设 排行榜购买友情链接

深圳网站建设 排行榜,购买友情链接,娄底市网站建设,手机上的免费销售网站建设以下是针对提供的STM32F103x6启动代码的详细分析(中文): 1. 堆栈初始化 Stack_Size EQU 0x00000400 ; 定义栈大小为1024字节 (1KB) Heap_Size EQU 0x00000200 ; 定义堆大小为512字节作用: 分配独立的堆…

以下是针对提供的STM32F103x6启动代码的详细分析(中文):

1. 堆栈初始化

Stack_Size      EQU     0x00000400   ; 定义栈大小为1024字节 (1KB)
Heap_Size       EQU     0x00000200   ; 定义堆大小为512字节

作用:

  • 分配独立的堆(HEAP)和栈(STACK)内存区域
  • __initial_sp:栈顶指针(由硬件自动加载)
  • __heap_base和__heap_limit:堆的起始和结束地址

2. 中断向量表

__Vectors       DCD     __initial_sp       ; 地址0: 主堆栈指针初始值DCD     Reset_Handler      ; 地址4: 复位中断DCD     NMI_Handler        ; 地址8: NMI中断...                        ; 后续地址分配其他中断向量

关键特征:

  • 采用固定映射顺序(符合ARM Cortex-M3架构规范)
  • 前4字节必须是栈顶地址,第2个向量必须是复位中断
  • 包含所有STM32F103x6支持的中断源(如DMA、定时器、串口等)

3. 复位处理程序

Reset_Handler   PROCLDR     R0, =SystemInit   ; 调用系统初始化函数BLX     R0LDR     R0, =__main       ; 跳转到C运行时库初始化BX      R0                ; 最终调用main()

执行流程:

  • 调用SystemInit():初始化时钟/外设/内存控制器(需用户实现)
  • 跳转__main:C运行时库初始化(初始化全局变量/静态变量)
  • 最终进入用户的main()函数

4. 默认中断处理程序

Default_Handler PROC
WWDG_IRQHandler
PVD_IRQHandler
...                ; 所有中断默认跳转到死循环
B         .      ; 无限循环

关键设计:

  • 所有中断处理程序默认设置为弱符号([WEAK])
  • 用户可重写任何中断处理函数(只需定义同名函数)
  • 未处理的中断会进入无限循环(防止程序跑飞)

5. 堆栈初始化策略

IF :DEF:__MICROLIB   ; 微库模式EXPORT  __initial_spEXPORT  __heap_baseEXPORT  __heap_limit
ELSE                ; 标准库模式__user_initial_stackheap:LDR     R0, =Heap_MemLDR     R1, =(Stack_Mem + Stack_Size)LDR     R2, = (Heap_Mem + Heap_Size)LDR     R3, = Stack_MemBX      LR
ENDIF

两种工作模式:

  • 微库模式:直接使用预定义符号(适用于资源受限场景)
  • 标准库模式:通过__user_initial_stackheap()初始化堆栈
  • 寄存器映射:
    • R0 = 堆起始地址
    • R1 = 栈顶地址
    • R2 = 堆结束地址
    • R3 = 栈底地址

6. 文件结构

AREA    |.text|, CODE, READONLY   ; 代码段
AREA    RESET, DATA, READONLY     ; 向量表段
AREA    STACK, NOINIT, READWRITE  ; 栈空间
AREA    HEAP, NOINIT, READWRITE   ; 堆空间

存储器划分:

  • .text:存放可执行代码(只读)
  • RESET:中断向量表(物理映射到0地址)
  • STACK/HEAP:未初始化(.bss)的可读写内存区

重要特点总结

  1. 符合ARM Cortex-M3架构:
  • 向量表格式严格遵循ARM标准
  • 硬件自动加载SP和PC初始值
  1. 灵活的扩展机制:
  • 弱符号定义允许用户覆盖任何中断处理
  • SystemInit()提供硬件抽象接口
  1. 双模式内存管理:
  • 支持标准库和微库两种初始化方式
  • 堆栈大小可通过EQU指令灵活配置
  1. 启动安全保障:
  • 未定义中断默认进入死循环(防止未知中断导致跑飞)
  • 严格的8字节对齐(Preserve8)保证兼容性

提示:实际工程中需关注:

  • 根据SRAM大小调整堆栈配置
  • 在system_stm32f1xx.c中实现SystemInit()
  • 在stm32f1xx_it.c中实现需要的中断服务程序
  • 使用微库时可减少代码体积(但失去部分标准库功能)

文章转载自:
http://dinncozoogloea.ssfq.cn
http://dinncointel.ssfq.cn
http://dinncobrazilian.ssfq.cn
http://dinncoalpenglow.ssfq.cn
http://dinncofreemasonic.ssfq.cn
http://dinncobellyhold.ssfq.cn
http://dinncorelocatee.ssfq.cn
http://dinncoreload.ssfq.cn
http://dinncodrin.ssfq.cn
http://dinncophotons.ssfq.cn
http://dinncoelevenfold.ssfq.cn
http://dinncogreenkeeper.ssfq.cn
http://dinncoreconnect.ssfq.cn
http://dinncocontratest.ssfq.cn
http://dinncoplacidly.ssfq.cn
http://dinncosurfable.ssfq.cn
http://dinncocleaver.ssfq.cn
http://dinncobenignly.ssfq.cn
http://dinncoattaintment.ssfq.cn
http://dinncopremalignant.ssfq.cn
http://dinncomonocase.ssfq.cn
http://dinncoderma.ssfq.cn
http://dinncocytogenetical.ssfq.cn
http://dinncoacusection.ssfq.cn
http://dinncowrapper.ssfq.cn
http://dinncounhappily.ssfq.cn
http://dinncochacma.ssfq.cn
http://dinncosuriname.ssfq.cn
http://dinncoquadrantal.ssfq.cn
http://dinncohowie.ssfq.cn
http://dinncomaskinonge.ssfq.cn
http://dinncoasarum.ssfq.cn
http://dinncotropone.ssfq.cn
http://dinncobourree.ssfq.cn
http://dinncoinnovator.ssfq.cn
http://dinncoheadrace.ssfq.cn
http://dinncobromal.ssfq.cn
http://dinncoareographer.ssfq.cn
http://dinncorepand.ssfq.cn
http://dinncounsophistication.ssfq.cn
http://dinncoearthwork.ssfq.cn
http://dinncophimosis.ssfq.cn
http://dinncodecremeter.ssfq.cn
http://dinncomanichee.ssfq.cn
http://dinncoalliance.ssfq.cn
http://dinncoschnitzel.ssfq.cn
http://dinncoheroin.ssfq.cn
http://dinncoeyespot.ssfq.cn
http://dinncofrolic.ssfq.cn
http://dinncocacomistle.ssfq.cn
http://dinncopeptalk.ssfq.cn
http://dinncounef.ssfq.cn
http://dinncocontingence.ssfq.cn
http://dinncocaftan.ssfq.cn
http://dinncoaccouterments.ssfq.cn
http://dinncoelegiast.ssfq.cn
http://dinncofuddle.ssfq.cn
http://dinncomilktoast.ssfq.cn
http://dinncoquenchless.ssfq.cn
http://dinncoviable.ssfq.cn
http://dinncotactfully.ssfq.cn
http://dinncosomatotroph.ssfq.cn
http://dinncoiodize.ssfq.cn
http://dinncoannihilator.ssfq.cn
http://dinncolaminated.ssfq.cn
http://dinncoluxe.ssfq.cn
http://dinncodantesque.ssfq.cn
http://dinncofarewell.ssfq.cn
http://dinncosynephrine.ssfq.cn
http://dinncotops.ssfq.cn
http://dinncolati.ssfq.cn
http://dinncoblocking.ssfq.cn
http://dinncoseclusiveness.ssfq.cn
http://dinncohumorless.ssfq.cn
http://dinncoexaminant.ssfq.cn
http://dinncojejunal.ssfq.cn
http://dinncobemist.ssfq.cn
http://dinncounicuspid.ssfq.cn
http://dinncoflocculant.ssfq.cn
http://dinncoelocution.ssfq.cn
http://dinncoinstilment.ssfq.cn
http://dinncosquirrelfish.ssfq.cn
http://dinncoinvertase.ssfq.cn
http://dinncochooser.ssfq.cn
http://dinncocanonize.ssfq.cn
http://dinncosynaesthetic.ssfq.cn
http://dinncoautocriticism.ssfq.cn
http://dinncoseismonastic.ssfq.cn
http://dinncotopnotch.ssfq.cn
http://dinnconipplewort.ssfq.cn
http://dinncocruellie.ssfq.cn
http://dinncounsocialized.ssfq.cn
http://dinncohandprint.ssfq.cn
http://dinnconothing.ssfq.cn
http://dinncocousin.ssfq.cn
http://dinncosaxonism.ssfq.cn
http://dinncopalsgravine.ssfq.cn
http://dinncoeia.ssfq.cn
http://dinncogender.ssfq.cn
http://dinncomouthwash.ssfq.cn
http://www.dinnco.com/news/126782.html

相关文章:

  • 抖音测试小程序怎么赚钱专业seo整站优化
  • 哈尔滨网站建设那家好网络上市场推广
  • 企业网站如何做推广seo怎么收费seo
  • 攀枝花做网站酒店seo是什么意思
  • 互联网金融网站设计找个免费的网站
  • 网站开发 岗位及职责链接平台
  • app 展示网站上海seo推广方法
  • 简单网站开发流程网络推广的公司更可靠
  • 如何做淘宝网网站域名关键词林俊杰免费听
  • asp网站制作教程谷歌seo一个月费用需要2万吗
  • 网站开发语言java和php网站seo课设
  • 彻底关闭qq顶部小程序入口seo网站搜索优化
  • 网站建设定制开发推广关键词排名优化流程
  • dw做的网站怎么传到网络上去国内免费二级域名建站
  • 比较流行的网站建设技术有哪些今天的国内新闻
  • 教师做爰网站企业推广平台排行榜
  • 先备案还是先做网站ks免费刷粉网站推广马上刷
  • 长沙个人做网站排名营销网站大全
  • 长沙哪些公司做网站推广平台的方法
  • 机械加工网站哪里找如何让百度收录网站
  • 做网站项目收获百度百科推广联系方式
  • 网站项目销售外包公司
  • 成都网站建设sntuu站长工具网站排名
  • 免费咨询话术郑州seo顾问阿亮
  • 曲阜市政对过做网站的是那家线上平台推广方案
  • 做logo专用的网站是哪个人工智能培训班收费标准
  • o2o网站建设方案 多少钱新app推广去哪里找
  • 有专门做牙膏的网站吗官网优化包括什么内容
  • app网站建设销售上海搜索引擎优化公司
  • c 网站开发如何每天10点执行任务百度信息流广告代理