全志D1裸奔工具XFEL
-
工欲善其事,必先利其器,全志D1沿用传统设计思路,brom里面集成了FEL模式,这个模式是一个很有用的模式,可以烧录,测试,能干的事情很多,本来这种工具也是有成熟的可用,比如:sunxi-fel,基本算裸奔必用的开发工具,但突然来了个RISCV版的FEL,sunxi-fel就无能为力,其深度绑定ARM实现,里面的payload都是arm,根本没有riscv,没有工具,想正向开发,比登天还难。
仔细分析D1的fel,发现其烧写工具跟原先的一致,没有做任何更新,那也就是说,fel标准协议其实是指令集无关的,有了这个信息就好办了,我们完全也可以创建一个指令集无关的fel工具,阅读sunxi-fel,发现其改造困难,基本深度绑定,没有太多开发的意义,还不如重新开发,轻装上阵,遂有了此工程。
此工具理论上全志全系列芯片都可以支持,不管是arm32,arm64,riscv64,重点目标是riscv64的D1支持,设计时避免过多hack,增强适应性,最大的特色借用xfel工具可以直接初始化DDR。有了直接能初始化DDR的fel工具,开发裸机就没有任何难度了,当单片机耍。
xfel(v1.0.1) - https://github.com/xboot/xfel usage: xfel help - Print this usage xfel version - Show brom version xfel hexdump <address> <length> - Dumps memory region in hex xfel dump <address> <length> - Binary memory dump to stdout xfel exec <address> - Call function address xfel read32 <address> - Read 32-bits value from device memory xfel write32 <address> <value> - Write 32-bits value to device memory xfel read <address> <length> <file> - Read memory to file xfel write <address> <file> - Write file to memory xfel reset - Reset device using watchdog xfel sid - Show 128-bits sid information xfel jtag - Enable jtag debug xfel ddr [type] - Initial ddr controller with optional type xfel spinor - Detect spi nor flash xfel spinor read <address> <length> <file> - Read spi nor flash to file xfel spinor write <address> <file> - Write file to spi nor flash xfel spinand - Detect spi nand flash xfel spinand read <address> <length> <file> - Read spi nand flash to file xfel spinand write <address> <file> - Write file to spi nand flash
-
这个超链接加了文字大家都没注意是github地址,可以放出来方便大家看哈 -
有没有 芯片 寄存器的参考 或者后续 有没有封装库函数的打算 ,
还挺期待,这个裸机跑起控制算法 能起飞
-
@bedrock 在 全志D1裸奔工具XFEL 中说:
有没有 芯片 寄存器的参考 或者后续 有没有封装库函数的打算 ,
还挺期待,这个裸机跑起控制算法 能起飞
@bedrock 全志客户服务平台里可以下载到user manual啊,里面啥啥都有了。
裸机跑起控制算法主要是想干啥?(好奇 收集一下大家的使用场景) -
发现 xfel 写 spi nor flash,如果不从0地址开始写,那么写不进去。
-
@whycan 在 全志D1裸奔工具XFEL 中说:
发现 xfel 写 spi nor flash,如果不从0地址开始写,那么写不进去。
带git仓库的MSVC2017工程源码下载:
xfel_msvc2017_project_20211104_by_whycan.7z编译好的可执行文件下载,不依赖任何第三方库:xfel_20211104_whycan.exe
有板有时间的朋友可以测试测试了。
-
@whycan 在 全志D1裸奔工具XFEL 中说:
xfel 写 spi nor flash
在尝试xfel写spinor flash时,检测spinor失败,而nand正常。
请问是哪里的问题呢?$ xfel version AWUSBFEX soc=0x00185900(D1/F133) 0x00000001 ver=0x0001 0x44 0x08 scratchpad=0x00045000 $ xfel spinand Found spi nand flash 'MX35LF2GE4AD' with 268435456 bytes $ xfel spinor The spi nor flash '0xffc226' is not yet supported Can't detect any spi nor flash
-
因为你这个 MX35LF2GE4AD 就是 SPI NAND,不是SPI NOR。
-
测试xfel_20211104_whycan.exe,手头的MangoPi-MQ麻雀 焊接了GD5F1GQ,运行如下:
$ ./xfel_20211104_whycan.exe version AWUSBFEX soc=0x00185900(D1/F133) 0x00000001 ver=0x0001 0x44 0x08 scratchpad=0x00045000 $ ./xfel_20211104_whycan.exe spinand Found spi nand flash 'GD5F1GQ4xAYIG' with 134217728 bytes
手动将NAND换成W25N01,未能识别,输出如下:
$ ./xfel_20211104_whycan.exe spinand The spi nand flash '0xefaa' is not yet supported Can't detect any spi nand flash
-
@whycan 我使用的是标准的D1板子.
请问spi nor的存储D1默认没有,需要手动焊接的吗? -
@elliott 对,自己手动换FLASH
-
@mangogeek 在 全志D1裸奔工具XFEL 中说:
exe
-
@mangogeek 已添加Winbond SPI NAND的支持,因为华邦的ID是3个字节,其他的SPI NAND芯片是两个字节的ID,现在代码已做了扩展。
/* Winbond */ { "W25N512GV", SPINAND_ID(0xef, 0xaa, 0x20), 2048, 64, 64, 512, 1, 1 }, { "W25N01GV", SPINAND_ID(0xef, 0xaa, 0x21), 2048, 64, 64, 1024, 1, 1 }, { "W25M02GV", SPINAND_ID(0xef, 0xab, 0x21), 2048, 64, 64, 1024, 1, 2 }, { "W25N02KV", SPINAND_ID(0xef, 0xaa, 0x22), 2048, 128, 64, 2048, 1, 1 },
-
最新的SPI NAND FLASH支持列表如下:
/* Winbond */ { "W25N512GV", SPINAND_ID(0xef, 0xaa, 0x20), 2048, 64, 64, 512, 1, 1 }, { "W25N01GV", SPINAND_ID(0xef, 0xaa, 0x21), 2048, 64, 64, 1024, 1, 1 }, { "W25M02GV", SPINAND_ID(0xef, 0xab, 0x21), 2048, 64, 64, 1024, 1, 2 }, { "W25N02KV", SPINAND_ID(0xef, 0xaa, 0x22), 2048, 128, 64, 2048, 1, 1 }, /* Gigadevice */ { "GD5F1GQ4UAWxx", SPINAND_ID(0xc8, 0x10), 2048, 64, 64, 1024, 1, 1 }, { "GD5F1GQ4UExIG", SPINAND_ID(0xc8, 0xd1), 2048, 128, 64, 1024, 1, 1 }, { "GD5F1GQ4UExxH", SPINAND_ID(0xc8, 0xd9), 2048, 64, 64, 1024, 1, 1 }, { "GD5F1GQ4xAYIG", SPINAND_ID(0xc8, 0xf1), 2048, 64, 64, 1024, 1, 1 }, { "GD5F2GQ4UExIG", SPINAND_ID(0xc8, 0xd2), 2048, 128, 64, 2048, 1, 1 }, { "GD5F2GQ5UExxH", SPINAND_ID(0xc8, 0x32), 2048, 64, 64, 2048, 1, 1 }, { "GD5F2GQ4xAYIG", SPINAND_ID(0xc8, 0xf2), 2048, 64, 64, 2048, 1, 1 }, { "GD5F4GQ4UBxIG", SPINAND_ID(0xc8, 0xd4), 4096, 256, 64, 2048, 1, 1 }, { "GD5F4GQ4xAYIG", SPINAND_ID(0xc8, 0xf4), 2048, 64, 64, 4096, 1, 1 }, { "GD5F2GQ5UExxG", SPINAND_ID(0xc8, 0x52), 2048, 128, 64, 2048, 1, 1 }, { "GD5F4GQ4UCxIG", SPINAND_ID(0xc8, 0xb4), 4096, 256, 64, 2048, 1, 1 }, /* Macronix */ { "MX35LF1GE4AB", SPINAND_ID(0xc2, 0x12), 2048, 64, 64, 1024, 1, 1 }, { "MX35LF1G24AD", SPINAND_ID(0xc2, 0x14), 2048, 128, 64, 1024, 1, 1 }, { "MX31LF1GE4BC", SPINAND_ID(0xc2, 0x1e), 2048, 64, 64, 1024, 1, 1 }, { "MX35LF2GE4AB", SPINAND_ID(0xc2, 0x22), 2048, 64, 64, 2048, 1, 1 }, { "MX35LF2G24AD", SPINAND_ID(0xc2, 0x24), 2048, 128, 64, 2048, 1, 1 }, { "MX35LF2GE4AD", SPINAND_ID(0xc2, 0x26), 2048, 128, 64, 2048, 1, 1 }, { "MX35LF2G14AC", SPINAND_ID(0xc2, 0x20), 2048, 64, 64, 2048, 1, 1 }, { "MX35LF4G24AD", SPINAND_ID(0xc2, 0x35), 4096, 256, 64, 2048, 1, 1 }, { "MX35LF4GE4AD", SPINAND_ID(0xc2, 0x37), 4096, 256, 64, 2048, 1, 1 }, /* Micron */ { "MT29F1G01AAADD", SPINAND_ID(0x2c, 0x12), 2048, 64, 64, 1024, 1, 1 }, { "MT29F1G01ABAFD", SPINAND_ID(0x2c, 0x14), 2048, 128, 64, 1024, 1, 1 }, { "MT29F2G01AAAED", SPINAND_ID(0x2c, 0x9f), 2048, 64, 64, 2048, 2, 1 }, { "MT29F2G01ABAGD", SPINAND_ID(0x2c, 0x24), 2048, 128, 64, 2048, 2, 1 }, { "MT29F4G01AAADD", SPINAND_ID(0x2c, 0x32), 2048, 64, 64, 4096, 2, 1 }, { "MT29F4G01ABAFD", SPINAND_ID(0x2c, 0x34), 4096, 256, 64, 2048, 1, 1 }, { "MT29F4G01ADAGD", SPINAND_ID(0x2c, 0x36), 2048, 128, 64, 2048, 2, 2 }, { "MT29F8G01ADAFD", SPINAND_ID(0x2c, 0x46), 4096, 256, 64, 2048, 1, 2 }, /* Toshiba */ { "TC58CVG0S3HRAIG", SPINAND_ID(0x98, 0xc2), 2048, 128, 64, 1024, 1, 1 }, { "TC58CVG1S3HRAIG", SPINAND_ID(0x98, 0xcb), 2048, 128, 64, 2048, 1, 1 }, { "TC58CVG2S0HRAIG", SPINAND_ID(0x98, 0xcd), 4096, 256, 64, 2048, 1, 1 }, { "TC58CVG0S3HRAIJ", SPINAND_ID(0x98, 0xe2), 2048, 128, 64, 1024, 1, 1 }, { "TC58CVG1S3HRAIJ", SPINAND_ID(0x98, 0xeb), 2048, 128, 64, 2048, 1, 1 }, { "TC58CVG2S0HRAIJ", SPINAND_ID(0x98, 0xed), 4096, 256, 64, 2048, 1, 1 }, { "TH58CVG3S0HRAIJ", SPINAND_ID(0x98, 0xe4), 4096, 256, 64, 4096, 1, 1 }, /* Esmt */ { "F50L512M41A", SPINAND_ID(0xc8, 0x20), 2048, 64, 64, 512, 1, 1 }, { "F50L1G41A", SPINAND_ID(0xc8, 0x21), 2048, 64, 64, 1024, 1, 1 }, { "F50L1G41LB", SPINAND_ID(0xc8, 0x01), 2048, 64, 64, 1024, 1, 1 }, { "F50L2G41LB", SPINAND_ID(0xc8, 0x0a), 2048, 64, 64, 1024, 1, 2 }, /* Fison */ { "CS11G0T0A0AA", SPINAND_ID(0x6b, 0x00), 2048, 128, 64, 1024, 1, 1 }, { "CS11G0G0A0AA", SPINAND_ID(0x6b, 0x10), 2048, 128, 64, 1024, 1, 1 }, { "CS11G0S0A0AA", SPINAND_ID(0x6b, 0x20), 2048, 64, 64, 1024, 1, 1 }, { "CS11G1T0A0AA", SPINAND_ID(0x6b, 0x01), 2048, 128, 64, 2048, 1, 1 }, { "CS11G1S0A0AA", SPINAND_ID(0x6b, 0x21), 2048, 64, 64, 2048, 1, 1 }, { "CS11G2T0A0AA", SPINAND_ID(0x6b, 0x02), 2048, 128, 64, 4096, 1, 1 }, { "CS11G2S0A0AA", SPINAND_ID(0x6b, 0x22), 2048, 64, 64, 4096, 1, 1 }, /* Etron */ { "EM73B044VCA", SPINAND_ID(0xd5, 0x01), 2048, 64, 64, 512, 1, 1 }, { "EM73C044SNB", SPINAND_ID(0xd5, 0x11), 2048, 120, 64, 1024, 1, 1 }, { "EM73C044SNF", SPINAND_ID(0xd5, 0x09), 2048, 128, 64, 1024, 1, 1 }, { "EM73C044VCA", SPINAND_ID(0xd5, 0x18), 2048, 64, 64, 1024, 1, 1 }, { "EM73C044SNA", SPINAND_ID(0xd5, 0x19), 2048, 64, 128, 512, 1, 1 }, { "EM73C044VCD", SPINAND_ID(0xd5, 0x1c), 2048, 64, 64, 1024, 1, 1 }, { "EM73C044SND", SPINAND_ID(0xd5, 0x1d), 2048, 64, 64, 1024, 1, 1 }, { "EM73D044SND", SPINAND_ID(0xd5, 0x1e), 2048, 64, 64, 2048, 1, 1 }, { "EM73C044VCC", SPINAND_ID(0xd5, 0x22), 2048, 64, 64, 1024, 1, 1 }, { "EM73C044VCF", SPINAND_ID(0xd5, 0x25), 2048, 64, 64, 1024, 1, 1 }, { "EM73C044SNC", SPINAND_ID(0xd5, 0x31), 2048, 128, 64, 1024, 1, 1 }, { "EM73D044SNC", SPINAND_ID(0xd5, 0x0a), 2048, 120, 64, 2048, 1, 1 }, { "EM73D044SNA", SPINAND_ID(0xd5, 0x12), 2048, 128, 64, 2048, 1, 1 }, { "EM73D044SNF", SPINAND_ID(0xd5, 0x10), 2048, 128, 64, 2048, 1, 1 }, { "EM73D044VCA", SPINAND_ID(0xd5, 0x13), 2048, 128, 64, 2048, 1, 1 }, { "EM73D044VCB", SPINAND_ID(0xd5, 0x14), 2048, 64, 64, 2048, 1, 1 }, { "EM73D044VCD", SPINAND_ID(0xd5, 0x17), 2048, 128, 64, 2048, 1, 1 }, { "EM73D044VCH", SPINAND_ID(0xd5, 0x1b), 2048, 64, 64, 2048, 1, 1 }, { "EM73D044SND", SPINAND_ID(0xd5, 0x1d), 2048, 64, 64, 2048, 1, 1 }, { "EM73D044VCG", SPINAND_ID(0xd5, 0x1f), 2048, 64, 64, 2048, 1, 1 }, { "EM73D044VCE", SPINAND_ID(0xd5, 0x20), 2048, 64, 64, 2048, 1, 1 }, { "EM73D044VCL", SPINAND_ID(0xd5, 0x2e), 2048, 128, 64, 2048, 1, 1 }, { "EM73D044SNB", SPINAND_ID(0xd5, 0x32), 2048, 128, 64, 2048, 1, 1 }, { "EM73E044SNA", SPINAND_ID(0xd5, 0x03), 4096, 256, 64, 2048, 1, 1 }, { "EM73E044SND", SPINAND_ID(0xd5, 0x0b), 4096, 240, 64, 2048, 1, 1 }, { "EM73E044SNB", SPINAND_ID(0xd5, 0x23), 4096, 256, 64, 2048, 1, 1 }, { "EM73E044VCA", SPINAND_ID(0xd5, 0x2c), 4096, 256, 64, 2048, 1, 1 }, { "EM73E044VCB", SPINAND_ID(0xd5, 0x2f), 2048, 128, 64, 4096, 1, 1 }, { "EM73F044SNA", SPINAND_ID(0xd5, 0x24), 4096, 256, 64, 4096, 1, 1 }, { "EM73F044VCA", SPINAND_ID(0xd5, 0x2d), 4096, 256, 64, 4096, 1, 1 }, { "EM73E044SNE", SPINAND_ID(0xd5, 0x0e), 4096, 256, 64, 4096, 1, 1 }, { "EM73C044SNG", SPINAND_ID(0xd5, 0x0c), 2048, 120, 64, 1024, 1, 1 }, { "EM73D044VCN", SPINAND_ID(0xd5, 0x0f), 2048, 64, 64, 2048, 1, 1 }, /* Elnec */ { "FM35Q1GA", SPINAND_ID(0xe5, 0x71), 2048, 64, 64, 1024, 1, 1 }, /* Paragon */ { "PN26G01A", SPINAND_ID(0xa1, 0xe1), 2048, 128, 64, 1024, 1, 1 }, { "PN26G02A", SPINAND_ID(0xa1, 0xe2), 2048, 128, 64, 2048, 1, 1 }, /* Ato */ { "ATO25D1GA", SPINAND_ID(0x9b, 0x12), 2048, 64, 64, 1024, 1, 1 }, /* Heyang */ { "HYF1GQ4U", SPINAND_ID(0xc9, 0x51), 2048, 128, 64, 1024, 1, 1 }, { "HYF2GQ4U", SPINAND_ID(0xc9, 0x52), 2048, 128, 64, 2048, 1, 1 },
-
xfel工具如何使用?我连接了D1开发板的电源线,串口线,输入xfel命令,报错 Can`t found any FEL device . -
@eswin_hg 在 全志D1裸奔工具XFEL 中说:
xfel工具如何使用?我连接了D1开发板的电源线,串口线,输入xfel命令,报错 Can`t found any FEL device .搞明白了,type-c接线应该换串口旁边的typec接口。
-
-
有没有sop8封装的flash啊
-
我这里两台电脑都是显示 ERROR: Can't found any FEL device! 电脑能认到USB Device(VID_1f3a_PID_efe8)的
-
@dsp2000 驱动不对,xfel要装winusb驱动,VID_1f3a_PID_efe8这个是全志官方刷机工具的驱动
-
@dsp2000 通过 Zadig 工具 把 "USB Device(VID_1f3a_PID_efe8)" 编辑名称为 "Allwinner SoC in FEL mode" 就行了。
Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号