cancel
Showing results for 
Search instead for 
Did you mean: 

problem with XPERCON

juergen239955
Associate II
Posted on July 11, 2006 at 05:23

problem with XPERCON

8 REPLIES 8
juergen239955
Associate II
Posted on July 06, 2006 at 09:43

Hi,

I have a problem with writing someting into the XPERCON register of the ST10F276. I use Tasking V8.0.

I can write into it whatever I want, when I read it out I always get the value 0005hex (reset value).

With other registers (SYSCON, ...) it works well.

Has someone an idea what I do wrong?

Regards,

Juergen

juergen239955
Associate II
Posted on July 06, 2006 at 11:10

Hello Neila,

I wrote a small program for internal RAM where I set the SYSCON and the XPERCON register and with which I can have a look at these registers.

For this program I modified the start.asm file and now I set the XPERCON first with 0x002C and then the SYSCON register with 0x0414. After this I read the registers and in XPERCON is the value 0x0005 (which is wrong) and in SYSCON is the value 0x00414 (which is ok).

Regards,

Juergen

najoua
Associate II
Posted on July 07, 2006 at 10:25

Hello,

You said that you are modifying XPERCON register in the start up file.

So, to take into account this value, under ''Project Options---> startup'', the ''Generate System startup code and add it to project'' option must be disabled, otherwise the XPERCON register value, already defined in the start up file, will be changed and replaced by the value defined in Project Options---> startup ---> Xpercon'' during application build.

Regards,

Najoua.

juergen239955
Associate II
Posted on July 10, 2006 at 05:20

Hello Najoua,

I have already disabled this option.

I took the generated start.asm file, modified it that the XPERCON register is set before the SYSCON register, disabled the ''Generate System startup code and add it to project'' option and added the modified file to my project.

Regards,

Juergen

juergen239955
Associate II
Posted on July 10, 2006 at 05:29

I forgot someting. 🙂

This is how I modified the file:

MOV SYSCON, #0x0000

EXTR #1

MOV XPERCON, #0x002C

BFLDL SYSCON, #0xFF, #0x0414&0xFF

BFLDH SYSCON, #0xFF, #(0x0414>>8)&0xFF

najoua
Associate II
Posted on July 10, 2006 at 07:24

Hello juergen1769,

This is a normal behavior:

In fact, EDE generates a *.cfg file for the debugger. This *.cfg file also defines some register initializations with the values AS defined in the register settings. The debugger uses these values to get the debug monitor up and running. So to get the debugger going with a custom startup code, you will indeed need to set some register values under the startup code SETTINGS.

If you are not using the debugger (if you are executing your application from the internal flash), the XPERCON register value modified in the start up file will be taken into account.

You can check this by executing your example from the internal Flash and displaying the XPERCON register content in the hyperterminal.

Please let me know if this was not clear.

Best regards,

Najoua.

juergen239955
Associate II
Posted on July 10, 2006 at 09:37

Hi Najoua,

I don't use the debugger, I execute my program in RAM.

That you can maybe better see what I am doing, I have attached my project.

Regards,

Juergen

________________

Attachments :

Projekte.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0Nb&d=%2Fa%2F0X0000000bYG%2FjGh73CwI4DHu_HIV7Mn0_fjZIskCAWWyH.3EOZeWyPk&asPdf=false
juergen239955
Associate II
Posted on July 11, 2006 at 05:23

Shame on me!

In the meantime I found out what I did wrong: I have located my program in XRAM and with setting XPEN to 0 you disable the XRAM ... :-[

Now I have located __CSTART_PR in IRAM (the rest is still in XRAM) and now it works. :-]

Neila and Najoua, thank you very much for your help!!!

Regards,

Juergen