Tiny FEL tools for allwinner SOC, support RISC-V D1 chip

Related tags

Miscellaneous xfel
Overview

XFEL

Tiny FEL tools for allwinner SOC, support RISC-V D1 chip.

How to build

The xfel tools depends on the libusb-1.0 library, you need to install libusb-1.0-0-dev before compile, for example in ubuntu:

sudo apt install libusb-1.0-0-dev

Then just type make at the root directory, you will see a binary program.

cd xfel
make
sudo make install

Usage

xfel(v1.1.0) - https://github.com/xboot/xfel
usage:
    xfel version                                - Show brom version
    xfel hexdump 
- Dumps memory region in hex xfel dump
- Binary memory dump to stdout xfel exec
- Call function address xfel read32
- Read 32-bits value from device memory xfel write32
- Write 32-bits value to device memory xfel read
- Read memory to file xfel write
- 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
- Read spi nor flash to file xfel spinor write
- Write file to spi nor flash xfel spinand - Detect spi nand flash xfel spinand read
- Read spi nand flash to file xfel spinand write
- Write file to spi nand flash

Links

License

This library is free software; you can redistribute it and or modify it under the terms of the MIT license. See MIT License for details.

Comments
  • 添加SD卡命令

    添加SD卡命令

    适合板上焊接SD-NAND或EMMC,但fel加载U盘固件还末做好的时候用。

    目前仅适配F133 SDIO0,读取速度100KB每秒,读取较长数据测试没有问题。 写速度只有20-40KB每秒,且写较多数据时,有小部分数据有问题,应该是写入成功状态没处理。

    先发出来,后面再慢慢修补,欢迎入坑继续完善。

    示例

    xfel.exe sd
    xfel.exe sd read 0 512 1.bin
    
    xfel.exe sd write 512 1.bin
    xfel.exe sd write 8192 1.bin
    
    opened by aozima 15
  • Error: usb bulk send error (operation timed out)

    Error: usb bulk send error (operation timed out)

    I tried to write a binary to an R528 board and encountered a usb bulk send error. To know what happened, I modified the source code to print the error message.

    I execute commands like below:

    > xfel version
    AWUSBFEX ID=0x00185900(R528/T113) dflag=0x44 dlength=0x08 scratchpad=0x00045000
    > xfel ddr r528-s3
    Initial ddr controller succeeded
    > xfel write 0x80000000 target/armv7a-none-eabi/debug/blink.bin
    usb bulk send error: Operation timed out
    

    In addition, I can use xfel to write binary to D1S board.

    What could be causing this error? How do I fix it?


    我尝试向R528的板子写入二进制文件,但遇到了usb bulk send error。我修改了源代码来尝试找出问题,下面是我执行的命令:

    # 如上
    

    另,我可以使用xfel来向D1S写入二进制文件。

    可能是什么导致的?如何解决呢?

    opened by duskmoon314 7
  • T113-S3 好像与F133有相同的ID

    T113-S3 好像与F133有相同的ID

    $ ./xfel.exe version
    AWUSBFEX soc=0x00185900(D1/F133) 0x00000001 ver=0x0001 0x44 0x08 scratchpad=0x00045000
    $ ./xfel.exe sid
    9040630008144c14025261504b6b184b
    

    opened by mangobuge 6
  • [编译错误] 发行版本内缺少相关文件

    [编译错误] 发行版本内缺少相关文件

    在最新的 v1.2.0 和 v1.2.1 发行版中,使用源码编译发现发行版包内缺少文件。详细如下 v1.2.0

    ➜  xfel-1.2.0 git:(master) ✗ tree
    .
    ├── 99-xfel.rules
    ├── LICENSE
    ├── Makefile
    ├── README.md
    ├── chips
    │   ├── a10.c
    │   ├── a13_a10s_r8.c
    │   ├── a20.c
    │   ├── a23.c
    │   ├── a31.c
    │   ├── a33_r16.c
    │   ├── a40i_r40.c
    │   ├── a64.c
    │   ├── a80.c
    │   ├── a83t.c
    │   ├── d1_f133.c
    │   ├── f1c100s_f1c200s_f1c500s.c
    │   ├── h2_h3.c
    │   ├── h5.c
    │   ├── h6.c
    │   ├── h616.c
    │   ├── r328.c
    │   ├── r329.c
    │   ├── t507.c
    │   ├── v3s_s3.c
    │   └── v831.c
    ├── fel.c
    ├── fel.h
    ├── main.c
    └── payloads
        ├── d1_f133
        │   ├── ddr
        │   │   ├── Makefile
        │   │   ├── include
        │   │   │   ├── byteorder.h
        │   │   │   ├── d1
        │   │   │   │   └── reg-ccu.h
        │   │   │   ├── endian.h
        │   │   │   ├── io.h
        │   │   │   ├── linkage.h
        │   │   │   ├── riscv64.h
        │   │   │   ├── stdarg.h
        │   │   │   ├── stddef.h
        │   │   │   ├── stdint.h
        │   │   │   ├── string.h
        │   │   │   ├── types.h
        │   │   │   └── xboot.h
        │   │   ├── link.ld
        │   │   └── source
        │   │       ├── mctl_hal.S
        │   │       ├── memcpy.S
        │   │       ├── memset.S
        │   │       ├── start.S
        │   │       ├── sys-clock.c
        │   │       ├── sys-dram.c
        │   │       └── sys-uart.c
        │   ├── jtag
        │   │   ├── Makefile
        │   │   ├── include
        │   │   │   ├── byteorder.h
        │   │   │   ├── d1
        │   │   │   │   └── reg-ccu.h
        │   │   │   ├── endian.h
        │   │   │   ├── io.h
        │   │   │   ├── linkage.h
        │   │   │   ├── riscv64.h
        │   │   │   ├── stdarg.h
        │   │   │   ├── stddef.h
        │   │   │   ├── stdint.h
        │   │   │   ├── string.h
        │   │   │   ├── types.h
        │   │   │   └── xboot.h
        │   │   ├── link.ld
        │   │   └── source
        │   │       ├── start.S
        │   │       └── sys-jtag.c
        │   └── spi
        │       ├── Makefile
        │       ├── include
        │       │   ├── byteorder.h
        │       │   ├── d1
        │       │   │   └── reg-ccu.h
        │       │   ├── endian.h
        │       │   ├── io.h
        │       │   ├── linkage.h
        │       │   ├── riscv64.h
        │       │   ├── stdarg.h
        │       │   ├── stddef.h
        │       │   ├── stdint.h
        │       │   ├── string.h
        │       │   ├── types.h
        │       │   └── xboot.h
        │       ├── link.ld
        │       └── source
        │           ├── start.S
        │           └── sys-spi.c
        ├── f1c100s_f1c200s_f1c500s
        │   ├── ddr
        │   │   ├── Makefile
        │   │   ├── include
        │   │   │   ├── byteorder.h
        │   │   │   ├── endian.h
        │   │   │   ├── f1c100s
        │   │   │   │   ├── reg-ccu.h
        │   │   │   │   └── reg-dram.h
        │   │   │   ├── io.h
        │   │   │   ├── stdarg.h
        │   │   │   ├── stddef.h
        │   │   │   ├── stdint.h
        │   │   │   ├── string.h
        │   │   │   ├── types.h
        │   │   │   └── xboot.h
        │   │   ├── link.ld
        │   │   └── source
        │   │       ├── memcpy.S
        │   │       ├── memset.S
        │   │       ├── start.S
        │   │       ├── sys-clock.c
        │   │       ├── sys-dram.c
        │   │       └── sys-uart.c
        │   ├── jtag
        │   │   ├── Makefile
        │   │   ├── include
        │   │   │   ├── byteorder.h
        │   │   │   ├── endian.h
        │   │   │   ├── f1c100s
        │   │   │   │   ├── reg-ccu.h
        │   │   │   │   └── reg-dram.h
        │   │   │   ├── io.h
        │   │   │   ├── stdarg.h
        │   │   │   ├── stddef.h
        │   │   │   ├── stdint.h
        │   │   │   ├── string.h
        │   │   │   ├── types.h
        │   │   │   └── xboot.h
        │   │   ├── link.ld
        │   │   └── source
        │   │       ├── start.S
        │   │       └── sys-jtag.c
        │   └── spi
        │       ├── Makefile
        │       ├── include
        │       │   ├── byteorder.h
        │       │   ├── endian.h
        │       │   ├── f1c100s
        │       │   │   ├── reg-ccu.h
        │       │   │   └── reg-dram.h
        │       │   ├── io.h
        │       │   ├── stdarg.h
        │       │   ├── stddef.h
        │       │   ├── stdint.h
        │       │   ├── string.h
        │       │   ├── types.h
        │       │   └── xboot.h
        │       ├── link.ld
        │       └── source
        │           ├── start.S
        │           └── sys-spi.c
        ├── h2_h3
        │   ├── h2-ddr
        │   │   ├── Makefile
        │   │   ├── include
        │   │   │   ├── byteorder.h
        │   │   │   ├── endian.h
        │   │   │   ├── h2
        │   │   │   │   ├── reg-ccu.h
        │   │   │   │   └── reg-dram.h
        │   │   │   ├── io.h
        │   │   │   ├── stdarg.h
        │   │   │   ├── stddef.h
        │   │   │   ├── stdint.h
        │   │   │   ├── string.h
        │   │   │   ├── types.h
        │   │   │   └── xboot.h
        │   │   ├── link.ld
        │   │   └── source
        │   │       ├── memcpy.S
        │   │       ├── memset.S
        │   │       ├── start.S
        │   │       ├── sys-clock.c
        │   │       ├── sys-dram.c
        │   │       └── sys-uart.c
        │   ├── h3-ddr
        │   │   ├── Makefile
        │   │   ├── include
        │   │   │   ├── byteorder.h
        │   │   │   ├── endian.h
        │   │   │   ├── h3
        │   │   │   │   ├── reg-ccu.h
        │   │   │   │   └── reg-dram.h
        │   │   │   ├── io.h
        │   │   │   ├── stdarg.h
        │   │   │   ├── stddef.h
        │   │   │   ├── stdint.h
        │   │   │   ├── string.h
        │   │   │   ├── types.h
        │   │   │   └── xboot.h
        │   │   ├── link.ld
        │   │   └── source
        │   │       ├── memcpy.S
        │   │       ├── memset.S
        │   │       ├── start.S
        │   │       ├── sys-clock.c
        │   │       ├── sys-dram.c
        │   │       └── sys-uart.c
        │   ├── jtag
        │   │   ├── Makefile
        │   │   ├── include
        │   │   │   ├── byteorder.h
        │   │   │   ├── endian.h
        │   │   │   ├── h3
        │   │   │   │   ├── reg-ccu.h
        │   │   │   │   └── reg-dram.h
        │   │   │   ├── io.h
        │   │   │   ├── stdarg.h
        │   │   │   ├── stddef.h
        │   │   │   ├── stdint.h
        │   │   │   ├── string.h
        │   │   │   ├── types.h
        │   │   │   └── xboot.h
        │   │   ├── link.ld
        │   │   └── source
        │   │       ├── start.S
        │   │       └── sys-jtag.c
        │   └── spi
        │       ├── Makefile
        │       ├── include
        │       │   ├── byteorder.h
        │       │   ├── endian.h
        │       │   ├── h3
        │       │   │   ├── reg-ccu.h
        │       │   │   └── reg-dram.h
        │       │   ├── io.h
        │       │   ├── stdarg.h
        │       │   ├── stddef.h
        │       │   ├── stdint.h
        │       │   ├── string.h
        │       │   ├── types.h
        │       │   └── xboot.h
        │       ├── link.ld
        │       └── source
        │           ├── start.S
        │           └── sys-spi.c
        └── v3s_s3
            ├── jtag
            │   ├── Makefile
            │   ├── include
            │   │   ├── byteorder.h
            │   │   ├── endian.h
            │   │   ├── io.h
            │   │   ├── stdarg.h
            │   │   ├── stddef.h
            │   │   ├── stdint.h
            │   │   ├── string.h
            │   │   ├── types.h
            │   │   ├── v3s
            │   │   │   ├── reg-ccu.h
            │   │   │   └── reg-dram.h
            │   │   └── xboot.h
            │   ├── link.ld
            │   └── source
            │       ├── start.S
            │       └── sys-jtag.c
            └── s3-ddr
                ├── Makefile
                ├── include
                │   ├── byteorder.h
                │   ├── endian.h
                │   ├── io.h
                │   ├── s3
                │   │   ├── reg-ccu.h
                │   │   └── reg-dram.h
                │   ├── stdarg.h
                │   ├── stddef.h
                │   ├── stdint.h
                │   ├── string.h
                │   ├── types.h
                │   └── xboot.h
                ├── link.ld
                └── source
                    ├── memcpy.S
                    ├── memset.S
                    ├── start.S
                    └── sys-clock.c
    
    54 directories, 230 files
    

    v1.2.1

    ➜  xfel-1.2.1 git:(master) ✗ tree     
    .
    ├── 99-xfel.rules
    ├── LICENSE
    ├── Makefile
    ├── README.md
    ├── chips
    │   ├── a10.c
    │   ├── a13_a10s_r8.c
    │   ├── a20.c
    │   ├── a23.c
    │   ├── a31.c
    │   ├── a33_r16.c
    │   ├── a40i_r40.c
    │   ├── a64.c
    │   ├── a80.c
    │   ├── a83t.c
    │   ├── d1_f133.c
    │   ├── f1c100s_f1c200s_f1c500s.c
    │   ├── h2_h3.c
    │   ├── h5.c
    │   ├── h6.c
    │   ├── h616.c
    │   ├── r328.c
    │   ├── r329.c
    │   ├── t507.c
    │   ├── v3s_s3.c
    │   └── v831.c
    ├── fel.c
    ├── fel.h
    ├── main.c
    └── payloads
        ├── d1_f133
        │   ├── ddr
        │   │   ├── Makefile
        │   │   ├── include
        │   │   │   ├── byteorder.h
        │   │   │   ├── d1
        │   │   │   │   └── reg-ccu.h
        │   │   │   ├── endian.h
        │   │   │   ├── io.h
        │   │   │   ├── linkage.h
        │   │   │   ├── riscv64.h
        │   │   │   ├── stdarg.h
        │   │   │   ├── stddef.h
        │   │   │   ├── stdint.h
        │   │   │   ├── string.h
        │   │   │   ├── types.h
        │   │   │   └── xboot.h
        │   │   ├── link.ld
        │   │   └── source
        │   │       ├── mctl_hal.S
        │   │       ├── memcpy.S
        │   │       ├── memset.S
        │   │       ├── start.S
        │   │       ├── sys-clock.c
        │   │       ├── sys-dram.c
        │   │       └── sys-uart.c
        │   ├── jtag
        │   │   ├── Makefile
        │   │   ├── include
        │   │   │   ├── byteorder.h
        │   │   │   ├── d1
        │   │   │   │   └── reg-ccu.h
        │   │   │   ├── endian.h
        │   │   │   ├── io.h
        │   │   │   ├── linkage.h
        │   │   │   ├── riscv64.h
        │   │   │   ├── stdarg.h
        │   │   │   ├── stddef.h
        │   │   │   ├── stdint.h
        │   │   │   ├── string.h
        │   │   │   ├── types.h
        │   │   │   └── xboot.h
        │   │   ├── link.ld
        │   │   └── source
        │   │       ├── start.S
        │   │       └── sys-jtag.c
        │   └── spi
        │       ├── Makefile
        │       ├── include
        │       │   ├── byteorder.h
        │       │   ├── d1
        │       │   │   └── reg-ccu.h
        │       │   ├── endian.h
        │       │   ├── io.h
        │       │   ├── linkage.h
        │       │   ├── riscv64.h
        │       │   ├── stdarg.h
        │       │   ├── stddef.h
        │       │   ├── stdint.h
        │       │   ├── string.h
        │       │   ├── types.h
        │       │   └── xboot.h
        │       ├── link.ld
        │       └── source
        │           ├── start.S
        │           └── sys-spi.c
        ├── f1c100s_f1c200s_f1c500s
        │   ├── ddr
        │   │   ├── Makefile
        │   │   ├── include
        │   │   │   ├── byteorder.h
        │   │   │   ├── endian.h
        │   │   │   ├── f1c100s
        │   │   │   │   ├── reg-ccu.h
        │   │   │   │   └── reg-dram.h
        │   │   │   ├── io.h
        │   │   │   ├── stdarg.h
        │   │   │   ├── stddef.h
        │   │   │   ├── stdint.h
        │   │   │   ├── string.h
        │   │   │   ├── types.h
        │   │   │   └── xboot.h
        │   │   ├── link.ld
        │   │   └── source
        │   │       ├── memcpy.S
        │   │       ├── memset.S
        │   │       ├── start.S
        │   │       ├── sys-clock.c
        │   │       ├── sys-dram.c
        │   │       └── sys-uart.c
        │   ├── jtag
        │   │   ├── Makefile
        │   │   ├── include
        │   │   │   ├── byteorder.h
        │   │   │   ├── endian.h
        │   │   │   ├── f1c100s
        │   │   │   │   ├── reg-ccu.h
        │   │   │   │   └── reg-dram.h
        │   │   │   ├── io.h
        │   │   │   ├── stdarg.h
        │   │   │   ├── stddef.h
        │   │   │   ├── stdint.h
        │   │   │   ├── string.h
        │   │   │   ├── types.h
        │   │   │   └── xboot.h
        │   │   ├── link.ld
        │   │   └── source
        │   │       ├── start.S
        │   │       └── sys-jtag.c
        │   └── spi
        │       ├── Makefile
        │       ├── include
        │       │   ├── byteorder.h
        │       │   ├── endian.h
        │       │   ├── f1c100s
        │       │   │   ├── reg-ccu.h
        │       │   │   └── reg-dram.h
        │       │   ├── io.h
        │       │   ├── stdarg.h
        │       │   ├── stddef.h
        │       │   ├── stdint.h
        │       │   ├── string.h
        │       │   ├── types.h
        │       │   └── xboot.h
        │       ├── link.ld
        │       └── source
        │           ├── start.S
        │           └── sys-spi.c
        ├── h2_h3
        │   ├── h2-ddr
        │   │   ├── Makefile
        │   │   ├── include
        │   │   │   ├── byteorder.h
        │   │   │   ├── endian.h
        │   │   │   ├── h2
        │   │   │   │   ├── reg-ccu.h
        │   │   │   │   └── reg-dram.h
        │   │   │   ├── io.h
        │   │   │   ├── stdarg.h
        │   │   │   ├── stddef.h
        │   │   │   ├── stdint.h
        │   │   │   ├── string.h
        │   │   │   ├── types.h
        │   │   │   └── xboot.h
        │   │   ├── link.ld
        │   │   └── source
        │   │       ├── memcpy.S
        │   │       ├── memset.S
        │   │       ├── start.S
        │   │       ├── sys-clock.c
        │   │       ├── sys-dram.c
        │   │       └── sys-uart.c
        │   ├── h3-ddr
        │   │   ├── Makefile
        │   │   ├── include
        │   │   │   ├── byteorder.h
        │   │   │   ├── endian.h
        │   │   │   ├── h3
        │   │   │   │   ├── reg-ccu.h
        │   │   │   │   └── reg-dram.h
        │   │   │   ├── io.h
        │   │   │   ├── stdarg.h
        │   │   │   ├── stddef.h
        │   │   │   ├── stdint.h
        │   │   │   ├── string.h
        │   │   │   ├── types.h
        │   │   │   └── xboot.h
        │   │   ├── link.ld
        │   │   └── source
        │   │       ├── memcpy.S
        │   │       ├── memset.S
        │   │       ├── start.S
        │   │       ├── sys-clock.c
        │   │       ├── sys-dram.c
        │   │       └── sys-uart.c
        │   ├── jtag
        │   │   ├── Makefile
        │   │   ├── include
        │   │   │   ├── byteorder.h
        │   │   │   ├── endian.h
        │   │   │   ├── h3
        │   │   │   │   ├── reg-ccu.h
        │   │   │   │   └── reg-dram.h
        │   │   │   ├── io.h
        │   │   │   ├── stdarg.h
        │   │   │   ├── stddef.h
        │   │   │   ├── stdint.h
        │   │   │   ├── string.h
        │   │   │   ├── types.h
        │   │   │   └── xboot.h
        │   │   ├── link.ld
        │   │   └── source
        │   │       ├── start.S
        │   │       └── sys-jtag.c
        │   └── spi
        │       ├── Makefile
        │       ├── include
        │       │   ├── byteorder.h
        │       │   ├── endian.h
        │       │   ├── h3
        │       │   │   ├── reg-ccu.h
        │       │   │   └── reg-dram.h
        │       │   ├── io.h
        │       │   ├── stdarg.h
        │       │   ├── stddef.h
        │       │   ├── stdint.h
        │       │   ├── string.h
        │       │   ├── types.h
        │       │   └── xboot.h
        │       ├── link.ld
        │       └── source
        │           ├── start.S
        │           └── sys-spi.c
        ├── v3s_s3
        │   ├── jtag
        │   │   ├── Makefile
        │   │   ├── include
        │   │   │   ├── byteorder.h
        │   │   │   ├── endian.h
        │   │   │   ├── io.h
        │   │   │   ├── stdarg.h
        │   │   │   ├── stddef.h
        │   │   │   ├── stdint.h
        │   │   │   ├── string.h
        │   │   │   ├── types.h
        │   │   │   ├── v3s
        │   │   │   │   ├── reg-ccu.h
        │   │   │   │   └── reg-dram.h
        │   │   │   └── xboot.h
        │   │   ├── link.ld
        │   │   └── source
        │   │       ├── start.S
        │   │       └── sys-jtag.c
        │   ├── s3-ddr
        │   │   ├── Makefile
        │   │   ├── include
        │   │   │   ├── byteorder.h
        │   │   │   ├── endian.h
        │   │   │   ├── io.h
        │   │   │   ├── s3
        │   │   │   │   ├── reg-ccu.h
        │   │   │   │   └── reg-dram.h
        │   │   │   ├── stdarg.h
        │   │   │   ├── stddef.h
        │   │   │   ├── stdint.h
        │   │   │   ├── string.h
        │   │   │   ├── types.h
        │   │   │   └── xboot.h
        │   │   ├── link.ld
        │   │   └── source
        │   │       ├── memcpy.S
        │   │       ├── memset.S
        │   │       ├── start.S
        │   │       ├── sys-clock.c
        │   │       ├── sys-dram.c
        │   │       └── sys-uart.c
        │   ├── spi
        │   │   ├── Makefile
        │   │   ├── include
        │   │   │   ├── byteorder.h
        │   │   │   ├── endian.h
        │   │   │   ├── io.h
        │   │   │   ├── stdarg.h
        │   │   │   ├── stddef.h
        │   │   │   ├── stdint.h
        │   │   │   ├── string.h
        │   │   │   ├── types.h
        │   │   │   ├── v3s
        │   │   │   │   ├── reg-ccu.h
        │   │   │   │   └── reg-dram.h
        │   │   │   └── xboot.h
        │   │   ├── link.ld
        │   │   └── source
        │   │       ├── start.S
        │   │       └── sys-spi.c
        │   └── v3s-ddr
        │       ├── Makefile
        │       ├── include
        │       │   ├── byteorder.h
        │       │   ├── endian.h
        │       │   ├── io.h
        │       │   ├── stdarg.h
        │       │   ├── stddef.h
        │       │   ├── stdint.h
        │       │   ├── string.h
        │       │   ├── types.h
        │       │   ├── v3s
        │       │   │   ├── reg-ccu.h
        │       │   │   └── reg-dram.h
        │       │   └── xboot.h
        │       ├── link.ld
        │       └── source
        │           ├── memcpy.S
        │           ├── memset.S
        │           ├── start.S
        │           ├── sys-clock.c
        │           ├── sys-dram.c
        │           └── sys-uart.c
        └── v831
            ├── jtag
            │   ├── Makefile
            │   ├── include
            │   │   ├── byteorder.h
            │   │   ├── endian.h
            │   │   ├── io.h
            │   │   ├── stdarg.h
            │   │   ├── stddef.h
            │   │   ├── stdint.h
            │   │   ├── string.h
            │   │   ├── types.h
            │   │   ├── v831
            │   │   │   ├── reg-ccu.h
            │   │   │   └── reg-dram.h
            │   │   └── xboot.h
            │   ├── link.ld
            │   └── source
            │       ├── start.S
            │       └── sys-jtag.c
            └── spi
                ├── Makefile
                └── include
                    ├── byteorder.h
                    ├── endian.h
                    ├── io.h
                    ├── stdarg.h
                    ├── stddef.h
                    ├── stdint.h
                    ├── string.h
                    ├── types.h
                    └── v831
    
    70 directories, 290 files
    
    
    opened by taotieren 5
  • 修正擦除范围过大的BUG。

    修正擦除范围过大的BUG。

    -		cnt = ((addr & emask) + len + esize) & ~emask;
    +		cnt = (addr == base)?0:esize;
    +		cnt += (len + emask) & ~emask;
    

    原来的擦除数量计算中,直接加了esize,所以每次都多擦了4K。 在全片烧写时不会有影响,但只烧写其中一小块时,会误擦后面4K。

    当不对齐时,分别向下和向上取整就行了,这样当不对齐时,最多只会擦除掉本扇区,不会影响其它扇区。

    opened by aozima 3
  • xfel擦除对齐地址时会多擦除一个扇区

    xfel擦除对齐地址时会多擦除一个扇区

    使用xfel擦除(nor)和烧写(nor)地址容量都是对齐时,会多擦除一个扇区,这样会擦除掉后面的分区数据:

    xfel spinor erase 0x00 0x00200000
    100% [================================================] 2.004 MB, 343.741 KB/s
    xfel spinor erase 0x00 0x00100000
    100% [================================================] 1.004 MB, 336.865 KB/s
    xfel spinor erase 0x00 0x0080000
    100% [================================================] 516.000 KB, 327.770 KB/s
    

    目前擦除(856行)和烧写(916行)的容量计算为:

    cnt = ((addr & emask) + len + esize) & ~emask;  // 计算对齐的地址和容量时,会多计算一个<esize>
    

    是否可以改为:

    cnt = ((addr & emask) + len + esize - 1) & ~emask; 
    
    opened by 0helong0 3
  • ERROR: Can't found any FEL device

    ERROR: Can't found any FEL device

    执行时找不到设备

    mod@archlinux xfel git:[master] $ ./xfel version ERROR: Can't found any FEL device

    下面的结果返回NULL ctx.hdl = libusb_open_device_with_vid_pid(NULL, 0x1f3a, 0xefe8);

    查看usb设备是存在的

    mod@archlinux xfel git:[master] $ lsusb Bus 001 Device 002: ID 8087:8001 Intel Corp. Integrated Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 002 Device 003: ID 04f2:b502 Chicony Electronics Co., Ltd Integrated Camera Bus 002 Device 002: ID 8087:07dc Intel Corp. Bluetooth wireless interface Bus 002 Device 008: ID 1f3a:efe8 Allwinner Technology sunxi SoC OTG connector in FEL/flashing mode Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

    平台: archlinux libusb 1.0.24-2: https://archlinux.org/packages/core/x86_64/libusb/

    opened by Yangxiu123321 3
  • 关于多路jtag的问题

    关于多路jtag的问题

    比如用在d1上面,d1上面有两路jtag,在我使用sd卡的时候,原有pf脚的jtag就不能用的,必须要用pe脚的去调试,但是xfel默认却只有pf,我自己编了一个pe的,这样调试起来会很顺手,不知道大佬有无这种多路jtag的想法,有的话我就直接pr过来

    static const uint8_t pf_payload[] = {
        0x37, 0x03, 0x40, 0x00, 0x73, 0x20, 0x03, 0x7c, 0x37, 0x03, 0x03, 0x00,
        0x1b, 0x03, 0x33, 0x01, 0x73, 0x20, 0x23, 0x7c, 0x6f, 0x00, 0x40, 0x00,
        0x13, 0x01, 0x01, 0xfe, 0x23, 0x34, 0x81, 0x00, 0x23, 0x38, 0x91, 0x00,
        0x23, 0x3c, 0x11, 0x00, 0x13, 0x04, 0x05, 0x00, 0xef, 0x00, 0x40, 0x02,
        0x83, 0x30, 0x81, 0x01, 0x03, 0x34, 0x81, 0x00, 0x83, 0x34, 0x01, 0x01,
        0x13, 0x01, 0x01, 0x02, 0x67, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb7, 0x07, 0x00, 0x02,
        0x03, 0xa7, 0x07, 0x0f, 0xb7, 0x16, 0xff, 0xff, 0x93, 0x86, 0xf6, 0xff,
        0x13, 0x77, 0x07, 0xff, 0x13, 0x67, 0x47, 0x00, 0x23, 0xa8, 0xe7, 0x0e,
        0x03, 0xa7, 0x07, 0x0f, 0x13, 0x77, 0xf7, 0xf0, 0x13, 0x67, 0x07, 0x04,
        0x23, 0xa8, 0xe7, 0x0e, 0x03, 0xa7, 0x07, 0x0f, 0x33, 0x77, 0xd7, 0x00,
        0xb7, 0x46, 0x00, 0x00, 0x33, 0x67, 0xd7, 0x00, 0x23, 0xa8, 0xe7, 0x0e,
        0x03, 0xa7, 0x07, 0x0f, 0xb7, 0x06, 0x10, 0xff, 0x93, 0x86, 0xf6, 0xff,
        0x33, 0x77, 0xd7, 0x00, 0xb7, 0x06, 0x40, 0x00, 0x33, 0x67, 0xd7, 0x00,
        0x23, 0xa8, 0xe7, 0x0e, 0x67, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
    };
    
    static const uint8_t pe_payload[] = {
        0x37, 0x03, 0x40, 0x00, 0x73, 0x20, 0x03, 0x7C, 0x37, 0x03, 0x03, 0x00,
        0x1B, 0x03, 0x33, 0x01, 0x73, 0x20, 0x23, 0x7C, 0x6F, 0x00, 0x40, 0x00,
        0x13, 0x01, 0x01, 0xFE, 0x23, 0x34, 0x81, 0x00, 0x23, 0x38, 0x91, 0x00,
        0x23, 0x3C, 0x11, 0x00, 0x13, 0x04, 0x05, 0x00, 0xEF, 0x00, 0x40, 0x02,
        0x83, 0x30, 0x81, 0x01, 0x03, 0x34, 0x81, 0x00, 0x83, 0x34, 0x01, 0x01,
        0x13, 0x01, 0x01, 0x02, 0x67, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB7, 0x07, 0x00, 0x02,
        0x03, 0xA7, 0x07, 0x0F, 0x13, 0x67, 0xF7, 0x00, 0x23, 0xA8, 0xE7, 0x0E,
        0x03, 0xA7, 0x07, 0x0F, 0x13, 0x67, 0x07, 0x0F, 0x23, 0xA8, 0xE7, 0x0E,
        0x83, 0xA6, 0x07, 0x0F, 0x37, 0x07, 0x10, 0xFF, 0x13, 0x06, 0xF7, 0xFF,
        0x37, 0x17, 0xFF, 0xFF, 0x13, 0x07, 0xF7, 0xFF, 0xB3, 0xF6, 0xE6, 0x00,
        0x37, 0xF7, 0x00, 0x00, 0xB3, 0xE6, 0xE6, 0x00, 0x23, 0xA8, 0xD7, 0x0E,
        0x83, 0xA6, 0x07, 0x0F, 0x37, 0x07, 0xF0, 0x00, 0xB3, 0xF6, 0xC6, 0x00,
        0xB3, 0xE6, 0xE6, 0x00, 0x23, 0xA8, 0xD7, 0x0E, 0x83, 0xA6, 0x07, 0x0C,
        0x37, 0x07, 0xF1, 0xFF, 0x13, 0x07, 0xF7, 0xFF, 0xB3, 0xF6, 0xE6, 0x00,
        0x37, 0x07, 0x07, 0x00, 0xB3, 0xE6, 0xE6, 0x00, 0x23, 0xA0, 0xD7, 0x0C,
        0x03, 0xA7, 0x07, 0x0C, 0xB7, 0x06, 0x70, 0x00, 0x33, 0x77, 0xC7, 0x00,
        0x33, 0x67, 0xD7, 0x00, 0x23, 0xA0, 0xE7, 0x0C, 0x03, 0xA7, 0x07, 0x0C,
        0xB7, 0x06, 0x00, 0xF1, 0x93, 0x86, 0xF6, 0xFF, 0x33, 0x77, 0xD7, 0x00,
        0xB7, 0x06, 0x00, 0x07, 0x33, 0x67, 0xD7, 0x00, 0x23, 0xA0, 0xE7, 0x0C,
        0x03, 0xA7, 0x07, 0x0C, 0xB7, 0x06, 0x00, 0x70, 0x0B, 0x37, 0x07, 0x6C,
        0x33, 0x67, 0xD7, 0x00, 0x23, 0xA0, 0xE7, 0x0C, 0x67, 0x80, 0x00, 0x00,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
    };
    
    
    
    opened by xqyjlj 2
  • 连接d1-h开发板执行xfel ddr ddr3报错

    连接d1-h开发板执行xfel ddr ddr3报错

    平台:Mac OS X 版本:git clone 当前(2022-06-12)最新版 如题: ./xfel ddr ddr3 xfel ddr d1 - Initial ddr controller for D1 xfel ddr f133 - Initial ddr controller for F133 Failed to initial ddr controller

    ./xfel version执行结果: ./xfel version AWUSBFEX ID=0x00185900(D1/F133) dflag=0x44 dlength=0x08 scratchpad=0x00045000

    是我命令使用错误吗?

    opened by TuringKi 2
  • 错误:bulk send error

    错误:bulk send error

    xfel ddr ddr3 xfel ddr d1 - Initial ddr controller for D1 xfel ddr f133 - Initial ddr controller for F133 Failed to initial ddr controller xfel write 0x40000000 zcore_d1.bin usb bulk send error

    向D1-H上烧写时报“usb bulk send error”错误,重新编译xfel、重启电脑也都没有解决

    opened by CornerOfSkyline 2
  • xfel无法找到FEL设备

    xfel无法找到FEL设备

    你好,大佬,我想咨询一个xfel在哪吒D1 C906上无法找到 FEL device的问题的问题。 我在虚拟机ubuntu14.04下按照xfel的步骤安装了xfel,之后按住开发板上的fel键再上电,使用xfel的时候出现这个错误:ERROR:Can’t found any FEL device。 我尝试过这些方法:1.在win10下使用windows版本的xfel,也是一样的报错。2.重新安装xfel。   3.重新安装串口驱动。 image

    opened by wangtao-creator 2
  • BROM firmware source code

    BROM firmware source code

    Hello! I'm using MQ-Pro which uses the D1 chip and it works great with xfel so thank you for a great project! I'm wondering if source code for the firmware that xfel communicates with is available somewhere. I'd like to understand better how it works. Of course I can dump the assembly starting at 0x0, but it doesn't have any symbol information, and it looks like it's using undocumented memory regions such as 0x70005e0. Thanks!

    opened by guncha 1
Releases(v1.2.9)
Owner
xboot.org
xboot.org
A fully-featured, cross platform XO-CHIP/S-CHIP/CHIP-8 emulator written in C and SDL.

JAXE (Just Another XO-CHIP/CHIP-8 Emulator) Brix Space Invaders (In Debug Mode) Black Rainbow DVN8 Super Neat Boy Chicken Scratch CHIP-8 was a virtual

Kurtis Dinelle 21 Nov 12, 2022
Risc-V RV32IMAFC + 80s ERA SoC (bitmap + GPU, sprites, tilemaps)

A simple (no interrupts or exceptions/traps), Risc-V RV32IMAFC CPU, with a pseudo SMT (dual thread) capability. The display is similar to the 8-bit era machines, along with audio, SDCARD read support, UART and PS/2 keyboard input.

Rob S 17 Jun 3, 2022
A collection of command line tools for ARM devices with Allwinner SoCs.

sunxi-tools Copyright (C) 2012 Alejandro Mery [email protected] For a full list of contributors, see this link or use the command git shortlog -se --no-m

Free/Open Source Software for Allwinner SoCs (A10/A13/A10s/A20/A31/...) 467 Jan 2, 2023
Single-chip solution for Hi-speed USB2.0(480Mbps) JTAG/SPI Debugger based on RISC-V MCU CH32V30x/CH32V20x

480Mbps High Speed USB2.0 JTAG Debugger Open source information |-- bin |--------MCU: MCU target program |--------WIN APP |------------------USB20Jtag

RISC-V 58 Jan 5, 2023
Allwinner V3S Opensource

KS_V3S • Bilibili Video Introduction:https://www.bilibili.com/video/BV17z4y1S7D6 I have designed this PCB, because the sheer power of this SoC, at ver

Kevincoooool 195 Dec 29, 2022
The demo projects for Allwinner D1 SBC

D1 Demo The demo projects for Allwinner D1 SBC hello project show the basic native compiling on D1 SBC. vector example cross compiling RISC-V Vector c

RVBoards 20 Oct 18, 2022
This repository contains the tools we used in our research on the Google Titan M chip

Titan M tools In this repository, we publish the tools we used in our research on the Google Titan M chip. We presented our results at Black Hat EU 21

Quarkslab 149 Dec 5, 2022
LiteX is a Migen/MiSoC based Core/SoC builder that provides the infrastructure to easily create Cores/SoCs (with or without CPU).

LiteX is a Migen/MiSoC based Core/SoC builder that provides the infrastructure to easily create Cores/SoCs (with or without CPU). The common components of a SoC are provided directly: Buses and Streams (Wishbone, AXI, Avalon-ST), Interconnect, Common cores (RAM, ROM, Timer, UART, etc...), CPU wrappers/integration, etc... and SoC creation capabilities can be greatly extended with the ecosystem of LiteX cores (DRAM, PCIe, Ethernet, SATA, etc...) that can be integrated/simulated/build easily with LiteX.

null 1.9k Jan 3, 2023
Porting RT-Thread for Gowin GW1NSR-4C Soc GCC version

Porting RT-Thread for Gowin GW1NSR-4C Soc GCC version Hello everyone, this project based on RT-THREAD NANO 3.1.5 and GOWIN GW1NSR-4C Soc chip. The com

Ray 3 Apr 23, 2022
Kernel with ARM/KVM for SM-A600G (Samsung Galaxy A6) with Exynos7870 SoC

Kernel source for SM-A600G (Samsung Galaxy A6 with exynos7870) with KVM support. Warning: Super long text ahead, be careful not to mess up your brain

@raspiduino 6 Sep 20, 2022
kianv a simple implementation of a rv32im riscv cpu and soc in verilog with firmware that runs raytracer, mandelbrot, etc.....

A very simple riscv cpu/soc one single file implementation created in my spare time! But it is full rv32im CPU :) I have wrote all from scratch to lea

splinedrive 122 Dec 26, 2022
Suckless-tools - My fork of suckless tools.

suckless-tools Here is my fork of suckless tools. I didn't include tabbed, i was using but not actively. I am using xfce4-terminal instead of st. Beca

null 2 Jan 7, 2022
The Vulkan Profiles Tools are a collection of tools delivered with the Vulkan SDK for Vulkan application developers to leverage Vulkan Profiles while developing a Vulkan application

Copyright © 2021-2022 LunarG, Inc. Vulkan Profiles Tools (BETA) The Vulkan Profiles Tools are a collection of tools delivered with the Vulkan SDK for

The Khronos Group 73 Dec 25, 2022
Love 6's Regular Expression Engine. Support Concat/Select/Closure Basic function. Hope u can enjoy this tiny engine :)

Regex_Engine Love 6's Blog Website: https://love6.blog.csdn.net/ Love 6's Regular Expression Engine Hope u can love my tiny regex engine :) maybe a fe

Love6 2 May 24, 2022
Firmware for DMR transceivers using the NXP MK22 MCU, AT1846S RF chip and HR-C6000 DMR chipset. Including the Radioddiy GD-77, Baofeng DM-1801 and Baofeng RD-5R.

OpenGD77 Firmware for DMR transceivers using the NXP MK22 MCU, AT1846S RF chip and HR-C6000 DMR chipset. This includes the Radioddiy GD-77, Radioddity

Open Ham 109 Dec 31, 2022
EMUCHIP8, a CHIP-8 emulator.

EMUCHIP8 Chip-8 Demo Video This is a fun retro emulator project of mine. You can download the source code and build with MAKE, then insert your chip-8

Levent Kaya 12 Jan 1, 2023
A Pipelined RISC-V RV32I Core in Verilog

Toast-RV32i Toast is a RISC-V soft core written in Verilog that implements a subset of the RV32I ISA version 2.2. Documentation: https://toast-core.re

George Yu 28 Dec 20, 2022
RISC-V has a 128-bit ISA that is fairly developed, but not standardized fully yet.

128-bit RISC-V assembler RISC-V has a 128-bit ISA that is fairly developed, but not standardized fully yet. I am maintaining a RISC-V userspace emulat

Alf-André Walla 39 Nov 20, 2022
CHIP-8 interpreter in C11

shoganai | しょうがない It means accepting what happens beyond our control and cannot be avoided. It is used to encourage people to move forward without bei

Gioele 2 Sep 28, 2021