From fe5b1d57963f9fef6431b7b75bc2da3fe4ab26f2 Mon Sep 17 00:00:00 2001 From: JianjunJiang <8192542@qq.com> Date: Wed, 4 Aug 2021 11:48:31 +0800 Subject: [PATCH] [xfel]update some readme.md --- .gitignore | 1 + README.md | 35 ++++++++++++++++++++++++++++++++++- main.c | 2 +- x.h | 1 + 4 files changed, 37 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 0c9b61e..f8163ae 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ *.d *.o *.map +*.exe *~ # diff --git a/README.md b/README.md index 401c4e3..9ec0599 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,10 @@ Tiny FEL tools for allwinner SOC, support RISC-V D1 chip. ## How to build +### Linux platform + 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: + ```shell sudo apt install libusb-1.0-0-dev ``` @@ -19,9 +22,39 @@ make sudo make install ``` +### Window platform + +Install some build tools + +```shell +sudo apt install mingw-w64 +sudo apt install autoconf +sudo apt install libtool-bin +``` + + +```shell +git clone https://github.com/libusb/libusb.git +cd libusb +./autogen.sh +./configure --host=i686-w64-mingw32 --prefix=/usr/i686-w64-mingw32/ +make +sudo make install +``` + +Build xfel source code + +```shell +cd xfel +CROSS=i686-w64-mingw32- make +``` + +For 64-bits windows, you can using `x86_64-w64-mingw32-` instead of `i686-w64-mingw32` above. + + ## Usage -``` +```shell xfel(v1.1.3) - https://github.com/xboot/xfel usage: xfel version - Show chip version diff --git a/main.c b/main.c index d1a48ef..e7c60cd 100644 --- a/main.c +++ b/main.c @@ -59,7 +59,7 @@ static void hexdump(uint32_t addr, void * buf, size_t len) for(j = 0; j < len; j += 16) { - printf("%08zx: ", addr + j); + printf("%08x: ", (uint32_t)(addr + j)); for(i = 0; i < 16; i++) { if(j + i < len) diff --git a/x.h b/x.h index 7df46b1..82e35a1 100644 --- a/x.h +++ b/x.h @@ -15,6 +15,7 @@ extern "C" { #elif defined(__WINDOWS__) # include # include +# include #else # error "platform not supported!" #endif