Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

PSoC™ 6 Forum Discussions

Ramya1811
Level 1
Level 1
First question asked Welcome!

Hi all,

    I am using the PSoC 6 cy8ckit-064b0s2-4343w . I attempted to construct a UART interrupt in Modustoolbox using SCB blocks without FreeRTOS, and the hardware interrupt happened at that time. However, when I implemented it again with FreeRTOS, I did not encounter a hardware interrupt since FreeRTOS does not call the interrupt function while transmitting.

0 Likes
2 Replies
Bhamy
Moderator
Moderator
Moderator
25 replies posted First like given 5 solutions authored

Hi @Ramya1811 ,

Can you please share the UART related configuration with FreeRTOS project and which function do you call for transmitting data?

Best regards,

Bhamy Narasimha Shenoy

0 Likes
Bhamy
Moderator
Moderator
Moderator
25 replies posted First like given 5 solutions authored

Hi @Ramya1811 ,

You may try to add following code to enable the interrupt.

void uart_event_handler(void *handler_arg, cyhal_uart_event_t event)
{
    (void)handler_arg;
    if ((event & CYHAL_UART_IRQ_TX_DONE) == CYHAL_UART_IRQ_TX_DONE)
    {
    }
}

/* Register UART event handler */
cyhal_uart_register_callback(&uart_obj, uart_event_handler, NULL);

/* Enable required UART events */
cyhal_uart_enable_event(&uart_obj, (cyhal_uart_event_t)(CYHAL_UART_IRQ_TX_DONE), length, true); //Data transfer length

 

Kindly let me know if you need some further details.

Best regards,

Bhamy Narasimha Shenoy

0 Likes