Closed jonesuki closed 1 year ago
I tried adjust the setting in Settings > Privacy & Security by adding both "Terminal" and "blisp" to the "Developer Tools" list. But the result remains the same.
I just compiled on my a1 MacBook Pro with some errors blisp does run Here is what I got the first error is before I connected my pincil V2:
MacBook-Pro-4:blisp markjohn$ ./blisp write --chip bl70x --reset Pinecilv2_EN.bin Failed to open device. <<<<<* Not connected>>> MacBook-Pro-4:blisp markjohn$ ./blisp write --chip bl70x --reset Pinecilv2_EN.bin Sending a handshake... OK
Failed to get boot info. Getting chip info...MacBook-Pro-4:blisp markjohn$ ./blisp write --chip bl70x --reset Pinecilv2_EN.bin Sending a handshake... OK Failed to receive response. (ret = 0)
Failed to get boot info. Getting chip info...MacBook-Pro-4:blisp markjohn$
Here is my compile result:
MacBook-Pro-4:build markjohn$ cd blisp
MacBook-Pro-4:blisp markjohn$ mkdir build && cd build
MacBook-Pro-4:build markjohn$ cmake -DBLISP_BUILD_CLI=ON ..
-- The C compiler identification is AppleClang 14.0.0.14000029
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/markjohn/build/blisp/build
MacBook-Pro-4:build markjohn$ cmake --build .
[ 1%] Building C object CMakeFiles/libblisp_obj.dir/lib/blisp.c.o
/Users/markjohn/build/blisp/lib/blisp.c:71:42: warning: passing 'uint32_t ' (aka 'unsigned int ') to parameter of type 'int ' converts between pointers to integer types with different sign [-Wpointer-sign]
sp_get_port_usb_vid_pid(serial_port, &vid, &pid);
^~~~
/Users/markjohn/build/blisp/vendor/libserialport/libserialport.h:675:80: note: passing argument to parameter 'usb_vid' here
SP_API enum sp_return sp_get_port_usb_vid_pid(const struct sp_port port, int usb_vid, int usb_pid);
^
/Users/markjohn/build/blisp/lib/blisp.c:71:48: warning: passing 'uint32_t ' (aka 'unsigned int ') to parameter of type 'int ' converts between pointers to integer types with different sign [-Wpointer-sign]
sp_get_port_usb_vid_pid(serial_port, &vid, &pid);
^~~~
/Users/markjohn/build/blisp/vendor/libserialport/libserialport.h:675:94: note: passing argument to parameter 'usb_pid' here
SP_API enum sp_return sp_get_port_usb_vid_pid(const struct sp_port port, int usb_vid, int usb_pid);
^
2 warnings generated.
[ 2%] Building C object CMakeFiles/libblisp_obj.dir/lib/chip/blisp_chip_bl60x.c.o
[ 3%] Building C object CMakeFiles/libblisp_obj.dir/lib/chip/blisp_chip_bl70x.c.o
[ 4%] Building C object CMakeFiles/libblisp_obj.dir/vendor/libserialport/serialport.c.o
[ 5%] Building C object CMakeFiles/libblisp_obj.dir/vendor/libserialport/timing.c.o
[ 6%] Building C object CMakeFiles/libblisp_obj.dir/vendor/libserialport/macosx.c.o
/Users/markjohn/build/blisp/vendor/libserialport/macosx.c:45:35: warning: 'kIOMasterPortDefault' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
if (IOServiceGetMatchingServices(kIOMasterPortDefault, classes,
^~~~~~~~
kIOMainPortDefault
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:133:19: note: 'kIOMasterPortDefault' has been explicitly marked deprecated here
const mach_port_t kIOMasterPortDefault
^
/Users/markjohn/build/blisp/vendor/libserialport/macosx.c:213:35: warning: 'kIOMasterPortDefault' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
if (IOServiceGetMatchingServices(kIOMasterPortDefault, classes,
^~~~~~~~
kIOMainPortDefault
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:133:19: note: 'kIOMasterPortDefault' has been explicitly marked deprecated here
const mach_port_t kIOMasterPortDefault
^
2 warnings generated.
[ 6%] Built target libblisp_obj
[ 7%] Linking C shared library shared/libblisp.dylib
[ 7%] Built target libblisp
[ 8%] Linking C static library static/libblisp.a
[ 8%] Built target libblisp_static
[ 9%] Building C object tools/blisp/argtable3/src/CMakeFiles/argtable3.dir/arg_cmd.c.o
[ 10%] Building C object tools/blisp/argtable3/src/CMakeFiles/argtable3.dir/arg_date.c.o
[ 11%] Building C object tools/blisp/argtable3/src/CMakeFiles/argtable3.dir/arg_dbl.c.o
[ 12%] Building C object tools/blisp/argtable3/src/CMakeFiles/argtable3.dir/arg_dstr.c.o
[ 13%] Building C object tools/blisp/argtable3/src/CMakeFiles/argtable3.dir/arg_end.c.o
[ 14%] Building C object tools/blisp/argtable3/src/CMakeFiles/argtable3.dir/arg_file.c.o
[ 15%] Building C object tools/blisp/argtable3/src/CMakeFiles/argtable3.dir/arg_hashtable.c.o
[ 16%] Building C object tools/blisp/argtable3/src/CMakeFiles/argtable3.dir/arg_int.c.o
[ 17%] Building C object tools/blisp/argtable3/src/CMakeFiles/argtable3.dir/arg_lit.c.o
[ 18%] Building C object tools/blisp/argtable3/src/CMakeFiles/argtable3.dir/arg_rem.c.o
[ 19%] Building C object tools/blisp/argtable3/src/CMakeFiles/argtable3.dir/arg_rex.c.o
[ 20%] Building C object tools/blisp/argtable3/src/CMakeFiles/argtable3.dir/arg_str.c.o
[ 21%] Building C object tools/blisp/argtable3/src/CMakeFiles/argtable3.dir/arg_utils.c.o
[ 22%] Building C object tools/blisp/argtable3/src/CMakeFiles/argtable3.dir/argtable3.c.o
[ 23%] Building C object tools/blisp/argtable3/src/CMakeFiles/argtable3.dir/arg_getopt_long.c.o
[ 24%] Linking C static library libargtable3_static.a
[ 24%] Built target argtable3
[ 25%] Building C object tools/blisp/CMakeFiles/blisp.dir/src/main.c.o
[ 26%] Building C object tools/blisp/CMakeFiles/blisp.dir/src/cmd/write.c.o
/Users/markjohn/build/blisp/tools/blisp/src/cmd/write.c:415:40: warning: format specifies type 'long' but the argument has type 'int64_t' (aka 'long long') [-Wformat]
printf("0b / %ldb (0.00%%)\n", firmware_file_size);
%lld
/Users/markjohn/build/blisp/tools/blisp/src/cmd/write.c:429:65: warning: format specifies type 'long' but the argument has type 'int64_t' (aka 'long long') [-Wformat]
printf("%" PRIu32 "b / %ldb (%.2f%%)\n", sent_data, firmware_file_size,
~~~ ^~~~~~~~~~~~~~~~~~
%lld
2 warnings generated.
[ 27%] Linking C executable blisp
[ 27%] Built target blisp
[ 28%] Building C object tools/blisp/argtable3/examples/CMakeFiles/echo.dir/echo.c.o
[ 29%] Linking C executable echo
[ 29%] Built target echo
[ 30%] Building C object tools/blisp/argtable3/examples/CMakeFiles/ls.dir/ls.c.o
[ 31%] Linking C executable ls
[ 31%] Built target ls
[ 32%] Building C object tools/blisp/argtable3/examples/CMakeFiles/multisyntax.dir/multisyntax.c.o
[ 33%] Linking C executable multisyntax
[ 33%] Built target multisyntax
[ 34%] Building C object tools/blisp/argtable3/examples/CMakeFiles/mv.dir/mv.c.o
[ 35%] Linking C executable mv
[ 35%] Built target mv
[ 36%] Building C object tools/blisp/argtable3/examples/CMakeFiles/myprog.dir/myprog.c.o
[ 37%] Linking C executable myprog
[ 37%] Built target myprog
[ 38%] Building C object tools/blisp/argtable3/examples/CMakeFiles/myprog_C89.dir/myprog_C89.c.o
[ 39%] Linking C executable myprog_C89
[ 39%] Built target myprog_C89
[ 40%] Building C object tools/blisp/argtable3/examples/CMakeFiles/testargtable3.dir/testargtable3.c.o
[ 41%] Linking C executable testargtable3
[ 41%] Built target testargtable3
[ 42%] Building C object tools/blisp/argtable3/examples/CMakeFiles/uname.dir/uname.c.o
[ 43%] Linking C executable uname
[ 43%] Built target uname
[ 44%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_static.dir/testall.c.o
[ 45%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_static.dir/testarglit.c.o
[ 46%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_static.dir/testargstr.c.o
[ 47%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_static.dir/testargint.c.o
[ 48%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_static.dir/testargdate.c.o
[ 49%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_static.dir/testargdbl.c.o
[ 50%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_static.dir/testargfile.c.o
[ 51%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_static.dir/testargrex.c.o
[ 52%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_static.dir/testargdstr.c.o
[ 53%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_static.dir/testargcmd.c.o
[ 54%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_static.dir/CuTest.c.o
[ 55%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_static.dir/testarghashtable.c.o
[ 56%] Linking C executable test_static
[ 56%] Built target test_static
[ 57%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_src.dir/testall.c.o
[ 58%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_src.dir/testarglit.c.o
[ 59%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_src.dir/testargstr.c.o
[ 60%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_src.dir/testargint.c.o
[ 61%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_src.dir/testargdate.c.o
[ 62%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_src.dir/testargdbl.c.o
[ 63%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_src.dir/testargfile.c.o
[ 64%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_src.dir/testargrex.c.o
[ 65%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_src.dir/testargdstr.c.o
[ 66%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_src.dir/testargcmd.c.o
[ 67%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_src.dir/CuTest.c.o
[ 68%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_src.dir/testarghashtable.c.o
[ 69%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_src.dir/__/src/arg_cmd.c.o
[ 70%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_src.dir/__/src/arg_date.c.o
[ 71%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_src.dir/__/src/arg_dbl.c.o
[ 72%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_src.dir/__/src/arg_dstr.c.o
[ 73%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_src.dir/__/src/arg_end.c.o
[ 74%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_src.dir/__/src/arg_file.c.o
[ 75%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_src.dir/__/src/arg_hashtable.c.o
[ 76%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_src.dir/__/src/arg_int.c.o
[ 77%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_src.dir/__/src/arg_lit.c.o
[ 78%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_src.dir/__/src/arg_rem.c.o
[ 79%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_src.dir/__/src/arg_rex.c.o
[ 80%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_src.dir/__/src/arg_str.c.o
[ 81%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_src.dir/__/src/arg_utils.c.o
[ 82%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_src.dir/__/src/argtable3.c.o
[ 83%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_src.dir/__/src/arg_getopt_long.c.o
[ 84%] Linking C executable test_src
[ 84%] Built target test_src
[ 85%] Generating /Users/markjohn/build/blisp/vendor/argtable3/dist/argtable3.c
xargs: dos2unix: No such file or directory
[ 86%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_amalgamation.dir/testall.c.o
[ 87%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_amalgamation.dir/testarglit.c.o
[ 88%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_amalgamation.dir/testargstr.c.o
[ 89%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_amalgamation.dir/testargint.c.o
[ 90%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_amalgamation.dir/testargdate.c.o
[ 91%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_amalgamation.dir/testargdbl.c.o
[ 92%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_amalgamation.dir/testargfile.c.o
[ 93%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_amalgamation.dir/testargrex.c.o
[ 94%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_amalgamation.dir/testargdstr.c.o
[ 95%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_amalgamation.dir/testargcmd.c.o
[ 96%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_amalgamation.dir/CuTest.c.o
[ 97%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_amalgamation.dir/testarghashtable.c.o
[ 98%] Building C object tools/blisp/argtable3/tests/CMakeFiles/test_amalgamation.dir/__/dist/argtable3.c.o
[100%] Linking C executable test_amalgamation
xargs: dos2unix: No such file or directory
[100%] Built target test_amalgamation
the following diff contains the changes that worked for my PinecilV2 on both M1 and Intel i9 macs...
diff --git a/lib/blisp_easy.c b/lib/blisp_easy.c
index 37a9216..e5d4690 100644
--- a/lib/blisp_easy.c
+++ b/lib/blisp_easy.c
@@ -326,8 +326,8 @@ int32_t blisp_easy_flash_write(struct blisp_device* device,
while (sent_data < data_size) {
buffer_size = data_size - sent_data;
- if (buffer_size > 2052) {
- buffer_size = 2052;
+ if (buffer_size > 252) {
+ buffer_size = 252;
}
blisp_easy_transport_read(data_transport, buffer,
buffer_size); // TODO: Error Handling
It did take a couple of attempts running to get it to see the pinecil, but when it did it flashed it.
@zombiRon that's only change you did to the source code?
other than the usual swap malloc.h for stdlib.h to satisfy clang, yes.
@zombiRon sweet, thanks! :blush:
Should be fixed in latest v0.0.3 release.
I received my pinecil a few days ago and I tried to update the firmware from my iMac (27-inch 2020, Mac OS X 13.1 Ventura).
First, I can compile the blisp from source using the instruction. I installed the latest version of cmake (v3.25.1) using homebrew.
The compile process did give a few warning, but the program can be compiled successfully:
And here is the result of running blisp:
Same result even if I specify port manually:
Probably this is caused by the non-signing code not allowed in Mac OS X: From dmesg: