Forum Discussion

Andrew099's avatar
Andrew099
Icon for New Contributor rankNew Contributor
2 years ago
Solved

BSP fails to build for FreeRTOS on a Nios V with UART

I have a Nios V on a Max 10 with a UART (RS-232 Serial Port) Intel FPGA IP (and also JTAG UART). When I opened up the BSP editor, I selected FreeRTOS and went with all the defaults and made a BSP. However, when I try building a bare bones hello world C program, the BSP fails to build. It says that the BSP source file altera_avalon_uart_init.c has OS_FLAG_SET as undeclared, and similarly, it says the BSP file altera_avalon_uart_read.c has OS_FLAG_WAIT_SET_ANY undeclared. Also, altera_avalon_uart_write.c has OS_FLAG_CONSUME undeclared. How do I get the BSP to build?

I can use UART with HAL rather than FreeRTOS, and it works fine for the Nios V.

(I am using Quartus 23.1 STD.)

  • In the "freertos/drivers/src/":


    • intel_lw_uart_init.c
      • line 228~:

    if (sp->tx_start == ((sp->tx_end + 1) & ALT_AVALON_UART_BUF_MSK))

    {

    ALT_FLAG_POST (sp->events,

    ALT_UART_WRITE_RDY,

    ALT_FLAG_SET);

    }


    • intel_lw_uart_read.c
      • line 205~:

    ALT_FLAG_PEND (sp->events,

    ALT_UART_READ_RDY,

    ALT_FLAG_WAIT_SET_ANY_WITH_CONSUME,

    ALT_FLAG_WAIT_MAX_TIMEOUT);


    • intel_lw_uart_write.c
      • line 192~:

    ALT_FLAG_PEND (sp->events,

    ALT_UART_WRITE_RDY,

    ALT_FLAG_WAIT_SET_ANY_WITH_CONSUME,

    ALT_FLAG_WAIT_MAX_TIMEOUT);



22 Replies