-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtodo.txt
56 lines (43 loc) · 2.61 KB
/
todo.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
////////////////////////////////////////////////////////////////////////////////////////////////
2017.08.09//////////////////////////////////////////////////////////////////////////////////////
.把serial.cpp中的api放在main.cpp中编译和运行正常
但api放在serial.cpp中时,编译报undefined reference to `__aeabi_unwind_cpp_pr1'
//已解决,增加 -fno-exceptions 即可
//参考 ttps://stackoverflow.com/questions/44210812/what-is-aeabi-unwind-cpp-pr1-and-how-can-i-avoid-it
.采用cmake
//已解决
参考 http://blog.163.com/hotman_x.vip/blog/static/48950133201652203818519/
cmake中要明确启用汇率
enable_language( ASM )
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_CROSSCOMPILING TRUE)
cmake部分成功
.S采用普通makefile来编译,生成head.o
.cpp采用cmake来编译,编译时报warning: cannot find entry symbol _start; defaulting to 00008074,不用管它
然后用如下命令来生成uboot++.bin
/opt/hisi-linux/x86-arm/arm-hisiv300-linux/bin/arm-hisiv300-linux-uclibcgnueabi-ld -static -nostartfiles -nodefaultlibs -nostdlib -T../leds.lds -o uboot++.elf ../head.o ./CMakeFiles/uboot++.dir/init.cpp.o ./CMakeFiles/uboot++.dir/serial.cpp.o ./CMakeFiles/uboot++.dir/main.cpp.o
/opt/hisi-linux/x86-arm/arm-hisiv300-linux/bin/arm-hisiv300-linux-uclibcgnueabi-objcopy -O binary -S uboot++.elf uboot++.bin
用oflash烧录uboot++.bin即可测试运行
生成uboot++bin的汇编列表文件(可选)
/opt/hisi-linux/x86-arm/arm-hisiv300-linux/bin/arm-hisiv300-linux-uclibcgnueabi-objdump -D -m arm uboot++.elf > uboot++.dis
head.s和.cpp可以在cmake中编译成功了,注意.s要小写
主要改动
enable_language( ASM-ATT)
set(CMAKE_ASM-ATT_COMPILER ${COMPILER_CROSS}gcc)
SET(CMAKE_ASM-ATT_COMPILER_ARG1 "-c")
参考https://cmake.org/Wiki/CMake/Assembler
/opt/hisi-linux/x86-arm/arm-hisiv300-linux/bin/arm-hisiv300-linux-uclibcgnueabi-objcopy -O binary -S uboot++ uboot++.bin
/opt/hisi-linux/x86-arm/arm-hisiv300-linux/bin/arm-hisiv300-linux-uclibcgnueabi-objdump -D -m arm uboot++ > uboot++.dis
////////////////////////////////////////////////////////////////////////////////////////////////
XiongWanPing 2017.08.19/////////////////////////////////////////////////////////////////////////
采用s3c2440来学习硬件底层
编译方法
cd uboot/bin
cmake ..
make或make VERBOSE=1
生成的文件在为uboot/uboot.bin,可用oflash烧录到板子运行
注意约定在uboot/bin目录下编译,否则编译可能出错
烧录
由于在cfg.txt中已经配置了,所以在uboot目录中直接运行oflash即可烧录
烧录后要断电重启(用的是JZ2440 v3板子,jtag线不需要断开)