"BLE mesh" 修訂間的差異
(→Prepare) |
(→Light example) |
||
(未顯示同一使用者於中間所作的 19 次修訂) | |||
行 1: | 行 1: | ||
+ | [[File:NRF52840-DONGLE.JPG|nrf52840 dongle]] | ||
== Prepare == | == Prepare == | ||
− | + | * Platform: nRF52840 | |
+ | * Board: PCA10059 | ||
=== SDK & Mesh SDK === | === SDK & Mesh SDK === | ||
− | + | * nRF5_SDK_15.3.0_59ac345 | |
− | + | * nrf5SDKforMeshv310src | |
+ | |||
+ | === Toolchain === | ||
+ | * gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2 | ||
+ | * export PATH=$PATH_TOOLCHAIN_BIN:$PATH | ||
=== Cmake build === | === Cmake build === | ||
# cd nrf5SDKforMeshv310src | # cd nrf5SDKforMeshv310src | ||
# mkdir build & cd build | # mkdir build & cd build | ||
− | # cmake -G Ninja .. -DSDK_ROOT=$PATH_OF_NRF5_SDK -DBOARD= | + | # cmake -G Ninja .. -DSDK_ROOT=$PATH_OF_NRF5_SDK -DPLATFORM=nrf52840_xxAA -DBOARD=pca10056 <---for nrf52840 |
=== Programming === | === Programming === | ||
+ | *If nrfutil fail, try more times!!! | ||
+ | * Create app package | ||
+ | ** nrfutil pkg generate --hw-version 52 --sd-req 0x00 --application-version 1 --application nrf52840_xxaa.hex zip.zip | ||
+ | * Display package info | ||
+ | ** nrfutil pkg display dfu.zip | ||
+ | * Program the package | ||
+ | * sudo nrfutil dfu usb-serial -pkg zip.zip -p /dev/ttyACM0 | ||
+ | * Using tool "nRF connect" in windows is better | ||
+ | [[File:NRF_Connect_Programmer.jpg|200px|nrf connect]] | ||
+ | |||
+ | === Touble shooting === | ||
+ | * Lost provision | ||
+ | ** erase provision data | ||
+ | |||
<pre> | <pre> | ||
− | + | .nrf_mesh_flash : | |
− | + | { | |
− | + | PROVIDE(__start_nrf_mesh_flash = .); | |
− | + | KEEP(*(SORT(.nrf_mesh_flash.*))) <<---------------------------remove, to allow section recycle | |
− | + | PROVIDE(__stop_nrf_mesh_flash = .); | |
− | + | } > FLASH | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</pre> | </pre> | ||
− | + | ||
− | + | ** program again, then, program back to original one | |
− | + | ||
− | + | === Light example === | |
+ | * program light_switch_client_nrf52840_xxAA_s140_6.1.0 + s140_nrf52_6.1.0_softdevice.hex | ||
+ | * program light_switch_server_nrf52840_xxAA_s140_6.1.0.hex + s140_nrf52_6.1.0_softdevice.hex | ||
+ | [[File:Ble_mesh_light.jpg|200px|nRF5x Mesh client/server]] |
於 2019年4月13日 (六) 11:27 的最新修訂
目錄
Prepare
- Platform: nRF52840
- Board: PCA10059
SDK & Mesh SDK
- nRF5_SDK_15.3.0_59ac345
- nrf5SDKforMeshv310src
Toolchain
- gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2
- export PATH=$PATH_TOOLCHAIN_BIN:$PATH
Cmake build
- cd nrf5SDKforMeshv310src
- mkdir build & cd build
- cmake -G Ninja .. -DSDK_ROOT=$PATH_OF_NRF5_SDK -DPLATFORM=nrf52840_xxAA -DBOARD=pca10056 <---for nrf52840
Programming
- If nrfutil fail, try more times!!!
- Create app package
- nrfutil pkg generate --hw-version 52 --sd-req 0x00 --application-version 1 --application nrf52840_xxaa.hex zip.zip
- Display package info
- nrfutil pkg display dfu.zip
- Program the package
- sudo nrfutil dfu usb-serial -pkg zip.zip -p /dev/ttyACM0
- Using tool "nRF connect" in windows is better
Touble shooting
- Lost provision
- erase provision data
.nrf_mesh_flash : { PROVIDE(__start_nrf_mesh_flash = .); KEEP(*(SORT(.nrf_mesh_flash.*))) <<---------------------------remove, to allow section recycle PROVIDE(__stop_nrf_mesh_flash = .); } > FLASH
- program again, then, program back to original one
Light example
- program light_switch_client_nrf52840_xxAA_s140_6.1.0 + s140_nrf52_6.1.0_softdevice.hex
- program light_switch_server_nrf52840_xxAA_s140_6.1.0.hex + s140_nrf52_6.1.0_softdevice.hex