cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to Launch User Program from Interrupt Enabled IAP

daryl2
Associate II
Posted on April 23, 2007 at 08:10

Unable to Launch User Program from Interrupt Enabled IAP

8 REPLIES 8
daryl2
Associate II
Posted on April 18, 2007 at 08:48

To all gurus,

This can be seen here:

http://mcu.st.com/mcu/modules.php?mop=modload&name=Splatt_Forums&file=viewtopic&topic=5220&forum=17

Basically, I am using ST7 IAP for my firmware upgrading. I have modified the IAP to work with interrupt handled UART. The problem i am facing now is that I am not able to launch my user program now. I notive that the cause is by the enhanced interrupt controller init (EIC_INIT) in 75x_init.s. If I remove EIC_INIT, i am able to launch my user program successfully but now my interrupt ISR will not work. Is there a way to resolve this? Thanks

#ifdef EIC_INIT

LDR r3, =EIC_Base_addr

LDR r4, =0x00000000

STR r4, [r3, #ICR_off_addr] ; Disable FIQ and IRQ

STR r4, [r3, #IER_off_addr] ; Disable all interrupts channels

LDR r4, =0xFFFFFFFF

STR r4, [r3, #IPR_off_addr] ; Clear all IRQ pending bits

LDR r4, =0x18

STR r4, [r3, #FIR_off_addr] ; Disable FIQ channels and clear FIQ pending bits

LDR r4, =0x00000000

STR r4, [r3, #CIPR_off_addr] ; Reset the current priority register

LDR r4, =0xE59F0000 ; Write the LDR pc,pc,#offset..

STR r4, [r3, #IVR_off_addr] ; ..instruction code in IVR[31:16]

LDR r2,= 32 ; 32 Channel to initialize

LDR r0, =WAKUP_Addr ; Read the address of the IRQs address table

LDR r1, =0x00000FFF

AND r0,r0,r1

LDR r5,=SIR0_off_addr ; Read SIR0 address

SUB r4,r0,#8 ; subtract 8 for prefetch

LDR r1, =0xF7E8 ; add the offset to the 0x00 address..

; ..(IVR address + 7E8 = 0x00)

; 0xF7E8 used to complete the LDR pc,offset opcode

ADD r1,r4,r1 ; compute the jump offset

EIC_INI

MOV r4, r1, LSL #16 ; Left shift the result

STR r4, [r3, r5] ; Store the result in SIRx register

ADD r1, r1, #4 ; Next IRQ address

ADD r5, r5, #4 ; Next SIR

SUBS r2, r2, #1 ; Decrement the number of SIR registers to initialize

BNE EIC_INI ; If more then continue

#endif

najoua
Associate II
Posted on April 18, 2007 at 14:31

Hello tiger4,

If I fully understood the situation, you had updated the IAP driver provided by ST by using UART interrupts instead of UART in polling mode. Could you please confirm?

If this is the case, I have some questions:

- Did you succeed to download your user program using your own IAP driver? Is your problem the execution of the user program after being downloaded?

- I didn't understand your statement: ''If I remove EIC_INIT, i am able to launch my user program successfully but now my interrupt ISR will not work''.

About which interrupt you are speaking? Do you speak about the UART interrupts? If yes, so how did you download the user program?

Could you please clarify?

- Could you please tell me if your user program contains interrupts or no?

Sorry for the misunderstanding.

I am waiting for your feedback,

Best regards,

Najoua.

daryl2
Associate II
Posted on April 19, 2007 at 00:16

Hi Najouna

I am using IAR as my development platform. I download the IAP and user program onto the MCU using IAR with JTAG. My user program is a uC/OS II RTOS and contains interrupts.

Using the IAP given by ST, I am able to download the user program with this IAP using UART in polling mode and launch the user program successfully. The IAP can also launch user program download by

IAR.

Using my IAP where the UART is interrupt controlled, I am not able to launch the same user program download by IAR. I found out after removing the EIC_INIT section in 75x_init.s, I am able to launch the user program. But for UART interrupt to work, we need the the EIC_INIT section to init the Enhanced Interrupt Controller (EIC). So my question is how the IAP can enable the UART interrupts and launch user program?

I am based in Singapore and I will be up tonight. Please drop me a email at

mailto:tiger3687@hotmail.com

when you sign in and we can discuss more on this. I have attached a copy of my 75x_init.s here. Thank you.

[ This message was edited by: tiger4 on 19-04-2007 06:14 ]

________________

Attachments :

75x_init.s : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtSV&d=%2Fa%2F0X0000000aQG%2FNoE4LUtwPh3ZCicdhoF1hGcJttvR4jq9DwR_c8wr6Pk&asPdf=false
daryl2
Associate II
najoua
Associate II
Posted on April 19, 2007 at 06:05

Hi Tiger,

Could you please attach also the startup files of your user program?

Thank you,

Najoua.

[ This message was edited by: Najoua on 19-04-2007 12:48 ]

daryl2
Associate II
daryl2
Associate II
Posted on April 20, 2007 at 02:13

Hi Zouh,

Sorry I was away last night.

Yes. The files I copied here are for the IAP with UART interrupt reduced to less than 8K version. I am still unable to launch my user program due to the EIC init codes.

daryl2
Associate II
Posted on April 23, 2007 at 08:10

Hi all,

I just found out that the user program did launch, it just that it hangs after a while. If I disable the EIC Init codes, the user program will not hang. This is normal execution of user program with IAP. No flashing is done by IAP. Both IAP and user program are flashed in using IAR.

It seems like both IAP and user program cannot use interrupts at the same time. Is this a must or there is a fix for this?

[ This message was edited by: tiger4 on 23-04-2007 11:41 ]