Combinable task with port select causes ET_ILLEGAL_PC

Technical questions regarding the XTC tools and programming with XMOS.
Post Reply
MyKeys
Active Member
Posts: 33
Joined: Mon Jul 03, 2017 9:41 am

Combinable task with port select causes ET_ILLEGAL_PC

Post by MyKeys »

Why does the below code cause an ET_ILLEGAL_PC?

Note switching the tasks around with timer_task first or removing the [combine] stops the exception.
Am I missing something obvious?

Code: Select all


#include <platform.h>

on tile[0] : in port p_enc = XS1_PORT_4C;

[[combinable]]
void timer_task ()
{
    timer tmr_test;
    unsigned testValue;

    tmr_test :> testValue;

    while (1)
    {
        select
        {
            case tmr_test when timerafter (testValue) :> void:
                testValue += 100000000;
                break;
        }
    }
}

[[combinable]]
void port_task ()
{
    unsigned port_state;

    while(1)
    {
        select
        {
        case p_enc when pinsneq(port_state) :> port_state:
            break;
        }
    }
}

int main ( )
{
    par
    {
        on tile[0]:
        {
            [[combine]]
            par
            {
                port_task ();
                timer_task ();
            }
        }
    }

    return 0;
}


jakeh
Posts: 5
Joined: Fri Jul 28, 2017 9:55 am

Post by jakeh »

Hi MyKeys,

I'm not able to reproduce this exception on my machine with the given code.
What version of the tools (xTimeComposer) are you using?

Regards,
Jake
MyKeys
Active Member
Posts: 33
Joined: Mon Jul 03, 2017 9:41 am

Post by MyKeys »

Hi Jake,

I was using v14.3.0 tools. Trying v14.3.2 seems to resolve the issue.
I don't see anything in the release notes between these versions that could explain this.

Thanks,
Mike
Post Reply