cancel
Showing results for 
Search instead for 
Did you mean: 

mapping.asm & mapping.inc

fggnrc
Associate II
Posted on September 18, 2009 at 13:00

mapping.asm & mapping.inc

3 REPLIES 3
fggnrc
Associate II
Posted on May 17, 2011 at 15:04

Hello!

STVD project settings for ST Assembler/Linker allow to define new segments.

These definitions are usually written to ''mapping.asm'' which includes ''mapping.inc''.

''mapping.inc'' contains some useful definitions, such as ''stack_segment_start'' or ''stack_segment_end'', but it has no definitions for flash or EEPROM segments.

I need these definitions to avoid ''hardwiring'' them in my BootLoader code where I have to rewrite my firmware code segments.

Is there a way to have a constant which is ''magically'' updated when I resize my code segments?

Thanks in advance

EtaPhi

mozra27
Associate II
Posted on May 17, 2011 at 15:04

Hi EtaPhi,

The informations about the product are defined in the data base ''McuDb.mdb'' and are crypted. You can define the appropriate definitions for flash, Data EEPROM or RAM segments by editing directly the linker file.

Regards

mozra

fggnrc
Associate II
Posted on May 17, 2011 at 15:04

mozra,

I realize from your reply that my previous post isn't clear.

Here is what STVD writes in my ''mapping.asm'' :

Code:

stm8/

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

; SEGMENT MAPPING FILE AUTOMATICALLY GENERATED BY STVD

; SHOULD NOT BE MANUALLY MODIFIED.

; CHANGES WILL BE LOST WHEN FILE IS REGENERATED.

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

include ''mapping.inc''

BYTES ; The following addresses are 8 bits long

segment byte at ram0_segment_start-ram0_segment_end 'ram0'

WORDS ; The following addresses are 16 bits long

segment byte at ram1_segment_start-ram1_segment_end 'ram1'

WORDS ; The following addresses are 16 bits long

segment byte at stack_segment_start-stack_segment_end 'stack'

WORDS ; The following addresses are 16 bits long

segment byte at 4000-45FF 'eeprom'

WORDS ; The following addresses are 16 bits long

segment byte at 8000-807F 'vectit'

WORDS ; The following addresses are 16 bits long

segment byte at 8080-97FF 'boot'

WORDS ; The following addresses are 16 bits long

segment byte at 9800-FFBF 'code'

WORDS ; The following addresses are 16 bits long

segment byte at FFC0-FFFF 'interface'

WORDS ; The following addresses are 16 bits long

segment byte at 10000-17FFF 'rom'

END

As you can see, the only defined constants are related to ram0_xx, ram1_xx and stack_xx.

I'd like STVD to add something like ''#define code_segment_start 9800'' so that I can use it in my code.

If I add this definition in ''mapping.asm'' or in ''mapping.inc'', it will be erased when my project is built.

I could add this definition in my sources, but synchronization is lost when I change the code segment size.

I could also define a symbol at my code segment start, but its value depends on the linking order.

I see also no automatic means to check (while my project is built) if a symbol is the very first one of a segment.

My workarounds therefore can turn against me when I will have to change something in the future.

If there is no way to achieve my goal, I'll add a BIG REMARK at the beginning of my code.

This is however a bad solution...

Regards

EtaPhi