Page 1 of 1

Program received signal ET_LOAD_STORE, Memory access excepti

Posted: Thu Jun 16, 2016 3:37 pm
by jzw
I have reduced a programme to the minimum and get the error

xrun: Program received signal ET_LOAD_STORE, Memory access exception.
0x0004035c in lib_dsp_filters_fir ()

The programme is

#include <lib_dsp.h>

void TestFIR()
{
int32_t sample = Q28(0);
int32_t filter_coeff[5] = { Q28(0.5),Q28(-0.5),Q28(0.0),Q28(-0.5),Q28(0.5) };
int32_t filter_state[4] = { 0, 0, 0, 0 };
int32_t result = lib_dsp_filters_fir( sample, filter_coeff, filter_state, 5, 28 );
}

int main()
{
TestFIR();
return 0;
}

This is running on a XUF216-512-FB236 part.

Please help me to resolve this,


It appears to be cured by forcing the two arrays to be on 64bit boundaries. If this is the case is there a Pragma or similar to enforce this?

Re: Program received signal ET_LOAD_STORE, Memory access exc

Posted: Fri Jun 17, 2016 8:36 am
by andrew
If you place the array into global space then it will be 64 bit aligned. There is currently no pragma for doing this although there may be one day.

Re: Program received signal ET_LOAD_STORE, Memory access exc

Posted: Fri Jun 17, 2016 8:59 am
by peter
You could always make it an array of 64-bit items which can then be pointed to. This will then be 64-bit aligned.

int64_t filter_coeff_64[3];
int32_t *filter_coeff = (int32_t*)&filter_coeff_64[0];

Re: Program received signal ET_LOAD_STORE, Memory access excepti

Posted: Sun Jun 04, 2017 5:55 pm
by CousinItt
I just had the same problem. I have two tasks running biquad filters on four I2S data streams. I'd like to keep the filter state private to each task, but then it fails with this exception. It looks like I might have to make the filter state arrays global and pass a reference to each task, but I'll give Peter's workaround a go first.

+1 for that pragma.

Re: Program received signal ET_LOAD_STORE, Memory access exc

Posted: Tue Jan 08, 2019 11:19 am
by feima0011
peter wrote:You could always make it an array of 64-bit items which can then be pointed to. This will then be 64-bit aligned.

The xmos cpu is 32bit. What is the point of making an array of 64-bit?

int64_t filter_coeff_64[3];
int32_t *filter_coeff = (int32_t*)&filter_coeff_64[0];