STM32F10X MCU U-boot porting
来源:互联网 发布:域名注册的流程 编辑:程序博客网 时间:2024/06/07 20:48
U-boot version:
GIT clone git://git.denx.de/u-boot.git
Tag: 2016.01-rc1
ARM GCC: arm-none-eabi-gcc 5.2.1
STM32F10X MCU has no DDR. And it has only 64KB SRAM.
The first step of the porting is to re-design the U-boot address space.
What I do is:
1.Keep .text and .rodata section in the MCU internal NOR flash.
2.Just move the .data and .bss section into the SRAM and use 8KB top address SRAM.
3.Malloc buffer use 24KB SRAM and follows .data section.
4.GD and LD follows malloc buffer.
5.SP follows GD.
The the steps to implement it:
1. Disable U-boot relocate feature. Refer to my another blog。
2. 重新安排U-boot.lds里的段排列,把.data 和 .bss段排在一起并且使用SRAM的地址链接。其他段放在一起并使用NOR flash地址。下面列出例子。
MEMORY{ NVM (r): ORIGIN = (0x08000000 + 0x0), LENGTH = ((256 * 1024) - 0x0) RAM (rw): ORIGIN = 0x2000e000, LENGTH = (8 * 1024)}SECTIONS{ .text : { *(.text) *(.rodata*) } >NVM .data : { _data_start = .; _data_lma_start = LOADADDR(.data); *(.data) . = ALIGN(4); *(.ramcode) _data_end = .; } >RAM AT>NVM .bss : { _bss_start = .; *(.bss) *(COMMON) _bss_end = .; } >RAM }注意在board_f.c 中有很多reserve buffer的函数在init_sequence_r[]数组中,要注意按照定义的SRAM分配图来修改对应的reserve函数。
同时可以把很多大的常量移入rodata段,比如数组init_sequence_r[] 和 env_hel_text[] 。 在他们的定义上加上const关键字,他们就会被放在.rodata段。
3. Remove unnecessary commands and drivers to minimize the binary size. This is on configs/STM32F1XX_defconfig.
4. rewrite the data relocation function and make it be call at very beginning of the boot.
@Modified the relocate_code function in arch/arm/lib/relocation.S
@call it at _main in arch/arm/lib/crt0.S
5. Define the section and buffer size on include/configs/stm32f10x.h
6. Port clock configure functions on my board.
7. Port UART configure functions on my board.
Done.
- STM32F10X MCU U-boot porting
- Porting u-boot
- U-boot porting guide
- Porting U-boot for SPEAr310(arm926) --- 1
- Porting U-boot for SPEAr310(arm926) --- 2
- Porting U-boot for SPEAr310(arm926) --- 3
- Porting U-boot for SPEAr310(arm926) --- 4
- U-Boot的移植U-Boot Practically Porting Guide
- Porting u-boot on v2 RAM256M+S-Flash16M.
- U-Boot的移植U-Boot Practically Porting Guide(转)
- U-Boot的移植U-Boot Practically Porting Guide(转)
- MCU程序设计之STM32F10X的中断NVIC
- STM32F10X的boot分析
- U-BOOT
- u-boot
- U-boot
- U-Boot
- u-boot
- Homebrew命令详解
- OpenLayers3-7-Box Selection
- c++中堆、栈内存分配
- HDU4858 项目管理【图论】【待】
- 贝塞尔曲线
- STM32F10X MCU U-boot porting
- C# 委托获取多个订阅者的返回值
- 个人作品整理
- 在自己的电脑上搭建一个服务器
- 局部敏感哈希
- 2016-01-20 教训
- SQL索引
- OpenLayers3-8-Custom Tooltips
- 转--Ti CC2540蓝牙模块学习笔记整理