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

UART Works only if NRF52 is connected to PC

Hello,

So I need to connect my NRF52 with a LoRa module E32 via an UART connexion, and then I need to send data using this function:

void send_data(int s)
{
		  
			printf("&&%d\n",s);
			
}

The probleme is that my code work only if my NRF52 is plugged to a computer via USB and open a Hyperterminal, if I connect my NRF to a powerbank or to a PC but witout opening the HyperTerminal the code wont work.

my UART configuration is :

#define UART0_ENABLED 1

#if (UART0_ENABLED == 1)
#define UART0_CONFIG_HWFC         NRF_UART_HWFC_DISABLED
#define UART0_CONFIG_PARITY       NRF_UART_PARITY_EXCLUDED
#define UART0_CONFIG_BAUDRATE     NRF_UART_BAUDRATE_9600
#define UART0_CONFIG_PSEL_TXD 6
#define UART0_CONFIG_PSEL_RXD 8
#define UART0_CONFIG_PSEL_CTS 7
#define UART0_CONFIG_PSEL_RTS 5
#define UART0_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_LOW
#ifdef NRF52
#define UART0_CONFIG_USE_EASY_DMA false
//Compile time flag
#define UART_EASY_DMA_SUPPORT     1
#define UART_LEGACY_SUPPORT       1
#endif //NRF52
#endif

How can I solve this probleme?

Thanks

Related