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

UART works only debug mode

Hi,

I am using own hardware board based on https://www.raytac.com/product/ins.php?index_id=24  module, it uses nRF52840.

I

I am facing an strange issue that UART is not working in normal mode but it is transferring a char when i add break point and run it. 

If just keep in debug mode and run still it is not sending anything to uart transfer only when i add break point that too with single char put.

HI have taken uart example and removed the uart get byte part and kept only uart put byte part with default ascii char for every 500ms. 

/**
 * @brief Function for main application entry.
 */
int main(void)
{
    uint32_t err_code;

   // bsp_board_init(BSP_INIT_LEDS);

	
    const app_uart_comm_params_t comm_params =
      {
          RX_PIN_NUMBER,
          TX_PIN_NUMBER,
          RTS_PIN_NUMBER,
          CTS_PIN_NUMBER,
          UART_HWFC,
          false,
#if defined (UART_PRESENT)
          NRF_UART_BAUDRATE_115200
#else
          NRF_UARTE_BAUDRATE_115200
#endif
      };

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

    APP_ERROR_CHECK(err_code);

#ifndef ENABLE_LOOPBACK_TEST
    printf("\r\nUART example started.\r\n");

    while (true)
    {
        uint8_t cr;
        //while (app_uart_get(&cr) != NRF_SUCCESS);
			cr = 'A';
        while (app_uart_put(cr) != NRF_SUCCESS);
			LED0_Toggle();
        nrf_delay_ms(500);
    }
#else

    // This part of the example is just for testing the loopback .
    while (true)
    {
        uart_loopback_test();
    }
#endif
}

P0.00 and P0.01 are connected to external 32Khz crystal, I dont have way to verify the crystal generate clock or not. Even if external crystal failed to work i am expecting internal RC to work. 

Please help me to understand how to enable the RC clock and soft device if required . 

Or what could the root cause of the issue ?

I have attached uart example code with sdkconfig i am using it. Please help me with this. 

SDK used: \nRF5_SDK_17.0.2_d674dde\examples\peripheral\uart

r2n_uart_test.zip

Parents
  • Hi again

    Sorry about the late reply, but we're currently catching up with the backlog from the Easter vacation here in Norway.

    Can you upload your project from one step up in the hierarchy (...\SDK_FOLDER\examples\peripheral\uart)so the main file is added as well? This way I should be able to reproduce it on a DK on my side to see if the problem persists there.

    Are you able to run the unmodified \peripheral\uart example on your module at all (in normal mode)? Are you able to use the RTT viewer to see log messages when your application is running in normal mode, so that we can get any information of where the application runs into problems?

    In our experience, live debugging sessions over screen sharing/meetings are generally not very effective, so I would suggest sticking to the forum.

    Best regards,

    Simon

Reply
  • Hi again

    Sorry about the late reply, but we're currently catching up with the backlog from the Easter vacation here in Norway.

    Can you upload your project from one step up in the hierarchy (...\SDK_FOLDER\examples\peripheral\uart)so the main file is added as well? This way I should be able to reproduce it on a DK on my side to see if the problem persists there.

    Are you able to run the unmodified \peripheral\uart example on your module at all (in normal mode)? Are you able to use the RTT viewer to see log messages when your application is running in normal mode, so that we can get any information of where the application runs into problems?

    In our experience, live debugging sessions over screen sharing/meetings are generally not very effective, so I would suggest sticking to the forum.

    Best regards,

    Simon

Children
No Data
Related