cancel
Showing results for 
Search instead for 
Did you mean: 

Jump to RAM from ROM ST10

gglago
Associate II
Posted on December 21, 2005 at 13:40

Jump to RAM from ROM ST10

4 REPLIES 4
gglago
Associate II
Posted on December 15, 2005 at 12:06

Hello!

I have just started to work with ST10 microcontroller and assembler language.

My problem is that I have some code executing in the flash (ROM) and I want to jump to RAM and execute the code that has been loaded previously in RAM.

I don´t know how can I do it?

I have checked different solutions without any success.

How can I do it?

Thanks for your help!

Regards,

Gracinda

gglago
Associate II
Posted on December 16, 2005 at 08:15

Hello Neila,

I have been reading the ST10 programming manual and the user manual where I have found the memory mapping of ST10.

I am not sure from what address I am jumping (Flash) because from one point in the code loaded in the Flash I jump to the address 0x0F0000 (RAM).

The code in RAM has been loaded in the address 0x0F0000.

In the manual, I have found the instruction JMPS, but I think that I can´t use this instrucction, because I am trying to jump to other segment (address 0x0F0000, segment 15).

I tried using the instrucction CALLS to jump to RAM but when I compile I obtain errors, I have use the following instruction:

CALLS 15, 0x0F0000; Is it correct?

The code that I am using are:

void fnSaltarRAM(unsigned long dirEntry)

{

#pragma asm

CALLS 15, 0x0F0000;

#pragma endasm

}

Is there are other instruction I can use?

And to load the code in RAM I am using one programm but I know that the programm is working correctly.

I have a doubt, what do you mean when you say ''I suppose that the code in the flash enables you to copy code from the flash to the RAM and then jump to it for execution''? I have read in one application note about copy code from Flash to RAM to execute this, but I don´t understand this concept. because I want to execute code that has been loaded in RAM to free space memory in Flash, so, if I copy the code from Flash to RAM you are using the space in the Flash, aren´t you?

Thank you very much for your help!

Regards,

Gracinda

gglago
Associate II
Posted on December 19, 2005 at 12:14

Hi Neila;

I am here again.

Thank you very much for your help about the sintaxe of the instrucction ''CALLS'', it corrects the compilation errors.

Instead of this, it doesn´t work yet.

I am not sure, if the problem is related with the micro or the compiler and the options I am using.

I am using the ST10F276E, and TASKING C166/ST10.

And I have some doubts about the Project Options of TASKING.

>Project Options>Linker\Locator>Memory > Memory area (Here, do I have to define the area of RAM, I am using?

>Project Options>Linker\Locator>Memory>Map ROM sections in unused reserved RAM area at the bottom of IRAM (I haven´t activates this option, because I think that this option changes the reserved internal RAM space in ROM)

>Project Options>Linker\Locator>Memory>Mark internal RAM area as RAM. I am not sure if I have to activate this option ( Because in the TASKIN help I have read that this option should be disable when building a bootstrap loader wich has code located in internal RAM)

I know that this forum is not a TASKING forum, but maybe, you have used this and you can help!

Thank you very much!!

najoua
Associate II
Posted on December 21, 2005 at 13:40

Hello Gracinda,

Please find below answers to your questions:

>Project Options>Linker\Locator>Memory > Memory area:

this option is used to specify where the applications code and data is allocated.

Please refer to the attached application note, page 3 for more details.

>Project Options>Linker\Locator>Memory>Map ROM sections in unused reserved RAM area at the bottom of IRAM:

this option allows adding a ROM memory range from 0xF200-0xF5FF, allowing ROM sections to be located in that area.

>Project Options>Linker\Locator>Memory>Mark internal RAM area as RAM:

this option enables the default RAM memory range for the internal RAM area. If this option is disabled, there is no default RAM range mapped for internal RAM, allowing you to specify your own range.

I hope this helps you,

Best regards,

Najoua.

[ This message was edited by: Najoua on 21-12-2005 18:14 ]

________________

Attachments :

project_options.pdf : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0Oy&d=%2Fa%2F0X0000000bYX%2Frqj7qDck2XUYJXeUIF8B4sy_1SJToTAAJVgWV16N7ro&asPdf=false