My project crash at UART_printf. even if I add
UART_stdioInit(BOARD_MCSPI_MASTER_INSTANCE - 1);
UART_printf("sem_take in test_RTOS success!\n");
UART_stdioDeInit();
it still crash. How to solve it? Thanks
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
My project crash at UART_printf. even if I add
UART_stdioInit(BOARD_MCSPI_MASTER_INSTANCE - 1);
UART_printf("sem_take in test_RTOS success!\n");
UART_stdioDeInit();
it still crash. How to solve it? Thanks
Hi Anping,
Do you use AM335x TI PSDK RTOS? If yes, which version?
Do you use AM335x TI board (evmAM335x, skAM335x, bbbAM335x, icev2AM335x) or AM335x custom board?
Anping Chen said:UART_stdioInit(BOARD_MCSPI_MASTER_INSTANCE - 1);
You are using McSPI instance, while in UART_stdioInit(), you should use UART instance. In example: UART_stdioInit(UART_INSTANCE); or UART_stdioInit(uartTestInstance);
Also you need to initialize UART with Board_init() finction using the BOARD_INIT_UART_STDIO option. If your code still does not work, you can also use options BOARD_INIT_PINMUX_CONFIG and BOARD_INIT_MODULE_CLOCK.
I would suggest you to check below demo that is using UART_printf() function.
processor_sdk_rtos_am335x_x/demos/rtos_template_app/am335x/evmAM335x/A8/template_app/rtos/app.h
#define appPrint UART_printf
processor_sdk_rtos_am335x_x/demos/rtos_template_app/am335x/evmAM335x/A8/template_app/rtos/main.c
int main(void)
{
Board_initCfg boardCfg;
boardCfg =
#ifndef SBL_BOOT
/* Enabling Board Pinmux, clock when using without SBL boot
* to act as stand alone application.
*/
BOARD_INIT_PINMUX_CONFIG |
BOARD_INIT_MODULE_CLOCK |
#endif
/* The UART_STDIO initializes the default UART port on the board
* and support stdio like UART_printf which is used by appPrint
*/
BOARD_INIT_UART_STDIO;
/* Initialize Board */
status = Board_init(boardCfg);
if (status != BOARD_SOK) {
appPrint("\n Error: Board_init failed: error %d", status);
}
appPrint("\n Board Init complete");
Regards,
Pavel