IAR Linker Problem

Hi!

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

Reply to
Oliver
Loading thread data ...

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.
Reply to
Dave Hansen

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

Reply to
Anton Erasmus

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.
Reply to
jtp

Hi!

Thanks, it's working now!!!!!!

Oliver

"Ant>

two

Reply to
Oliver Hager

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.