cancel
Showing results for 
Search instead for 
Did you mean: 

JMPA JMPR after erasing block0 in ST10F269

mvan.os9
Associate II
Posted on November 11, 2005 at 04:54

JMPA JMPR after erasing block0 in ST10F269

3 REPLIES 3
mvan.os9
Associate II
Posted on November 10, 2005 at 04:23

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 Marco

mvan.os9
Associate II
Posted on November 11, 2005 at 03:22

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.

Marco

mvan.os9
Associate II
Posted on November 11, 2005 at 04:54

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)