cancel
Showing results for 
Search instead for 
Did you mean: 

ST10F276 - Code not running from internal flash

venu
Associate II
Posted on June 09, 2006 at 12:41

ST10F276 - Code not running from internal flash

6 REPLIES 6
venu
Associate II
Posted on June 08, 2006 at 14:42

Hello,

I am using FsForth Start27x Eval. board with Tasking compiler.

I have tested my program using the extrenal RAM and now I want to try it out with internal flash of ST10F276.

The flash programming is successful with ST10Flasher(2.4B) but the code seems to be not running from internal flash.

The eval. board is configured to run the code from internal flash.

I doubts some settings problem,

I use following settings,

SYSCON = 0x04D4.

XPERCON = 0x060D.

XADRS3 = 0xF008.

ROM range = 0x0 - 0x007FFF + 0x018000 - 0x04FFFF.

RAM range = 0xE000 - 0xE7FF + 0x0F0000 - 0x0FFFFF.

Memory model = small, DPP0=0, DPP1=1 and DPP2=60.

The program Size = 146143 bytes.

Programming time = 39 s with 38400baud.

Block(s): 0, 1, 2, 3, 4, 5, 6

Do I need to initialize any other registers?

Could please help me on this?

Thanks and Best Regards,

Venu

venu
Associate II
Posted on June 08, 2006 at 15:31

Hello Neila,

I am able to program the internal flash without any trouble.

The problem is that the code is not running from internal flash, same code running from the external RAM of eval. board.

I tried with XFLASHEN bit set, but still the code is not running.

Best Regards,

Venu

venu
Associate II
Posted on June 09, 2006 at 06:38

Hello Neila,

I checked the start.asm, Tasking generated one is correct only.

Here is the code,

DISWDT ; Disable watchdog timer

EXTR #1

MOV XPERCON, #0x062D

BFLDL SYSCON, #LOW (0xFFFF&~0), #LOW (0x04D4&~0)

BFLDH SYSCON, #HIGH (0xFFFF&~0), #HIGH (0x04D4&~0)

EXTR #1

MOV XADRS3, #0xF008

@IF( ( 0x062D & 0x07D3 ) * ( 0x04D4 & 0x0004 ) )

@_MOVE ( XPEREMU, #0x062D, R0 ) ; initialize XPEREMU

@ENDI

ATOMIC #3

MOV SP, #?SYSSTACK_TOP ; Set stack pointer.

MOV STKOV, #?SYSSTACK_BOTTOM + 6*2 ; Set stack ovf pointer.

MOV STKUN, #?SYSSTACK_TOP ; Set stack underflow pointer.

MOV CP, #CSTART_RBANK ; Set context pointer.

NOP

MOV DPP0, #PAG ?BASE_DPP0 ; Set data page pointer.

MOV DPP1, #PAG ?BASE_DPP1 ; Initialise these before we can make a

MOV DPP2, #PAG ?BASE_DPP2 ; user stack call below

; Set user stack pointer

; To avoid problems when the userstack is located at the end of a page, the

; initial value is set using base + size.

MOV R0, #?USRSTACK_BOTTOM + (?USRSTACK_TOP - ?USRSTACK_BOTTOM)

EINIT ; End of initialization

Is the initialisation of XADRS3 is correct?

Best Regards,

Venu

venu
Associate II
Posted on June 09, 2006 at 08:23

Hello Neila,

1. The BSL0 is OFF and J11 is pulgged to enable internal memory.

2. EINIT LED is ON

3. SYSCON = 0x0184 and XPERCON = 0x042D.

Best Regards,

Venu

venu
Associate II
Posted on June 09, 2006 at 11:43

Hello Neila,

Great!. It starts running from internal flash.

The problem is J7 and J8, when removed its start running.

I had tested the I2C in another eval. board where the J7 and J8 were removed.

In SYSCON, I am only disabling the watch dog and enabling the ROMEN. (0x0494)

But still problem exists, the CAN seems to be not working, I am debugging that.

Thanks for your great support.

Best Regards,

Venu

venu
Associate II
Posted on June 09, 2006 at 12:41

Hello Neila,

Yes. I am using CAN1.

The CAN is working, but when I switch ON the connected ECU I am getting some problem in my module.

Thanks and Best Regards,

Venu