Add UART support to an exinting project

Hi,

I am trying to include UART support for an existing example (standy_power_mode). I got the uart.h and uart.c from other project (peripheral_server_uart).

I tried including the file, calling UART_Initializae and then, call UART_FillTXBuffer right before the call to Main_Application(). It crashes inside the UART_Initialize function. It gives a hard fault error…

I checked the differences between the clock initialization between one project and another and I see minor differences related to BLE (Which I still do not use).

I also see that this line is different:
peripheral_server_uart:
Sys_Clocks_SystemClkConfig(JTCK_PRESCALE_1 |
EXTCLK_PRESCALE_1 |
SYSCLK_CLKSRC_RFCLK);

standby_power_mode:
CLK_SYS_CFG->SYSCLK_SRC_SEL_BYTE = SYSCLK_CLKSRC_RFCLK_BYTE;

I tried using the first one inside my example but I get a hard fault error.

I tried adding sprintf function too in order to fill the buffer. It seems it also produces a hard fault error.

Could you tell me what should I do to include the uart? I am pretty sure there is something I am doing wrong but I cannot see it.

standby_power_mode.zip (40.4 KB)

@BLEDev

Please modify your example as:

Sys_Clocks_SystemClkConfig(JTCK_PRESCALE_1 |
EXTCLK_PRESCALE_1 |
SYSCLK_CLKSRC_RFCLK);

//  CLK_SYS_CFG->SYSCLK_SRC_SEL_BYTE = SYSCLK_CLKSRC_RFCLK_BYTE;

Thank you for using our community forum!