cancel
Showing results for 
Search instead for 
Did you mean: 

STR751 IAP using UART: Interrupt problem

shai2
Associate II
Posted on March 14, 2007 at 11:02

STR751 IAP using UART: Interrupt problem

10 REPLIES 10
shai2
Associate II
Posted on March 08, 2007 at 09:20

Hi,

I work with STR751 device and IAR Embedded Workbanch.

I downloaded the ''STR7 In-Application programming using UART'' application and programmed the device via JTAG.

In my code I changed the start address of the ROM in lnkarm_flash.xcl to 0x20002000.

// Code memory in flash

-DROMSTART=0x20002000

-DROMEND=0x2000FFFF //0x2001FFFF;0x203FFFF

I changed the output format to raw-binary, rebuild the project and upload my code (*.bin) via Hyper-Terminal.

After reset my code run but interrupts weren't serving.

I tried to copy the INTVEC to RAM and remap the RAM before branch to main in 75x_init.s

///////////////////////////////////////////////////////////////////

#define Remap_SRAM ; remap SRAM at address 0x00

.

.

.

;---------------------------------------------------------------

; ?program_start

;---------------------------------------------------------------

MODULE ?program_start

COMMON INTVEC:CODE(2)

RSEG IRQ_STACK:DATA(2)

RSEG FIQ_STACK:DATA(2)

RSEG UND_STACK:DATA(2)

RSEG ABT_STACK:DATA(2)

RSEG SVC_STACK:DATA(2)

RSEG CSTACK:DATA(2)

RSEG ICODE:CODE(2)

PUBLIC __program_start

EXTERN ?main

CODE32

.

.

.

LDR r3,=SFE(INTVEC)-SFB(INTVEC)

LDR r0,=0x20002000

LDR r1,=0x40000000

loop LDR r2,[r0]

STR r2,[r1]

ADD r0,r0,#4

ADD r1,r1,#4

SUBS r3,r3,#4

BNE loop

; --- Branch to C Library entry point

B ?main ; use B not BL, because an application will never return this way

///////////////////////////////////////////////////////////////////

But it didn't work.

1. Do i need to integrate the two projects (STR75x_IAP and my project) to one projet?

2. what changes i need to do in my project?

Thanks in advance.

najoua
Associate II
Posted on March 08, 2007 at 10:02

Hello SK,

1. Do i need to integrate the two projects (STR75x_IAP and my project) to one projet?

No, you don't need to integrate the IAP and your application.

2. what changes i need to do in my project?

Please refer to the following interesting discussion forum link:

http://www.stmcu.com/forums-cat-5041-17.html

Note: This discussion forum is STR71x related but the principle is the same for the STR75x.

I hope this helps,

Regards,

Najoua.

[ This message was edited by: Najoua on 08-03-2007 14:44 ]

najoua
Associate II
Posted on March 08, 2007 at 11:13

Hello again SK,

You will find enclosed a compiled example library (EIC example) where all needed modifications are set.

(Project path: um0218\STR75xStdLib\StdLib\project\EWARM)

- In 75x_init.s:

* The RAM is remapped at address 0x00

* a loop copying interrupt vector from 0x20002000 address to address 0x40000000 is executed just before jumping to the main program.

- In the linker file 'lnkarm_flash', we should have the following settings:

// Code memory in flash

-DROMSTART=0x20002000

-DROMEND=0x2003FFFF

// Data memory

-DRAMSTART=0x40000800

-DRAMEND=0x40003FFF

- Under Project Options-->Debugger-->download-->EDIT part: Relocate base address at 0x20002000.

I hope this helps you,

Best regards,

Najoua.

[ This message was edited by: Najoua on 08-03-2007 16:33 ]

________________

Attachments :

um0218.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I1FU&d=%2Fa%2F0X0000000bm7%2FrqbTzVQEDq_w18X_95mYH8rTgR3jJZbOfrjLdx3XBAE&asPdf=false
shai2
Associate II
Posted on March 09, 2007 at 05:55

Hi, Najoua.

Thanks for your quick replay.

I implemented the changes that you offer and compare my files to um0218 project files (75x_init.s, lnkarm_flash) and it's look the same.

But unfortunately it didn't help and the interrupts weren't serving.

I attached my files.

Please let me know if you have another idea.

Thanks in advance.

________________

Attachments :

my_files.ZIP : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtRD&d=%2Fa%2F0X0000000aQ1%2FVaUoyRfwzxcEYiaCqpTe5DBn.Pd0AEhtwUFGCDCtKzQ&asPdf=false
najoua
Associate II
Posted on March 09, 2007 at 06:20

Hello SK,

There is no problem in the attached files (the modifications are set correctly).

Normally, these applied modifications are sufficient to make your program run and to have the interrupts serviced correctly.

Now, to investigate more the problem, could you please:

- tell me if you tried to load and to run your application using a toolset and if it is executed successfully?

- give me a compiled project showing the problem?

Waiting for your feedback,

Regards,

Najoua.

ann_lee
Associate II
Posted on March 12, 2007 at 06:32

Hi Najoua

I had same problem and my program work well using your method.

Could you explain why? And which address of ''DRAMSTART''(on your example =0x40000800) I should set? How to calculate? Thx.

An

najoua
Associate II
Posted on March 12, 2007 at 07:43

Hello An,

The interrupt vector is copied at RAM base address 0x40000000, so to avoid the user application corrupts it, the DRAMSTART should be set to a a value different from the RAM base address such as 0x40000800 which was just an arbitrary value (the DRAMSTART should be equal to or greater than 0x40000000 + the interrupt vector size).

Regards,

Najoua.

[ This message was edited by: Najoua on 12-03-2007 12:15 ]

[ This message was edited by: Najoua on 12-03-2007 14:29 ]

ann_lee
Associate II
Posted on March 12, 2007 at 23:50

Hi

Thx.

I understand.

But when I port the code to my startup program, my program crash.

I don't know what's happened.

An

________________

Attachments :

str750_cstartup.s79 : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtRI&d=%2Fa%2F0X0000000aQ2%2FhU2k4lOA5fxCnAQxCKE4MxW9HOQ22TIXpVjQMq7HcxQ&asPdf=false
ann_lee
Associate II
Posted on March 13, 2007 at 06:00

Hi

Thanks! My program is ok using 75x_init.s and 75x_vest.s to startup.

However when I change to another project using str750_cstartup.s79 (I posted last message) can't interrupt anymore.

An