关于STM32F103系列从大容量向中容量移植的若干问题

本文介绍了将STM32F103大容量型号的程序移植到STM32F103C8T6的具体步骤,并解决了在此过程中遇到的uCOSIII内核链接错误问题。

一、把STM32F103大容量移植到STM32F103C8T6上的步骤:

1、换启动文件

startup_stm32f10x_cl.s           ——互联型的器件

包括:STM32F105xx,STM32F107xx

startup_stm32f10x_hd.s        ——大容量器件

包括:STM32F101xx,STM32F102xx,STM32F103xx

startup_stm32f10x_hd_vl.s    ——大容量器件

包括:STM32F100xx

startup_stm32f10x_ld.s          ——小容量器件

包括:STM32F101xx,STM32F102xx,STM32F103xx

startup_stm32f10x_ld_vl.s      ——小容量器件

包括:STM32F100xx

startup_stm32f10x_md.s        ——中容量器件

包括:STM32F101xx,STM32F102xx,STM32F103xx

startup_stm32f10x_md_vl.s    ——中容量器件

 

- startup_stm32f10x_ld_vl.s: for STM32 Low density Value line devices 
- startup_stm32f10x_ld.s: for STM32 Low density devices 
- startup_stm32f10x_md_vl.s: for STM32 Medium density Value line devices 
- startup_stm32f10x_md.s: for STM32 Medium density devices 
- startup_stm32f10x_hd.s: for STM32 High density devices 
- startup_stm32f10x_xl.s: for STM32 XL density devices 
- startup_stm32f10x_cl.s: for STM32 Connectivity line devices 
cl:互联型产品,stm32f105/107系列 
vl:超值型产品,stm32f100系列 
xl:超高密度产品,stm32f101/103系列
ld:低密度产品,FLASH小于64K 
md:中等密度产品,FLASH=64 or 128 
hd:高密度产品,FLASH大于128

 

2、修改Device 为 STM32F103C8T6

3、更换全局宏定义

 

在C/C++选项卡内 修改为STM32F10X_MD,USE_STDPERIPH_DRIVER

 

 

二、移植uCOS III内核到C8T6过程中会遇到

linking...
.\Objects\ucos-led.axf: Error: L6406E: No space in execution regions with .ANY selector matching lib_mem.o(.bss).
.\Objects\ucos-led.axf: Error: L6406E: No space in execution regions with .ANY selector matching os_cfg_app.o(.bss).
.\Objects\ucos-led.axf: Error: L6406E: No space in execution regions with .ANY selector matching os_var.o(.bss).
.\Objects\ucos-led.axf: Error: L6406E: No space in execution regions with .ANY selector matching startup_stm32f10x_hd.o(STACK).
.\Objects\ucos-led.axf: Error: L6406E: No space in execution regions with .ANY selector matching app.o(.bss).
.\Objects\ucos-led.axf: Error: L6406E: No space in execution regions with .ANY selector matching os_var.o(.data).
.\Objects\ucos-led.axf: Error: L6406E: No space in execution regions with .ANY selector matching cpu_core.o(.data).
.\Objects\ucos-led.axf: Error: L6406E: No space in execution regions with .ANY selector matching stm32f10x_rcc.o(.data).
.\Objects\ucos-led.axf: Error: L6406E: No space in execution regions with .ANY selector matching cpu_core.o(.bss).
.\Objects\ucos-led.axf: Error: L6406E: No space in execution regions with .ANY selector matching lib_mem.o(.data).
.\Objects\ucos-led.axf: Error: L6406E: No space in execution regions with .ANY selector matching os_prio.o(.data).
.\Objects\ucos-led.axf: Error: L6406E: No space in execution regions with .ANY selector matching os_cpu_c.o(.data).
.\Objects\ucos-led.axf: Error: L6407E: Sections of aggregate size 0x8e30 bytes could not fit into .ANY selector(s).
Not enough information to list image symbols.
Not enough information to list the image map.
Finished: 2 information, 0 warning and 13 error messages.
".\Objects\ucos-led.axf" - 13 Error(s), 0 Warning(s).

需要修改

//lib_cfg.h

  #define LIB_MEM_CFG_HEAP_SIZE 27u * 1024u /* Configure heap memory size [see Note #2a]. */  

  这里把堆空间设置为27K。。。。堆空间都比RAM还大了,这程序怎么可能在单片机是正常运行,把堆空格改为10K,程序编译通过。

  #define  LIB_MEM_CFG_HEAP_SIZE          10u * 1024u 

 

转载于:https://www.cnblogs.com/tearain/p/8708938.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值