2018年7月8日 星期日

[nRF52840] ble app uart test

    本篇主要是仿照之前在nRF52832上面的ble app uart範例將其實做在nRF52840上面.

    nRF52832 Link: nRF52832_ble_app_uart

1. Test Video:
    

2. Test Code Download Link: (only support keil-mdk 5)
    nRF52840_ble_app_uart_code

3. Softdevice Download Link: 
    s140_nrf52_6.0.0_softdevice.hex

4. Mergehex Tool Download Link:
    mergehex.exe

5. Main Flow:

  1. Show "Hello! nRF52840, counter value" on APP window.
  2. Delay 500ms.
  3. Go back to 1.    


6. Build Code Flow:
    (1). open ble_app_uart project: (keil-mdk 5)
                    e.g. path = C:\nRF5_SDK_15.0.0_a53641a_ble_app_uart\examples\ble_peripheral\
                                 ble_app_uart\pca10056\s140\arm5_no_packs\
                                 ble_app_uart_pca10056_s140.uvprojx

    (2). build app code and get the output hex file.

               (i). build app code.

               (ii). Get nrf52840_xxaa.hex.
                      e.g. path = C:\nRF5_SDK_15.0.0_a53641a_ble_app_uart\examples\ble_peripheral\
                                 ble_app_uart\pca10056\s140\arm5_no_packs\_build\
                                 nrf52840_xxaa.hex


    (3). merge app with Softdevice.
          (i). create a test folder. (e.g. 52840)
             
         (ii). copy nrf52840_xxaa.hex / mergehex.exe / .s140_nrf52_6.0.0_softdevice.hex into test folder.

         (iii). open command line window and type merge command.

               e.g. D:\mergehex.exe -m nrf52840_xxaa.hex s140_nrf52_6.0.0_softdevice.hex -o ble_app_uart.hex


  (4). update code.

    • connect nRF52840 board with PC via USB cable.
    • power-on nRF52840 board and it will show JLINK storage on PC.


    • copy ble_app_uart.hex into JLINK folder and it will reset after copy done.
    • start to test.

         


2 則留言:

  1. hello! thank you for your code, i compiled it and could connect.The LED is blinking when advertizing and turns on when connected, but my app is not receiving any counter. i tried to use COM listener, but still nothing. what might be the problem?

    回覆刪除
    回覆
    1. Hi:
      Can you enter to debug mode? If yes, you can check "counter" and "printf_buffer" is work or not. Thanks.

      刪除