I am using ATMEL Studio 7 with Arduino Due board and freeRTOS 7.3 and FreeROTS - UART Interface Layer (service) .
I am expecting it to be simple to use but unfortunately, it didn’t work and I cannot find any sample from Internet. I believe this is not official FreeRTOS library. It is Microchip library build on top of freeRTOS.
Since there is no sample I can get, Following is my best guess
uint8_t buffer[80];
const sam_uart_opt_t p_uart_opt = {
.ul_mck = sysclk_get_main_hz(),
.ul_baudrate = 115200,
.ul_mode = UART_MR_PAR_NO
};
const freertos_peripheral_options_t p_rtos_peri_opt = {
.receive_buffer = buffer,
.receive_buffer_size = 80,
.interrupt_priority = configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY + 1,
.operation_mode = UART_RS232,
.options_flags = USE_RX_ACCESS_MUTEX | WAIT_RX_COMPLETE
};
freertos_uart_if fif = freertos_uart_serial_init(UART, &p_uart_opt, &p_rtos_peri_opt);
uint8_t data[1];
uint32_t x = freertos_uart_serial_read_packet(fif, data , 1, (portTickType) 1000);
What else I need to do to make this work?
Thanks
Joseph