Hello,
I am in a situation where I have to initialize a lookup table that is large enough that under normal conditions, the watchdog timer expires before the table can finish loading. As a result, I have implemented a low level init, which will run before variables are initialized. In the low level init, I stop the watchdog timer, so that when the program loads, the watchdog timer is stopped before initializing the large table values.
Occasionally I run into a problem with variable initialization.
For example, if I were to type something like:
volatile static unsigned int temp = 164;
I am running the system with IAR Embedded Workbench. Sometimes, by the time IAR gets into the main routine, it shows that temp = 28. This does not happen all the time, but it causes problems when it does. I suppose that there is a flaw with my approach in using the low level init and should perhaps use some other method. Any suggestions?
Thanks in advance.
Sincerely,
Mehdi