-- The C compiler identification is GNU 13.2.1 -- The ASM compiler identification is GNU -- Found assembler: /usr/bin/arm-none-eabi-gcc -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/arm-none-eabi-gcc - skipped -- Detecting C compile features -- Detecting C compile features - done -- NRF5_SDK_DIR: /home/pico/canokey-nrf52//nrf_sdk/nRF5_SDK_17.1.0_ddde560 Please download the 17.1.0 version SDK from https://www.nordicsemi.com/Products/Development-software/nRF5-SDK/Download#infotabs and extract it to /home/pico/canokey-nrf52//nrf_sdk/nRF5_SDK_17.1.0_ddde560 CMake Error at nrf_sdk/nRF5_SDK.cmake:9 (message): NRF5 SDK not found Call Stack (most recent call first): CMakeLists.txt:47 (include)
~/canokey-nrf52/build$ cmake -DCROSS_COMPILE=/usr/bin/arm-none-eabi- -DCMAKE_TOOLCHAIN_FILE=../toolchain.cmake -DCMAKE_BUILD_TYPE=Release .. -- NRF5_SDK_DIR: /home/pico/canokey-nrf52//nrf_sdk/nRF5_SDK_17.1.0_ddde560 -- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1") patching file include/mbedtls/config.h patching file include/mbedtls/ecp.h patching file library/ecp_curves.c patching file library/version_features.c patching file programs/test/query_config.c patching file include/mbedtls/config.h patching file include/mbedtls/ecp.h patching file library/ecp_curves.c patching file library/version_features.c patching file programs/test/query_config.c patching file include/mbedtls/ecp.h patching file library/ecp.c patching file include/mbedtls/ecp.h patching file library/ecp.c patching file tests/suites/test_suite_ecp.data patching file library/ecp.c CMake Deprecation Warning at canokey-core/canokey-crypto/patched/mbedtls/CMakeLists.txt:23 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell CMake that the project does not need compatibility with older versions.
-- Found Python3: /usr/bin/python3 (found version "3.12.3") found components: Interpreter -- Performing Test C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS -- Performing Test C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS - Success -- Configuring done (1.3s) -- Generating done (0.1s) -- Build files have been written to: /home/pico/canokey-nrf52/build
canokey.hex is a raw firmware file in text format, so it’s bigger than binary formats. Flash tools such as J-Link and DAP-Link recognize this format. —by z4yx
$ wget https://nsscprodmedia.blob.core.windows.net/prod/software-and-other-downloads/desktop-software/nrf-command-line-tools/sw/versions-10-x-x/10-24-2/nrf-command-line-tools_10.24.2_amd64.deb $ sudo dpkg -i ./nrf-command-line-tools_10.24.2_amd64.deb Selecting previously unselected package nrf-command-line-tools. (Reading database ... 153542 files and directories currently installed.) Preparing to unpack .../nrf-command-line-tools_10.24.2_amd64.deb ... Unpacking nrf-command-line-tools (10.24.2) ... Setting up nrf-command-line-tools (10.24.2) ...
============================================================= The J-Link SW and documentation package is required for nrf command line tools to work. To install the version of J-Link that was tested and verified with nrf command line tools execute one of the following: sudo apt install /opt/nrf-command-line-tools/share/JLink_Linux_V794e_x86_64.deb --fix-broken
linker garbage collection into account Memory region Used Size Region Size %age Used FLASH: 32592 B 38 KB 83.76% BOOTLOADER_CONFIG: 88 B 2 KB 4.30% MBR_PARAMS_PAGE: 0 B 4 KB 0.00% BOOTLOADER_SETTINGS: 4 KB 4 KB 100.00% RAM: 19824 B 224 KB 8.64% DBL_RESET: 0 B 4 B 0.00% NOINIT: 62 B 128 B 48.44% UICR_BOOTLOADER: 4 B 4 B 100.00% UICR_MBR_PARAM_PAGE: 4 B 4 B 100.00% text data bss dec hex filename 32680 680 23310 56670 dd5e _build/build-feather_nrf52840_express/feather_nrf52840_express_bootloader-0.9.2.out Create feather_nrf52840_express_bootloader-0.9.2.hex Create feather_nrf52840_express_bootloader-0.9.2_nosd.hex Create update-feather_nrf52840_express_bootloader-0.9.2_nosd.uf2 /home/pico/Adafruit_nRF52_Bootloader/lib/uf2/utils/uf2conv.py:182: SyntaxWarning: invalid escape sequence '\s' words = re.split('\s+', line) Converting to uf2, output size: 73216, start address: 0x0 Wrote 73216 bytes to _build/build-feather_nrf52840_express/update-feather_nrf52840_express_bootloader-0.9.2_nosd.uf2 Create feather_nrf52840_express_bootloader-0.9.2_s140_6.1.1.hex Zip created at _build/build-feather_nrf52840_express/feather_nrf52840_express_bootloader-0.9.2_s140_6.1.1.zip
we understand, it is just too difficult for us to become the support manager for a board we dont own, didn’t design. it will disappoint people who have support questions and we don’t want to do that. please continue to use your fork :)
E104-BT5040U大体上就是Nordic NRF52840 dongle (PCA10059)的克隆,从针脚定义到模块功能保持一致。官方放弃对Nordic NRF52840 dongle (PCA10059)的开发移植相当于给E104-BT5040U宣判了死刑。。。还是直接用 nRF Connect for Desktop 刷hex格式固件吧,既方便又安全。E104-BT5040U自带的bootloader直接编译自 Nordic SDK 16.0,利用nRF Connect for Desktop刷固件时它会校验外部bootloader(如果有)签名,如果不是Nordic签名就不会修改内部bootloader。
烧录canokey固件
将 E104-BT5040U 插到电脑USB口,然后运行nRF Connect for Desktop烧录,相比ST-Link V2简单很多,等硬件到货后回来更新烧录结果。
更新:今天 E104-BT5040U 到货后第一时间运行nRF Connect for Desktop烧录了canokey.hex固件。手上的这两只自带Nordic官方bootloader,进入bootloader模式(DFU模式)只需要按RST按钮就可以了,然后在nRF Connect for Desktop中便可以被正常识别然后进行烧录固件等操作。
初始化
刷好了固件后还不能直接使用,插在电脑USB接口上毫无动静,因为还需要进行初始化设置。参照README,这个操作需要在Linux系统中使用 pcsc_scan 程序和项目提供的初始化脚本,看来没办法在Windows下操作。试过WSL直通USB的办法,但是 usbipd list 看不到这个设备所以行不通。打算物理机安装Linux进行后续操作。
更新:之前刷了几次固件,在Windows和Linux下都无法识别到USB设备。后来尝试用一根USB公转母延长线刷就OK了。我用来刷固件的电脑只有USB3接口,感觉是接口问题。刷好后Window右下角会弹出 检测到Canokey Go to console.canokeys.org to connect 的提示,此时再进入Linux系统进行后续初始化操作。