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

一、把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 

posted @ 2019-10-16 20:47  来来就来  阅读(1124)  评论(0编辑  收藏  举报