From 5a0ae8abc33f580307b571c18d40d7d303cb3269 Mon Sep 17 00:00:00 2001 From: River M <97197236+River-Mochi@users.noreply.github.com> Date: Thu, 9 Mar 2023 14:15:12 -0800 Subject: [PATCH 1/4] Update README.md --- README.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 9c66951..c0e9cbc 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ ![GitHub release (latest by date)](https://img.shields.io/github/v/release/pine64/blisp?logoColor=gray&style=social) -# Bouffalo Labs ISP tool & library +# BLISP (Bouffalo Labs ISP tool & library) -Open source tool and library for flashing Bouffalo RISC-V MCUs. +This is an open source tool and library for flashing Bouffalo RISC-V MCUs. **NOTE:** Library API and `blisp` tool cli arguments are not stable yet. @@ -25,9 +25,13 @@ Open source tool and library for flashing Bouffalo RISC-V MCUs. - [x] MacOS - [x] FreeBSD -# Building +# How to flash Pinecil V2 -## Clone repository +Check out the [wiki page](https://github.com/pine64/blisp/wiki/Update-Pinecil-V2). + +# Building from code + +### Clone repository If you have not cloned this repository locally; clone the git repository locally by running @@ -37,7 +41,7 @@ cd blisp git submodule update --init --recursive ``` -## Build the library and command line utility +### Build the library and command line utility For building `blisp` command line tool, use following commands: @@ -63,6 +67,3 @@ For BL60X, you need to specify also the serial port path: blisp write --chip bl60x --reset -p /dev/ttyUSB0 name_of_firmware.bin ``` -# How to flash Pinecil V2 - -Check out the [wiki page](https://github.com/pine64/blisp/wiki/Update-Pinecil-V2). From e219e50efb17711f636e458872b473c644685752 Mon Sep 17 00:00:00 2001 From: River M <97197236+River-Mochi@users.noreply.github.com> Date: Thu, 9 Mar 2023 16:39:20 -0800 Subject: [PATCH 2/4] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c0e9cbc..f42524a 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ mkdir build && cd build cmake -DBLISP_BUILD_CLI=ON .. cmake --build . ``` +#### Need more build details? [See here](https://github.com/pine64/blisp/wiki/Update-Pinecil-V2#build-blisp-flasher-from-code). # Usage From 565c9ff9137f02d186954ca91a7b2c98397f51a5 Mon Sep 17 00:00:00 2001 From: River M <97197236+River-Mochi@users.noreply.github.com> Date: Sun, 12 Mar 2023 14:54:49 -0700 Subject: [PATCH 3/4] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f42524a..1436b04 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ This is an open source tool and library for flashing Bouffalo RISC-V MCUs. - [x] MacOS - [x] FreeBSD -# How to flash Pinecil V2 +# How to update Pinecil V2 Check out the [wiki page](https://github.com/pine64/blisp/wiki/Update-Pinecil-V2). From 6f508d3db8cd8a85f8c08af44a37db363a2af3ba Mon Sep 17 00:00:00 2001 From: porsolic Date: Fri, 17 Mar 2023 00:12:43 +0100 Subject: [PATCH 4/4] Enable building on FreeBSD hosts FreeBSD has libusb built in. Needs external libserialport. --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3549185..1c369de 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,11 +32,13 @@ set_target_properties(libblisp_static PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "static" OUTPUT_NAME "blisp") +if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") target_sources(libblisp_obj PRIVATE ${CMAKE_SOURCE_DIR}/vendor/libserialport/serialport.c ${CMAKE_SOURCE_DIR}/vendor/libserialport/timing.c) target_include_directories(libblisp_obj PRIVATE ${CMAKE_SOURCE_DIR}/vendor/libserialport) +endif() if(WIN32) target_link_libraries(libblisp PRIVATE Setupapi.lib) @@ -44,7 +46,7 @@ if(WIN32) target_compile_definitions(libblisp_obj PRIVATE LIBSERIALPORT_MSBUILD) target_sources(libblisp_obj PRIVATE ${CMAKE_SOURCE_DIR}/vendor/libserialport/windows.c) -elseif(UNIX AND NOT APPLE) +elseif(UNIX AND NOT APPLE AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") target_sources(libblisp_obj PRIVATE ${CMAKE_SOURCE_DIR}/vendor/libserialport/linux.c ${CMAKE_SOURCE_DIR}/vendor/libserialport/linux_termios.c) @@ -56,6 +58,10 @@ elseif(UNIX AND NOT APPLE) "SP_API=__attribute__((visibility(\"default\")))" "SP_PRIV=__attribute__((visibility(\"hidden\")))") write_file(${CMAKE_SOURCE_DIR}/vendor/libserialport/config.h "// bypass errors.") +elseif(UNIX AND ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") + target_include_directories(libblisp_obj PRIVATE /usr/local/include/) + target_link_libraries(libblisp PRIVATE -L/usr/local/lib usb serialport) + target_link_libraries(libblisp_static PRIVATE -L/usr/local/lib usb serialport) elseif(APPLE) target_sources(libblisp_obj PRIVATE ${CMAKE_SOURCE_DIR}/vendor/libserialport/macosx.c)