LPC1769 Second element of array, in Struct, overwritten

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by joeltong on Sun Mar 16 08:15:59 MST 2014

I am trying to create a state manager, which contains an array of states.

I have tried running my code in standard Linux GCC, and it works.

On the LPC1769, when I have added a new state (at the second element of the array) using a helper function, it works fine.  Upon exit of helper function however, the first element is valid, while the second element gives some other unknown memory location.

This is the array within the struct:

volatile State_t * states[MAX_STATES];

Any idea?