2005-11-10 07:54 PM
JMPA JMPR after erasing block0 in ST10F269
2005-11-09 07:23 PM
Hi All,
We are developing a bootstrap loader. At this moment we have 2 seperated programs tested: BlockErase(nr) and Monitor() who work seperated very well. Monitor() receives data via ASC0. Now I have implemented BlockErase in Monitor() but after I erased block0 the monitor wont work anymore. Other blocks are no problem and so we excluded the possibility of stackproblems The monitor is a infinite while(TRUE) loop with several code inside. At the end of the loop a unconditional JMPA instruction is processed for returning to te begin of the loop and it seems that this instruction is not processed well. I have changed the jump with a JMPS instruction and that won't work either. After I removed some code in the loop, the compiler (Tasking) uses a JMPR instruction for jumping back and now the jump back works and the monitor stays waiting for receiving data note that the code is not that huge that the CSP has to change. Has anyone an idea what is going on here? Why can't you use JMPS or JMPA instruction with an erased block 0? thx Marco2005-11-10 06:22 PM
Hi Neila
The monitor() and blockerase() code is mapped to external RAM. (0x60000-0x6FFFF). The ROMS1 bit =0 .. We do not map to segment1. We do something like this: Monitor() { BlockErase(0); while(TRUE) { switch(MonitorState){ case _REC:.... break; case _HDL:.... break; } // <-- triggerpoint } } I know that block0 is errased and we reach the trigger point. But after the JMP back to begin of while loop we loose connection. The processor is ST10F269Z2Q6 Note: if i change BLockErase for other blocks then it is workin well. The problems only appear if I erase block0. Marco2005-11-10 07:54 PM
Hello Neila,
I just solved the problem. I was hunting a ghost with the JMPA instruction. It was just a unfortunate coincidence that the JMPR instruction did work. The problem is in the incorrect processing of the switch statement. It used a jumptabel located in block 0. The compiler do not map this table also in RAM :-Y .. Thx for thinking with me Marco (maybe you can delete this message because the problem is irrelevant for this forum)