Hi Nordic Support Team,
i'm working with nrf52832 development kit. In that, We are adding the UART features in BLE DFU secure bootloader example code in SDKV15.2.0. But data is not transmitting and also receiving on minicom.
In which below i mentioned our uart initialization in BLE DFU secure bootloader example code ,
void UARTE0_UART0_IRQHandler(){
if(NRF_UARTE0->EVENTS_ENDRX)
{
/* if receiver */
NRF_UARTE0->EVENTS_ENDRX = 0;
NRF_UARTE0->TASKS_STARTRX = 1;
NRF_UARTE0->TASKS_FLUSHRX = 1;
NRF_UARTE0->TASKS_STARTTX = 1;
}
if(NRF_UARTE0->EVENTS_ENDTX)
{
/* if transmitter */
NRF_UARTE0->EVENTS_ENDTX = 1;
// NRF_UARTE0->TASKS_STARTTX = 0;
NRF_UARTE0->INTENCLR = UARTE_INTENSET_ENDTX_Msk;
printf("trnsmt value %p",tx_buffer);
}
}
/* UART initialization */
void uart_init(){
/* Configure TX and RX pins from board.h */
nrf_gpio_cfg_output(TX_PIN_NUMBER);
nrf_gpio_cfg_input(RX_PIN_NUMBER, GPIO_PIN_CNF_PULL_Disabled);
NRF_UARTE0->PSEL.TXD = TX_PIN_NUMBER;
NRF_UARTE0->PSEL.RXD = RX_PIN_NUMBER;
NRF_UARTE0->RXD.MAXCNT = 8;
//NRF_UARTE0->TXD.MAXCNT = 1;
NRF_UARTE0->TASKS_STARTRX = 1;
/* Configure CTS and RTS pins if HWFC is true in board.h */
/*if(HWFC){
nrf_gpio_cfg_output(RTS_PIN_NUMBER);
nrf_gpio_cfg_input(CTS_PIN_NUMBER, GPIO_PIN_CNF_PULL_Disabled);
NRF_UARTE0->PSEL.RTS = RTS_PIN_NUMBER;
NRF_UARTE0->PSEL.CTS = CTS_PIN_NUMBER;
NRF_UARTE0->CONFIG = (UARTE_CONFIG_HWFC_Enabled << UARTE_CONFIG_HWFC_Pos);
}*/
/* Configure other UART parameters, BAUD rate is defined in nrf52-uart.h */
NRF_UARTE0->BAUDRATE = (UARTE_BAUDRATE << UARTE_BAUDRATE_BAUDRATE_Pos);
NRF_UARTE0->ENABLE = (UARTE_ENABLE_ENABLE_Enabled << UARTE_ENABLE_ENABLE_Pos);
// Enable UART TX End interrupt only
NRF_UARTE0->INTENSET = (UARTE_INTENSET_ENDRX_Set << UARTE_INTENSET_ENDRX_Pos) | (UARTE_INTENSET_ENDTX_Msk);
//(UARTE_INTENSET_ENDTX_Set << UARTE_INTENSET_ENDTX_Pos);
//(UARTE_INTENSET_ENDTX_Set << UARTE_INTENSET_ENDTX_Pos);
NRF_UARTE0->TXD.PTR = (uint32_t)&tx_buffer;
NRF_UARTE0->RXD.PTR = (uint32_t)&rx_buffer;
NRF_UARTE0->TXD.MAXCNT = 10;
//NRF_UARTE0->INTENSET = (UARTE_INTENSET_ENDRX_Set << UARTE_INTENSET_ENDRX_Pos) | (UARTE_INTENSET_ENDTX_Msk) ;
NVIC_ClearPendingIRQ(UARTE0_UART0_IRQn);
NVIC_SetPriority(UARTE0_UART0_IRQn, 1);
NVIC_EnableIRQ(UARTE0_UART0_IRQn);
}
Kindly give suggestion for our problems.
Thanks & regards,
Anitha.L