# FreeROTS - UART Interface Layer (service) Not work

**URL:** <https://forums.freertos.org/t/freerots-uart-interface-layer-service-not-work/9834>\
**Category:** Microchip\
**Created:** [May 21, 2020, 10:29pm UTC](https://forums.freertos.org/t/freerots-uart-interface-layer-service-not-work/9834 "2020-05-21T22:29:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjdd88](https://avatars.discourse-cdn.com/v4/letter/j/f04885/32.png) [@jjdd88](https://forums.freertos.org/u/jjdd88)\
**Post date:** [May 21, 2020, 10:29pm UTC](https://forums.freertos.org/t/freerots-uart-interface-layer-service-not-work/9834/1 "2020-05-21T22:29:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Shridhar](https://avatars.discourse-cdn.com/v4/letter/s/858c86/32.png) [@Shridhar](https://forums.freertos.org/u/Shridhar)\
**Post date:** [May 21, 2020, 10:41pm UTC](https://forums.freertos.org/t/freerots-uart-interface-layer-service-not-work/9834/2 "2020-05-21T22:41:18Z")

</div>

@ [support@microchip.com](mailto:support@microchip.com) can you please reply

---

<div class="post-metadata">

**Author:** ![Shridhar](https://avatars.discourse-cdn.com/v4/letter/s/858c86/32.png) [@Shridhar](https://forums.freertos.org/u/Shridhar)\
**Post date:** [May 21, 2020, 10:42pm UTC](https://forums.freertos.org/t/freerots-uart-interface-layer-service-not-work/9834/3 "2020-05-21T22:42:35Z")

</div>

Have you also tried updating to latest version of FreeRTOS and running your application?

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [May 22, 2020, 12:29am UTC](https://forums.freertos.org/t/freerots-uart-interface-layer-service-not-work/9834/4 "2020-05-22T00:29:56Z")

</div>

I think the freertos\_uart\_serial\_nnn function give mutexes from interrupt service routines, which can’t be done in recent versions of FreeRTOS, so if updating the RTOS version you would have to change the xSemaphoreCreateMutex() calls (in the driver) to xSemaphoreCreateBinary() instead.

---

<div class="post-metadata">

**Author:** ![jjdd88](https://avatars.discourse-cdn.com/v4/letter/j/f04885/32.png) [@jjdd88](https://forums.freertos.org/u/jjdd88)\
**Post date:** [June 12, 2020, 5:05pm UTC](https://forums.freertos.org/t/freerots-uart-interface-layer-service-not-work/9834/5 "2020-06-12T17:05:08Z")

</div>

Thanks for the reply. I think this is correct. The Atmel ASF come with two version of freeRTOS 7.3 and 10.0. 7.3 work but not 10.0. I just end up with use v7.3 for now.
