This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Using the nRF52840 dongle to receive and display data via the serial port (terminal)

Hello,

I am developing the following application:

An nRF52840 bluetooth module connected to a sensor does data acquisition and then sends it directly to an nRF52840 dongle which transmits the data to the serial port.

I thought for this I would use the example "ble_app_uart_c" to receive the data and transmit it on the serial port.

This is very easy to do with an nRF52840 DK, but I can't do it with the dongle because it seems that the serial port is not available with the dongle.

What do I need to do in order for this to work properly using the dongle?

Thank you in advance and best regards,


Maxime

Parents
  • In case you actually want the hardware serial port and can't use USB as suggested by the team, here are the salient points in ./boards/pca10059.h you require for using the hardware serial port, LEDs and push-button:

    // Serial Port definitions for PCA10059
    #define RX_PIN_NUMBER   9 // 13
    #define TX_PIN_NUMBER  10 // 15
    #define CTS_PIN_NUMBER UART_PIN_DISCONNECTED //NRF_UART_PSEL_DISCONNECTED // 17
    #define RTS_PIN_NUMBER UART_PIN_DISCONNECTED //NRF_UART_PSEL_DISCONNECTED // 20
    #define HWFC           false
    
    // LED definitions for PCA10059
    // Each LED color is considered a separate LED
    #define LEDS_NUMBER    4
    #define LED1_G         NRF_GPIO_PIN_MAP(0,6)
    #define LED2_R         NRF_GPIO_PIN_MAP(0,8)
    #define LED2_G         NRF_GPIO_PIN_MAP(1,9)
    #define LED2_B         NRF_GPIO_PIN_MAP(0,12)
    #define LED_1          LED1_G
    #define LED_2          LED2_R
    #define LED_3          LED2_G
    #define LED_4          LED2_B
    #define LEDS_ACTIVE_STATE 0
    #define LEDS_LIST { LED_1, LED_2, LED_3, LED_4 }
    #define LEDS_INV_MASK  LEDS_MASK
    #define BSP_LED_0      LED_1
    #define BSP_LED_1      LED_2
    #define BSP_LED_2      LED_3
    #define BSP_LED_3      LED_4
    
    // There is only one button for the application as the second button is used for a RESET.
    #define BUTTONS_NUMBER 1
    #define BUTTON_1       NRF_GPIO_PIN_MAP(1,6)
    #define BUTTON_PULL    NRF_GPIO_PIN_PULLUP
    #define BUTTONS_ACTIVE_STATE 0
    #define BUTTONS_LIST { BUTTON_1 }
    #define BSP_BUTTON_0   BUTTON_1
    #define BSP_SELF_PINRESET_PIN NRF_GPIO_PIN_MAP(0,19)

    These work with the ble_app_uart.c pplication with or without the USB serial port code. You might be using different hardware pins for Rx and Tx, simple to change those; just be sure sdk_config.h doesn't conflict with pin settings but SES should highlight any conflicts.

  • Hi,

    That is indeed what I would like to do. I tried your solution:

    - I added the #defines for the serial port in the file PCA10059.h.
    - Of course I changed the preprocessor definition with BOARD_PCA0059.

    => There is no conflict during compilation
    => Once I run the application on the nRF52840 dongle, I have no access to the serial port of the dongle at all. So it's impossible to have a serial communication afterwards ...!

    Is there a step I'm missing? Is this solution working for you?

    Thank you in advance.

Reply
  • Hi,

    That is indeed what I would like to do. I tried your solution:

    - I added the #defines for the serial port in the file PCA10059.h.
    - Of course I changed the preprocessor definition with BOARD_PCA0059.

    => There is no conflict during compilation
    => Once I run the application on the nRF52840 dongle, I have no access to the serial port of the dongle at all. So it's impossible to have a serial communication afterwards ...!

    Is there a step I'm missing? Is this solution working for you?

    Thank you in advance.

Children
No Data
Related