Dear @RaRo ,
I appreciate your response. Firstly, my main objective is to obtain the current time for use in my project. Initially, I believed that the time library would suffice for this purpose. However, after encountering the -1 issue, I came across some comments suggesting the use of RTC (Real-Time Clock) to fetch the current time using LPCXpresso. Consequently, I attempted to implement the RTC example from the SDK, despite not requiring the whole example, but rather just a function that can return the current time. Unfortunately, I encountered some difficulties, and here is the problem I faced.
The program execution gets stuck in this particular function:
index = GETCHAR();
Upon further investigation, I discovered that the code is blocked at this point, making it impossible to proceed with the step-by-step execution:
/* See fsl_debug_console.h for documentation of this function. */
int DbgConsole_Getchar(void)
{
char ch;
/* Do nothing if the debug UART is not initialized. */
if (kSerialPort_None == s_debugConsole.serial_port_type)
{
return -1;
}
while (kStatus_HAL_UartSuccess !=
s_debugConsole.getChar((hal_uart_handle_t)&s_debugConsole.uartHandleBuffer[0], (uint8_t *)(&ch), 1))
{
return -1;
}
return (int)ch;
}
in the : s_debugConsole.getChar. in the : HAL_UartReceiveBlocking function the following line : status = USART_ReadBlocking(s_UsartAdapterBase[uartHandle->instance], data, length); make the error.
If there is a straightforward code or a simple method to obtain the current time, it would be greatly appreciated.
Best regards,
Ahmed.