[SOLVED]FreeRTOS SDK : UART ISR compile error

knifey-spooney
Posts: 4
Joined: Sun Nov 01, 2015 11:51 am

[SOLVED]FreeRTOS SDK : UART ISR compile error

Postby knifey-spooney » Sun Nov 01, 2015 12:26 pm

Hi All,

I am currently using the uart.c file from the FreeRTOS SDK git repository, to play around with the UART.

Unfortunately if I try to compile this file I get the following error :

```
uart.c: In function 'UART_intr_handler_register':
uart.c:270:5: error: too few arguments to function '_xt_isr_attach'
_xt_isr_attach(ETS_UART_INUM, fn);
^
In file included from /home/knifey-spooney/esp_stuff/esp_iot_rtos_sdk//include/freertos/portable.h:318:0,
from /home/knifey-spooney/esp_stuff/esp_iot_rtos_sdk//include/freertos/FreeRTOS.h:87,
from uart.c:8:
/home/knifey-spooney/esp_stuff/esp_iot_rtos_sdk//include/freertos/portmacro.h:185:13: note: declared here
void _xt_isr_attach (uint8 i, _xt_isr func, void *arg);
```

Just wondering if anyone could point me to the documentation on the _xt_isr code, and/or its source code?

Also if I remove this functionality from this file it compiles and works beautifully.

Apologies if this question has been asked before.

Many Thanks,
Andrew.

User avatar
kolban
Posts: 131
Joined: Tue Jun 16, 2015 1:09 pm
Location: Fort Worth, Texas, USA

Re: FreeRTOS SDK : UART ISR compile error

Postby kolban » Mon Nov 09, 2015 2:15 pm

Howdy Andrew,
I see that there is a new release of the RTOS SDK ... maybe have a try with that and see if there are any changes?

knifey-spooney
Posts: 4
Joined: Sun Nov 01, 2015 11:51 am

Re: FreeRTOS SDK : UART ISR compile error

Postby knifey-spooney » Mon Nov 09, 2015 3:44 pm

Hi Kolban,

I just pulled the latest version of the RTOS sdk, and no changes.

I had a look at the header file that contains _xt_isr_attach (link: https://github.com/espressif/ESP8266_RTOS_SDK/blob/master/include/freertos/portmacro.h), and what I noticed is that there is a typedef for _xt_isr in the line above, which sets _xt_isr to be a pointer to a function that returns void and takes a void pointer as an argument.

Seeing this I changed the 'UART_intr_handler_register' function in uart.c to this:

Code: Select all

void ICACHE_FLASH_ATTR
UART_intr_handler_register(void *fn)
{
    _xt_isr func = fn;
    _xt_isr_attach(ETS_UART_INUM, func, fn);
}


With this change in place, the file compiles, but I do not know how well the isr handler actually works; so I'll go and do that now. :)

Any feedback on this change would be greatly appreciated.

Many Thanks,
Andrew.

knifey-spooney
Posts: 4
Joined: Sun Nov 01, 2015 11:51 am

Re: FreeRTOS SDK : UART ISR compile error

Postby knifey-spooney » Mon Nov 09, 2015 7:23 pm

Just found out that there was a pull request to fix this back in September : https://github.com/espressif/ESP8266_RTOS_SDK/pull/27/commits.

This fix works, as does mine.

Many Thanks,

Andrew Collins.

Who is online

Users browsing this forum: No registered users and 139 guests