您尚未登录。

楼主 #1 2018-07-02 22:14:08

Jin劲
会员
注册时间: 2018-04-06
已发帖子: 217
积分: 217

小白求求挖坑填坑,f1c100s小小sram裸机

不知道有没有错误,小白求求挖坑填坑

文章有误删除

最近编辑记录 Jin劲 (2018-07-10 11:04:24)

离线

楼主 #2 2018-07-02 22:19:04

Jin劲
会员
注册时间: 2018-04-06
已发帖子: 217
积分: 217

Re: 小白求求挖坑填坑,f1c100s小小sram裸机

lds内存地址参考 Allwinner_F1C600_User_Manual_V1.0.pdf

jin@jin-X550JK:~/myboot2$ make clean
rm *.o *.bin
jin@jin-X550JK:~/myboot2$ ls
main.c  Makefile  mksunxiboot  myboot.lds  mystart.s
jin@jin-X550JK:~/myboot2$

jin@jin-X550JK:~/myboot2$ make
arm-eabi-as mystart.s -o mystart.o
arm-eabi-gcc -c main.c -o main.o
arm-eabi-ld -Tmyboot.lds mystart.o main.o -o myboot.o
arm-eabi-objcopy -O binary myboot.o myboot.bin
./mksunxiboot/mksunxiboot myboot.bin myboot_sram.bin
File size: 0xb0
Load size: 0xb0
Read 0xb0 bytes
Write 0x200 bytes
jin@jin-X550JK:~/myboot2$ ls
main.c  Makefile     myboot.bin  myboot.o         mystart.o
main.o  mksunxiboot  myboot.lds  myboot_sram.bin  mystart.s
jin@jin-X550JK:~/myboot2$

//F1C100S上电从ROM启动,检测MMC、SPIFLASH等,./mksunxiboot/mksunxiboot myboot.bin myboot_sram.bin 就是给编译出的文件加入魔数,用于识别。
//mksunxiboot git地址: https://github.com/amery/mksunxiboot

最近编辑记录 Jin劲 (2018-07-02 22:26:44)

离线

楼主 #3 2018-07-02 22:26:58

Jin劲
会员
注册时间: 2018-04-06
已发帖子: 217
积分: 217

Re: 小白求求挖坑填坑,f1c100s小小sram裸机

使芯片进入fel模式,确保安装好fel工具,输入make write,写入spi flash

jin@jin-X550JK:~/myboot2$ sudo sunxi-fel list
[sudo] jin 的密码:
USB device 001:005   Allwinner F1C100s
jin@jin-X550JK:~/myboot2$ make write
sudo sunxi-fel -p spiflash-write 0 myboot_sram.bin
100% [================================================]     1 kB,   56.8 kB/s

重新上电,用JLink调试

jin@jin-X550JK:~/myboot2$ sudo JLinkExe
SEGGER J-Link Commander V5.00 ('?' for help)
Compiled Jun  8 2015 21:14:06
DLL version V5.00, compiled Jun  8 2015 21:14:03
Firmware: J-Link V9 compiled Jun  2 2222 22:22:22
Hardware: V9.40
S/N: 81480416
Feature(s): GDB, RDI, FlashBP, FlashDL, JFlash, RDDI
VTarget = 3.174V
Info: TotalIRLen = 4, IRPrint = 0x01
Info: CP15.0.0: 0x41069265: ARM, Architecure 5TEJ
Info: CP15.0.1: 0x1D152192: ICache: 32kB (4*256*32), DCache: 16kB (4*128*32)
Info: Cache type: Separate, Write-back, Format C (WT supported)
Found 1 JTAG device, Total IRLen = 4:
#0 Id: 0x07926F0F, IRLen: 04, IRPrint: 0x1, ARM926EJ-S Core
Found ARM with core Id 0x07926F0F (ARM9)
Target interface speed: 100 kHz
J-Link>r
Reset delay: 0 ms
Reset type NORMAL: Using RESET pin, halting CPU after Reset
Info: Core does not stop after Reset, setting WP to stop it.

**************************
WARNING: PC of target system has unexpected value of 0x00000094 after reset.
**************************

Info: CP15.0.0: 0x41069265: ARM, Architecure 5TEJ
Info: CP15.0.1: 0x1D152192: ICache: 32kB (4*256*32), DCache: 16kB (4*128*32)
Info: Cache type: Separate, Write-back, Format C (WT supported)
J-Link>regs
PC: (R15) = 00000094, CPSR = 600000D3 (SVC mode, ARM FIQ dis. IRQ dis.)
Current:
     R0 =00000001, R1 =00000022, R2 =00000033, R3 =00000001
     R4 =00000055, R5 =00000066, R6 =00000077, R7 =DEADBEEF
     R8 =4FA1C028, R9 =03033727, R10=00010020, R11=00000000, R12=00000000
     R13=00009FF4, R14=0000006C, SPSR=00000010
USR: R8 =4FA1C028, R9 =03033727, R10=00010020, R11=00000000, R12=00000000
     R13=43D7826E, R14=5391700B
FIQ: R8 =AA14036C, R9 =24AE5FF6, R10=C7F9D002, R11=B42000EF, R12=432D957F
     R13=57F57D84, R14=221935F0, SPSR=00000010
IRQ: R13=0F419474, R14=66442FD7, SPSR=00000010
SVC: R13=00009FF4, R14=0000006C, SPSR=00000010
ABT: R13=D74F9C67, R14=66E3BEEF, SPSR=00000010
UND: R13=02800000, R14=12EDB4E6, SPSR=00000010
J-Link>


     R0 =00000001, R1 =00000022, R2 =00000033, R3 =00000001
     R4 =00000055, R5 =00000066, R6 =00000077, R7 =DEADBEEF

最近编辑记录 Jin劲 (2018-07-02 22:33:26)

离线

楼主 #4 2018-07-02 23:01:53

Jin劲
会员
注册时间: 2018-04-06
已发帖子: 217
积分: 217

Re: 小白求求挖坑填坑,f1c100s小小sram裸机

求解答,为啥读出来不是俺程序的第一条机器码

F6.png

离线

楼主 #16 2018-07-10 11:05:26

Jin劲
会员
注册时间: 2018-04-06
已发帖子: 217
积分: 217

Re: 小白求求挖坑填坑,f1c100s小小sram裸机

达克罗德 说:

楼主的mksunxiboot和xboot里的mksunxi有和不同,楼主的mksunxiboot我用了下,好像可以正确被识别,但是我用了xboot的mksunxi工具去处理bin,反而跑不起来,而且bin文件会变成8K(原来6k)代码

可以分析一下工具C源码,其实也就是加上一个文件头部信息

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn