I'm developing on Xcore 200 (XU232) from the reference design USB audio 2.0.
I have 2 parallel threads that are synchronized through a channel, c_sync. The task1 and task2 run until task1 receive a command message from its channel c1. It then sends a message to task2 through c_sync to tell task2 to end. Then task1 returns the command.
Code: Select all
unsigned foo(chanend c1, chanend c2)
command = task1(c1, c_sync);
The issue appears in debug mode. The code breaks before the return command (on doSomeStuff() for example which as nothing to do with the channel) with the following message
Suspended: Signal 'ET_ILLEGAL_RESOURCE' received. Description: Resource exception.
When I looked at the disassembly, the code breaks on :
000426fc: freer (1r) res[r7] *
With some trace in memory and registers reading, I found that the r7 register contains the channel c_aud_sync identifier. So I guess, at the function return, the code try to free this resource (the channel c_aud_sync ) but can't so raise en exception. However, the channel is empty and no other threads call it, so the FREER instruction should be OK.
I searched through documentation but the only information I got is "r is referring to a channel end on which no terminating CT END token has been input and/or output, or which has data pending for input, or which has a thread waiting for input or output." in XS1 documentation. I tried to had control token (XS1_CT_END) to end the communication but it changed nothing, the same exception happened.
Has anybody been in such situation or know something on FREER instruction ?