stm32 :No section matches selector - no section to be FIRST/LAST

本文解析了一个关于STM32开发过程中出现的错误L6236E,并提供了详细的解决方案。错误通常发生在未正确配置启动文件startup_stm32f10x_md.s的情况下,该文件对于初始化SP和PC、设置中断向量表等至关重要。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1) ..\OBJ\(文件名).sct(7): error: L6236E: No section matches selector - no section to be FIRST/LAST.
解决:


错误定位到文件 (文件名).sct:


; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************


LR_IROM1 0x08000000 0x00080000  {    ; load region size_region
  ER_IROM1 0x08000000 0x00080000  {  ; load address = execution address
   *.o (RESET, +First)     ;====================>错误定位
   *(InRoot$$Sections)
   .ANY (+RO)
  }
  RW_IRAM1 0x20000000 0x0000C000  {  ; RW data
   .ANY (+RW +ZI)
  }
}

分析:

 (文件名).sct:文件对程序存储在rom的位置做了指定.在开发环境Keil uVision3中,可以在这里选择位置:




解决:
没有添加startup_stm32f10x_md.s 文件,或者该文件选择错误
在keil中 添加文件时,默认的是*.C文件 ,这样.s的文件就添加不上,所以会报错。 应该将文件类型选为*.* 就能全部添加了


startup_stm32f10x_md.s文件的作用:
* Description        : STM32F10x High Density Devices vector table for MDK-ARM 
;*                      toolchain. 
;*                      This module performs:
;*                      - Set the initial SP
;*                      - Set the initial PC == Reset_Handler
;*                      - Set the vector table entries with the exceptions ISR address
;*                      - Configure the clock system and also configure the external 
;*                        SRAM mounted on STM3210E-EVAL board to be used as data 
;*                        memory (optional, to be enabled by user)
;*                      - Branches to __main in the C library (which eventually
;*                        calls main()).
;*                      After Reset the CortexM3 processor is in Thread mode,
;*                      priority is Privileged, and the Stack is set to Main.



评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值