Can you try declaring your m_CmdTmp as static? This will remove it
from the local registers into a specific memory location. Volatile is
even better. This might give you some clues either if it works or it
does not.
Guille
--- In lpc2000@yahoogroups.com, "fl429" <fl429@...> wrote:
>
> Hi, Folks,
>
> Hopefully, someone can shed some light to this. Thanks.
>
> First, this is not my first app on the LPC2138. I had no trouble
> before, until I use IAP in this one.
>
> The IAP calls seem working OK. No error reported. Flash memory does
> program as expected, as far as I can see.
>
> But, a simle C structure in one of the functions now behaves
wierdly
> SOMETIMES. This is called repeatedly in a loop.
>
> switch(m_CmdTmp) {
> case 1:
> ..... codes here
> m_CmdTmp=2;
> break;
> case 2:
> if(!Started()) {
> Starting(); <<====== Point 1
> // some other stuff ... here
> m_CmdTmp=3;
> }
> break;
> case 3:
> ...
> break;
> }
>
> After some poking around, I found I am at Point 1 while m_CmdTmp
> already equals 3 (m_CmdTmp=3).
> There is no interrupts changing the value of m_CmdTmp behind my
> back ! m_CmdTmp is supposed to progress ONLY in this switch routine.
>
> I tried to change stack sizes to no avail. I reserved 256 bytes
from
> the TOP of SRAM (0x400007e00 and up) from being used by this APP.
> No, I still have this problem.
>
> Any ideas ?
>
> Thanks a lot,
>
> Greg
>Message
Re: IAP and then strange behavior
2006-02-02 by Guillermo Prandi
Attachments
- No local attachments were found for this message.