Hi everyone,
I am experiencing an strange problem:
I am using a external SPI component module that I need to initialize by feeding him with a set of 4 "large" arrays of data (one of them is a little larger than 1kbyte, the 3 others are 100 bytes or less).
the way that initialization routine is written is that it writes the arrays mentionned above, and then goes on with the init process by reading data from the SPI slave chip, polling it etc.
I am able to write that data int the arrays to the SPI slave chip, but my initialization routine will crash within the operations (a while loop with SPI polling in it until it receives certain data) that come after. if I replace that SPI polling loop by, let's say, a led blinking loop, it leads to the same result. I am able to see it because if I do some debug printfs on the serial port in the polling loop, I can clearly see it stop. Same goes for the blinking led test, it will only flash once, then crash.
If I remove the function that writes the largest array on the SPI bus AND the array itself, then it works... but my chip is not initialized, of course!
My arrays are declared as const uint8* const array = {/*content of the array*/}; and should be stored in ROM, right?
Since it appears to be some memory size problem (the init routine is pretty heavy overall), I thought about stack overflow but I am not using the mBed OS feature. I don't have the "blue lights of death" thing either.
I am out of ideas... :|
Any help or pointers to solve this would be really appreciated!
Thanks a lot!
Hi everyone,
I am experiencing an strange problem: I am using a external SPI component module that I need to initialize by feeding him with a set of 4 "large" arrays of data (one of them is a little larger than 1kbyte, the 3 others are 100 bytes or less).
the way that initialization routine is written is that it writes the arrays mentionned above, and then goes on with the init process by reading data from the SPI slave chip, polling it etc.
I am able to write that data int the arrays to the SPI slave chip, but my initialization routine will crash within the operations (a while loop with SPI polling in it until it receives certain data) that come after. if I replace that SPI polling loop by, let's say, a led blinking loop, it leads to the same result. I am able to see it because if I do some debug printfs on the serial port in the polling loop, I can clearly see it stop. Same goes for the blinking led test, it will only flash once, then crash.
If I remove the function that writes the largest array on the SPI bus AND the array itself, then it works... but my chip is not initialized, of course!
My arrays are declared as const uint8* const array = {/*content of the array*/}; and should be stored in ROM, right?
Since it appears to be some memory size problem (the init routine is pretty heavy overall), I thought about stack overflow but I am not using the mBed OS feature. I don't have the "blue lights of death" thing either.
I am out of ideas... :|
Any help or pointers to solve this would be really appreciated!
Thanks a lot!