I'm using an IAR Compiler for Hitachi H8-3687. This Controller has to RAM areas (0xE800-0xEFFF(2kByte) and 0xFB80-0xFF7F(1kByte). My segment UDATA1 has more than 2kByte an is not linkable. How can I split the segment in two parts to locate it in both RAM areas?
Oliver
Didn't find your answer? Ask the community — no account required.
D
Dave Hansen
I've not used that compiler, but a couple of general principles:
1) Initialized and Uninitialized data usually go into two separate segments. A first guess would be IDATA1. Try initializing some data to see if it moves. Tell your linker script to put IDATA1 in one RAM area and UDATA1 in the other.
2) The compiler usually decides where to put data. There may be an option or a pragma you can use when compiling to direct some modules to place data in one or another segment of your own choosing. Maybe UDATA2? Look for something like that.
HTH,
-=Dave
Change is inevitable, progress is not.
A
Anton Erasmus
I have not used the H8-3 IAR compiler, but on the IAR compilers I have used theres is a compiler flag that keeps text/string data in the ROM areas. Make sure this is enabled otherwise all text/string data is copied to RAM. For locating some variables in other data areas you need to use something like the following: #pragma memory=dataseg(anothersection) int var_in_anothersection; #pragma memory=default You can specify in the linker file where "anothersection" should be located.
Regards Anton Erasmus
J
jtp
Hi! If none of your projects translation units e.g. .c files consists more than
2 kBytes uninitialized data, then the linker should be able to place uninitialilzed data to those two RAM areas automatically. But if one of these translation units have more than 2 kBytes uninitialized data then you better do what Dave said in his post.
O
Oliver Hager
Hi!
Thanks, it's working now!!!!!!
Oliver
"Ant>
two
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.