Code: Select all
xcc1: terminated due to internal unrecoverable error
Code: Select all
#include <platform.h>
#include <xs1.h>
#include "i2c.h"
#define SAMPLEPERIOD 4000
#define ADC 0x34
on tile[0] : port scl = XS1_PORT_1L;
on tile[0] : port sda = XS1_PORT_1K;
[[combinable]]
void test(client interface i2c_master_if i2c){
timer stmr;
unsigned stm;
i2c_regop_res_t res;
uint8_t data[6] = {0xAA,0,0,0,0,0}; // SETUP
int values[3];
unsigned bytes = 0;
res = i2c.write(ADC, data, 1, bytes, 1); // setup ADC
stmr :> stm;
stm += stm + SAMPLEPERIOD;
while(1){
select{
case stmr when timerafter(stm) :> void:
res = i2c.read(ADC,data,6,1); // read 3 * 2 byte ADC values
for (int r = 0; r < 6; r+=2)
values[r>>1] = ((data[r] & 0x0F) << 8) | data[r+1];
stmr :> stm;
stm += stm + SAMPLEPERIOD;
break;
}
}
}
int main(void) {
interface i2c_master_if i2c[1];
[[combine]]
par {
i2c_master(i2c, 1, scl, sda, 400);
test(i2c[0]);
}
return 0;
}
This issue has caused my current project (with an already over running deadline) to come to a halt. Any chance someone at Xmos can take a look at this please.
Code: Select all
$> xcc --version
Community_14.1.2 (build 17961, Dec-04-2015)
Compiler version: 14.1.1
Copyright (C) XMOS Limited 2008-2015. All Rights Reserved.