第3章 集成
3 集成编译
3.1 makefile
基本思想
目标的建立
变量的使用
常用函数的使用
字符替换函数:substr
shell 等指令的调用
make 不管具体的执行命令和目的,将命令放置到当前运行系统上执行,返回错误则终止
“-” 可以忽略错误: - rm source.c
- echo
- perl
- python
- shell
3.2 asap2接口实现
A2L的结构与物理含义
- 测量量
- 标定量 :scalar ,curve,map
- 计算方法:描述物理值与存储值的关系
脚本处理方式
perl 实现begin end的内容缓冲
3.3 代码查看与版本控制
目录结构
3.3.1 git的使用
3.3.1.1 基本使用
git init # 初始化
git add file # 添加文件缓冲区,. 通配符:所有文件
git commit -m 'comment' # 提交到创库,添加注释
3.3.1.2 远程使用
绑定远程项目
git remote add origin ssh://git@172.22.85.50:2022/yanbo.peng/simulink_Menu.git
推送项目
git push -u origin --all
git push origin [branch_name]
git push origin [local_branch_name]:[remote_branch_name]:
clone 项目
git clone remote_project
3.4 编辑工具
3.4.1 notepad的使用技巧
3.4.2 vim的快捷使用
3.4.3 compare实现代码对比
3.4.4 insightsource
3.5 链接过程
链接语法
链接脚本
In case of single-core the linking is done in two steps. The first is the pre-linking where sections
of input objects are collected into output sections and the second is the locating where output
sections are located to memory regions.
example
OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
OUTPUT_ARCH(powerpc)
start = 0x8FC0600;
ENTRY(start)
MEMORY
{
//final section 的物理空间分配
}
SECTIONS
{
//final section 的input section
}
symbol = 0
组成结构
sections
SECTIONS
{
ram 0x5000000:: AT(4096){
vc*.o(culsram)
∗(EXCLUDE_FILE (∗crtend.o ∗otherfile.o) .ctors) }
//运行在 0x500000,存储在0x1000
// vc开头的obj文件 culram section 输入到 ram的section中
// 排除 crtend.o等
}
Memory
MEMORY
{
ASW0_Flash : org = 0x9000000, l =