cancel
Showing results for 
Search instead for 
Did you mean: 

Code executing while ROMS1=1

rana
Associate II
Posted on November 26, 2006 at 12:50

Code executing while ROMS1=1

8 REPLIES 8
rana
Associate II
Posted on November 15, 2006 at 10:51

Hello all.

I use ST10F276.

I want to call code temporary unprotection (CTU) from the I-Flash while ROMS1=1.

Can I call a function which sit in the I-Flash (B0F4) when ROMS1=1?

In other words:

Why can't I call a function which sit in the I-Flash (B0F4) when ROMS1=1?

The Debbuger (Tasking v8.5 r2) lose connection when I call (Step over) this function.

Now, In this early step of the developement, this CTU function contains:

void IF_UnProtect(void)

{

// FCR0H |= 0x0100; /* set protection operation */

// FARL = 0xDFB8; /* load FNVAPR0 */

// FARH = 0x000E;

// FDR0L = 0xFFFF; /* DBGP = ACCP = 1 */

// FCR0H |= 0x8000; /* operation start */

_nop();

_nop();

}

This Function sits at 0x0180066...

Please help

Ran

najoua
Associate II
Posted on November 15, 2006 at 11:18

Hello Ran,

The ROMS1 bit allows remapping blocks B0F0, B0F1, B0F2, B0F3 from segment 0 to segment 1 when it is set (before EINIT).

So, it has no effect and there is no problem when calling a function in the I-Flash (B0F4).

Normally, the behavior you are describing should be observed even when ROMS1 = 0 as the behavior is ROMS1 bit independant.

You are using Cross View Debugger to debug your application. So, I suppose that your application is executed from an external RAM.

Are you sure that using Cross View debugger, you are able to call and execute a routine allocated in the Flash?

This is to be verified with Tasking Technical Support.

I will contact them and keep you informed accordingly.

Regards,

Najoua.

rana
Associate II
Posted on November 15, 2006 at 11:42

Thank you.

I tried to set a breakpoint after this function call and run freely to that breakpoint,

The CrossView lost connection...

The Sub-System sequence:

Compile ''Hex'' file with Func-A, which put the Func-A pointer in NVRAM.

Load and Run it.

(Running)

Compile Debug file with Func-B, which read the pointer from NVRAM, and call that pointer.

Load, put a breakpoint after Func-B and RUN.

(The pointer exist with right value. Run. The Debugger lose connection)

Thanks

- Ran

najoua
Associate II
Posted on November 16, 2006 at 06:27

Hello Ran,

When you use a monitor, a routine from flash cannot be debugged. However, it should be possible to run through a routine in Flash and break afterwards somewhere in RAM memory.

The debug connection loss problem had been reported to Tasking Technical support.

Regards,

Najoua.

rana
Associate II
Posted on November 16, 2006 at 08:18

Thanks, Najua.

Can I have Access protection just for [B0F0 -> B0F3]?

This would be very helpfull...

Anyone who knows may answer...

Ran

najoua
Associate II
Posted on November 16, 2006 at 09:10

Below is Tasking support answer:

----------------------------------------------------------------

When a breakpoint is set, CrossView first determines how many instructions are between the current program counter and the new breakpoint. If this amount is below a certain level, CrossView may decide to single step towards the breakpoint instead of a free run. Because single stepping through ROM is not possible, the connection will be lost.

So running through a routine in flash using a monitor is not a good idea after all...

-------------------------------------

Regarding the access protection just for [B0F0 -> B0F3], unfortunately, it is not psossible because Access Protection is applied to the whole IFLASH and can not applied by block.

Sorry for the inconvenience,

Regards,

Najoua.

rana
Associate II
Posted on November 16, 2006 at 09:47

Najua,

Thank you anyway...

Ran

rana
Associate II
Posted on November 26, 2006 at 12:50

As I understood, I've put the calling behind lots of code, but still I have TFR=8 (protection fault).

The problem is: My function contains NOPs only. No protected instructions at all...

Can I send my Project to anyone for to have a look?