出自flip the world

BLE mesh:修訂間差異

Tommy​(留言 | 貢獻)
Tommy​(留言 | 貢獻)
Add a lead sentence
 
(未顯示同一使用者於中間所作的 6次修訂)
第1行: 第1行:
Building '''Bluetooth mesh''' firmware for an nRF52840 with the Nordic mesh SDK, from CMake setup through to the light example.
[[File:NRF52840-DONGLE.JPG|nrf52840 dongle]]
[[File:NRF52840-DONGLE.JPG|nrf52840 dongle]]
== Prepare ==
== Prepare ==
第6行: 第8行:
* nRF5_SDK_15.3.0_59ac345
* nRF5_SDK_15.3.0_59ac345
* nrf5SDKforMeshv310src
* nrf5SDKforMeshv310src
=== Toolchain ===
* gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2
* export PATH=$PATH_TOOLCHAIN_BIN:$PATH


=== Cmake build ===
=== Cmake build ===
第13行: 第19行:


=== Programming ===
=== Programming ===
#If nrfutil fail, try more times!!!
*If nrfutil fail, try more times!!!
##SoftDevice FWID (sd-req)
* Create app package
###s112_nrf52_6.0.0 0xA7
** nrfutil pkg generate --hw-version 52 --sd-req 0x00 --application-version 1 --application nrf52840_xxaa.hex zip.zip
###s112_nrf52_6.1.0 0xB0
* Display package info
###s112_nrf52_6.1.1 0xB8
** nrfutil pkg display dfu.zip
###s130_nrf51_1.0.0 0x67
* Program the package
###s130_nrf51_2.0.0 0x80
* sudo nrfutil dfu usb-serial -pkg zip.zip -p /dev/ttyACM0
###s132_nrf52_2.0.0 0x81
* Using tool "nRF connect" in windows is better
###s130_nrf51_2.0.1 0x87
[[File:NRF_Connect_Programmer.jpg|200px|nrf connect]]
###s132_nrf52_2.0.1 0x88
###s212_nrf52_2.0.1 0x8D
###s332_nrf52_2.0.1 0x8E
###s132_nrf52_3.0.0 0x8C
###s132_nrf52_3.1.0 0x91
###s132_nrf52_4.0.0 0x95
###s132_nrf52_4.0.2 0x98
###s132_nrf52_4.0.3 0x99
###s132_nrf52_4.0.4 0x9E
###s132_nrf52_4.0.5 0x9F
###s212_nrf52_4.0.5 0x93
###s332_nrf52_4.0.5 0x94
###s132_nrf52_5.0.0 0x9D
###s212_nrf52_5.0.0 0x9C
###s332_nrf52_5.0.0 0x9B
###s132_nrf52_5.1.0 0xA5
###s132_nrf52_6.0.0 0xA8
###s132_nrf52_6.1.0 0xAF
###s132_nrf52_6.1.1 0xB7
###s140_nrf52_6.0.0 0xA9
###s140_nrf52_6.1.0 0xAE
###s140_nrf52_6.1.1 0xB6
###s212_nrf52_6.1.1 0xBC
###s332_nrf52_6.1.1 0xBA
###s340_nrf52_6.1.1 0xB9


# Create app package
=== Touble shooting ===
## nrfutil pkg generate --hw-version 52 --sd-req 0x00 --application-version 1 --application nrf52840_xxaa.hex zip.zip
* Lost provision
# Display package info
** erase provision data
## 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
<pre>
[[File:NRF_Connect_Programmer.jpg|200px|nrf connect]]
  .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>
 
** 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]]
 
[[Category:Connectivity]]

2026年8月23日 (日) 17:57的最新修訂

Building Bluetooth mesh firmware for an nRF52840 with the Nordic mesh SDK, from CMake setup through to the light example.

nrf52840 dongle

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

  1. cd nrf5SDKforMeshv310src
  2. mkdir build & cd build
  3. 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

nrf connect

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

nRF5x Mesh client/server