problems with forwarding read rssi values to the wifi module through serial port

Hello. I am using nrf52832 for Ble-based positioning. currently i am tackling with establishment of an anchor measuring rssi values and sending them to a central center (a PC) through an additional wifi module. i am sending data from nrf52832 to the wifi module through serial (UART) connection. to this end, i combined a simple UART example with a blincky-c example of nrf5sdk. doing so, i receive a couple of rssi values and then the transmission to pc stocks. i tried chaning the priority of the UART transmission from lowest to highest and it seems to work. i wonder to know whether my job was ok or this change of priority may cause other problems...

Moreover, i have tried combining the libuarte example to the ble central blincky which is expected to handle my above problem, but it did not work (send data on serial) due to an unkown reason. 

best regards, 

Parents
  • Hi

    Okay, can you confirm what you mean by changing the UART transmission priority from "lowest" to "highest" means? There are 8 priority levels in the nRF52832, from 0-7 where 0 is highest. Priority levels 0, 1, 3, and 4 are reserved for the SoftDevice, so the highest available priority you can set a user configured peripheral to would be priority 2. If you're not setting the UART to use one of the SoftDevice reserved priorities, it should be perfectly fine to use if that solves your problem.

    Best regards,

    Simon

  • Hi

    & thanks a lot for your precise hints. here is my code:

    i have set it in this function:

    static void uart_init(void)
    {
    ret_code_t err_code;

    app_uart_comm_params_t const comm_params =
    {
    .rx_pin_no = RX_PIN_NUMBER,
    .tx_pin_no = TX_PIN_NUMBER,
    .rts_pin_no = RTS_PIN_NUMBER,
    .cts_pin_no = CTS_PIN_NUMBER,
    .flow_control = APP_UART_FLOW_CONTROL_DISABLED,
    .use_parity = false,
    .baud_rate = UART_BAUDRATE_BAUDRATE_Baud115200
    };

    APP_UART_FIFO_INIT(&comm_params,
    UART_RX_BUF_SIZE,
    UART_TX_BUF_SIZE,
    uart_error_handle,
    APP_IRQ_PRIORITY_HIGHEST,
    err_code);

    APP_ERROR_CHECK(err_code);
    }

    and the term is defined in 'app_util_platform" as :

    //lint -save -e113 -e452
    /**@brief The interrupt priorities available to the application while the SoftDevice is active. */
    typedef enum
    {
    #ifndef SOFTDEVICE_PRESENT
    APP_IRQ_PRIORITY_HIGHEST = _PRIO_SD_HIGH,
    #else
    APP_IRQ_PRIORITY_HIGHEST = _PRIO_APP_HIGH,
    #endif
    APP_IRQ_PRIORITY_HIGH = _PRIO_APP_HIGH,
    #ifndef SOFTDEVICE_PRESENT
    APP_IRQ_PRIORITY_MID = _PRIO_SD_LOW,
    #else
    APP_IRQ_PRIORITY_MID = _PRIO_APP_MID,
    #endif
    APP_IRQ_PRIORITY_LOW_MID = _PRIO_APP_LOW_MID,
    APP_IRQ_PRIORITY_LOW = _PRIO_APP_LOW,
    APP_IRQ_PRIORITY_LOWEST = _PRIO_APP_LOWEST,
    APP_IRQ_PRIORITY_THREAD = _PRIO_THREAD /**< "Interrupt level" when running in Thread Mode. */
    } app_irq_priority_t;
    //lint -restore

    it seems to be one of those reserved, yes?

Reply
  • Hi

    & thanks a lot for your precise hints. here is my code:

    i have set it in this function:

    static void uart_init(void)
    {
    ret_code_t err_code;

    app_uart_comm_params_t const comm_params =
    {
    .rx_pin_no = RX_PIN_NUMBER,
    .tx_pin_no = TX_PIN_NUMBER,
    .rts_pin_no = RTS_PIN_NUMBER,
    .cts_pin_no = CTS_PIN_NUMBER,
    .flow_control = APP_UART_FLOW_CONTROL_DISABLED,
    .use_parity = false,
    .baud_rate = UART_BAUDRATE_BAUDRATE_Baud115200
    };

    APP_UART_FIFO_INIT(&comm_params,
    UART_RX_BUF_SIZE,
    UART_TX_BUF_SIZE,
    uart_error_handle,
    APP_IRQ_PRIORITY_HIGHEST,
    err_code);

    APP_ERROR_CHECK(err_code);
    }

    and the term is defined in 'app_util_platform" as :

    //lint -save -e113 -e452
    /**@brief The interrupt priorities available to the application while the SoftDevice is active. */
    typedef enum
    {
    #ifndef SOFTDEVICE_PRESENT
    APP_IRQ_PRIORITY_HIGHEST = _PRIO_SD_HIGH,
    #else
    APP_IRQ_PRIORITY_HIGHEST = _PRIO_APP_HIGH,
    #endif
    APP_IRQ_PRIORITY_HIGH = _PRIO_APP_HIGH,
    #ifndef SOFTDEVICE_PRESENT
    APP_IRQ_PRIORITY_MID = _PRIO_SD_LOW,
    #else
    APP_IRQ_PRIORITY_MID = _PRIO_APP_MID,
    #endif
    APP_IRQ_PRIORITY_LOW_MID = _PRIO_APP_LOW_MID,
    APP_IRQ_PRIORITY_LOW = _PRIO_APP_LOW,
    APP_IRQ_PRIORITY_LOWEST = _PRIO_APP_LOWEST,
    APP_IRQ_PRIORITY_THREAD = _PRIO_THREAD /**< "Interrupt level" when running in Thread Mode. */
    } app_irq_priority_t;
    //lint -restore

    it seems to be one of those reserved, yes?

Children
No Data
Related