lpcware

Cant findt debug break points when using ROM Uart driver calls

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 18, 2016 by lpcware
Content originally posted in LPCWare by tjoAG on Tue Jun 07 06:32:26 MST 2016
Hi,

I'm using the UARt ROM driver in my LPC1517 project. It actually works ok, until I have added to many? then KEIL can't find the breakpoints (No red dot, but greyed out).
the code seems to wotk fine. when commenting one line of ROM driver function call, then it can find the breka points again.

It seems strange..

adding a second line of "LPC_UARTD_API->uart_get_line(uartHandle, &param) " makes KEIL not finding any BP!!!!


Code snippet below

int UARTSendMessage(unsigned char* pBuffer, int nSize)
{

// Set buffer pointer
param.buffer = (uint8_t *) pBuffer;
// set the size
param.size = nSize;

// Interrupt mode
param.transfer_mode = RX_MODE_BUF_FULL; // Stop when buffer empty
param.driver_mode = DRIVER_MODE_INTERRUPT;

/* Setup the transmit callback, this will get called when the
   transfer is complete */
param.callback_func_pt = (UART_CALLBK_T) waitCallback;

if(gotTXCallback) // TX ready
{
// Set flag
gotTXCallback = false;
// Send data
if (LPC_UARTD_API->uart_get_line(uartHandle, &param))
{
errorUART();
}
// Send data
//if (LPC_UARTD_API->uart_get_line(uartHandle, &param))
{
//errorUART();
}
}
return 0;
}


void InitUART(void)
{
uint32_t ret_value;
UART_CONFIG_T cfg;

// First set the needed mux for TX and RX
Init_UART0_PinMux();
// Initialize UART0
Chip_UART_Init(LPC_USART0);
// UART clsock
Chip_Clock_SetUARTFRGDivider(1);

// 9600BPS, 8N1, ASYNC mode, no errors, clock filled in later
cfg.sys_clk_in_hz = 0; // U_PCLK frequency in Hz
cfg.baudrate_in_hz = 9600;// Baud Rate in Hz
cfg.config = 1;// 8N1
cfg.sync_mod =  0; // Asynchronous Mode
cfg.error_en = NO_ERR_EN;// Enable No Errors

// Perform a sanity check on the storage allocation
if (LPC_UARTD_API->uart_get_mem_size() > sizeof(uartHandleMEM))
{
// Example only: this should never happen and probably isn't needed for most UART code.
errorUART();
}

// Setup the UART handle
uartHandle = LPC_UARTD_API->uart_setup((uint32_t) LPC_USART0, (uint8_t *) &uartHandleMEM);
if (uartHandle == NULL)
{
errorUART();
}

// Need to tell UART ROM API function the current UART peripheral clock speed
cfg.sys_clk_in_hz = Chip_Clock_GetSystemClockRate();

// Initialize the UART with the configuration parameters
ret_value = LPC_UARTD_API->uart_init(uartHandle, &cfg);
LPC_SYSCTL->FRGCTRL = ret_value;

// Enable IRQ
NVIC_EnableIRQ(UART0_IRQn);

// Ready to TX
gotTXCallback = true;
}

Outcomes