Merge branch 'pine64:master' into master

This commit is contained in:
River M 2023-03-17 04:53:04 -07:00 committed by GitHub
commit a59d4f7a32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 9 deletions

View File

@ -32,11 +32,13 @@ set_target_properties(libblisp_static PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "static" ARCHIVE_OUTPUT_DIRECTORY "static"
OUTPUT_NAME "blisp") OUTPUT_NAME "blisp")
if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
target_sources(libblisp_obj PRIVATE target_sources(libblisp_obj PRIVATE
${CMAKE_SOURCE_DIR}/vendor/libserialport/serialport.c ${CMAKE_SOURCE_DIR}/vendor/libserialport/serialport.c
${CMAKE_SOURCE_DIR}/vendor/libserialport/timing.c) ${CMAKE_SOURCE_DIR}/vendor/libserialport/timing.c)
target_include_directories(libblisp_obj PRIVATE ${CMAKE_SOURCE_DIR}/vendor/libserialport) target_include_directories(libblisp_obj PRIVATE ${CMAKE_SOURCE_DIR}/vendor/libserialport)
endif()
if(WIN32) if(WIN32)
target_link_libraries(libblisp PRIVATE Setupapi.lib) target_link_libraries(libblisp PRIVATE Setupapi.lib)
@ -44,7 +46,7 @@ if(WIN32)
target_compile_definitions(libblisp_obj PRIVATE LIBSERIALPORT_MSBUILD) target_compile_definitions(libblisp_obj PRIVATE LIBSERIALPORT_MSBUILD)
target_sources(libblisp_obj PRIVATE target_sources(libblisp_obj PRIVATE
${CMAKE_SOURCE_DIR}/vendor/libserialport/windows.c) ${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 target_sources(libblisp_obj PRIVATE
${CMAKE_SOURCE_DIR}/vendor/libserialport/linux.c ${CMAKE_SOURCE_DIR}/vendor/libserialport/linux.c
${CMAKE_SOURCE_DIR}/vendor/libserialport/linux_termios.c) ${CMAKE_SOURCE_DIR}/vendor/libserialport/linux_termios.c)
@ -56,6 +58,10 @@ elseif(UNIX AND NOT APPLE)
"SP_API=__attribute__((visibility(\"default\")))" "SP_API=__attribute__((visibility(\"default\")))"
"SP_PRIV=__attribute__((visibility(\"hidden\")))") "SP_PRIV=__attribute__((visibility(\"hidden\")))")
write_file(${CMAKE_SOURCE_DIR}/vendor/libserialport/config.h "// bypass errors.") 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) elseif(APPLE)
target_sources(libblisp_obj PRIVATE target_sources(libblisp_obj PRIVATE
${CMAKE_SOURCE_DIR}/vendor/libserialport/macosx.c) ${CMAKE_SOURCE_DIR}/vendor/libserialport/macosx.c)

View File

@ -4,9 +4,9 @@
![GitHub release (latest by date)](https://img.shields.io/github/v/release/pine64/blisp?logoColor=gray&style=social) ![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. **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] MacOS
- [x] FreeBSD - [x] FreeBSD
# Building # How to update 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 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 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: For building `blisp` command line tool, use following commands:
@ -46,6 +50,7 @@ mkdir build && cd build
cmake -DBLISP_BUILD_CLI=ON .. cmake -DBLISP_BUILD_CLI=ON ..
cmake --build . cmake --build .
``` ```
#### Need more build details? [See here](https://github.com/pine64/blisp/wiki/Update-Pinecil-V2#build-blisp-flasher-from-code).
# Usage # Usage
@ -63,6 +68,3 @@ For BL60X, you need to specify also the serial port path:
blisp write --chip bl60x --reset -p /dev/ttyUSB0 name_of_firmware.bin 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).