Nordic, nRF52 Preview DK

出自 flip the world
前往: 導覽搜尋

Prepare

Install SDK

  1. Get latest SDK from https://developer.nordicsemi.com/nRF52_SDK/nRF52_SDK_v0.x.x/ (ex. nRF52_SDK_0.9.2_dbc28c9.zip)
  2. Get SDK with FreeRTOS example from http://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v11.x.x/ (nRF5_SDK_11.0.0-2.alpha_bc3f6a0.zip)
  3. Edit ./components/toolchain/gcc/Makefile.posix to fit your toolchain setting if necessary

Install JLink

  1. Download "Software and Document pack" from https://www.segger.com/jlink-software.html according your platform (ex. x86_64)
  2. decompress and make a symbolic to /opt/SEGGER/JLink
    1. ln -s ~/Downloads/JLink_Linux_V510c_x86_64 /opt/SEGGER/JLink

Toolchain

sudo add-apt-repository ppa:terry.guo/gcc-arm-embedded sudo apt-get update sudo apt-get install gcc-arm-none-eabi

Programming

1. Softdevice
    ex.
    sudo /home/tommy/projects/mbed/nRF52/NrfJProg_7_7_0_Linux/nrfjprog --family NRF52 --program ~/projects/mbed/nRF52/s132_nrf52_1.0.0-3.alpha/s132_nrf52_1.0.0-3.alpha_softdevice.hex

2. change dir to example 
    ex.
    sudo ~/projects/mbed/nRF52/NrfJProg_7_7_0_Linux/nrfjprog --sectorerase --family nRF52 --program _build/nrf52832_xxaa_s132.hex

3. sudo ~/projects/mbed/nRF52/NrfJProg_7_7_0_Linux/nrfjprog --sectorerase --family nRF52 --program _build/nrf52832_xxaa.hex
4. power recycle to take effect
tommy@tommy-HP-EliteBook-Folio-1040-G2:~/projects/mbed/nordic/nRF52/nRF5_SDK_11.0.0_89a8197/examples/ble_peripheral/ble_app_beacon/pca10040/s132/armgcc$ sudo ~/projects/mbed/nordic/tools/nrfjprog --sectorerase --family nRF52 --program ~/projects/mbed/nordic/nRF52/s132/s132_nrf52_1.0.0-3.alpha_softdevice.hex 
Parsing hex file.
Erasing page at address 0x0.
Erasing page at address 0x3000.
Erasing page at address 0x4000.
Erasing page at address 0x5000.
Erasing page at address 0x6000.
Erasing page at address 0x7000.
Erasing page at address 0x8000.
Erasing page at address 0x9000.
Erasing page at address 0xA000.
Erasing page at address 0xB000.
Erasing page at address 0xC000.
Erasing page at address 0xD000.
Erasing page at address 0xE000.
Erasing page at address 0xF000.
Erasing page at address 0x10000.
Erasing page at address 0x11000.
Erasing page at address 0x12000.
Erasing page at address 0x13000.
Erasing page at address 0x14000.
Erasing page at address 0x15000.
Erasing page at address 0x16000.
Erasing page at address 0x17000.
Erasing page at address 0x18000.
Erasing page at address 0x19000.
Erasing page at address 0x1A000.
Erasing page at address 0x1B000.
Erasing page at address 0x1C000.
Erasing page at address 0x1D000.
Applying system reset.
Checking that the area to write is not protected.
Programing device.
tommy@tommy-HP-EliteBook-Folio-1040-G2:~/projects/mbed/nordic/nRF52/nRF5_SDK_11.0.0_89a8197/examples/ble_peripheral/ble_app_beacon/pca10040/s132/armgcc$ sudo ~/projects/mbed/nordic/tools/nrfjprog --sectorerase --family nRF52 --program _build/nrf52832_xxaa_s132.hex 
Parsing hex file.
Erasing page at address 0x1C000.
Erasing page at address 0x1D000.
Erasing page at address 0x1E000.
Erasing page at address 0x1F000.
Applying system reset.
Checking that the area to write is not protected.
Programing device.

Console, UART

nRF52 preview DK + CP2105

  • cp2105 in host
nRF52        Host
-----------------
RX           TX
CTS          RTS
TX           RX
RTS          CTS

Tool, nRF Connect

nRF Connect v1.0

App source

SDK

nRF52 Application - HMC5883L( 3 Axis Digital Compass)

nRF52 Application - MAX7219, Serially Interfaced, 8-Digit LED Display Drivers (scrolling text)

nRF52 Application - zephyr, small, scalable real-time operating system