mc9s12XEG128 gcc linker script

cancel
Showing results for 
Search instead for 
Did you mean: 

mc9s12XEG128 gcc linker script

986 Views
spectrum
Senior Contributor I

Hi all,

i am looking for a sample of a gcc linker script, using flash banking (to use the whole 128K of flash). Even for a similar model is ok.

 

Many thanks

angelo

Labels (1)
0 Kudos
11 Replies

198 Views
jawwaj
Contributor II

ABI gcc/CodeWarrior are not object file level compatible???

https://groups.yahoo.com/neo/groups/gnu-m68hc11/conversations/topics/8987

0 Kudos

198 Views
jawwaj
Contributor II

Yahoo! Groups 

"HiWave does not care for LMA versus VMA, that's why flashing ELF files
does not work (only the Metrowerks guys do no accept it, they claim the ELF
is wrong)"

Is this a "Error objecti-info"??

0 Kudos

198 Views
jawwaj
Contributor II

Yes yes, Hiwave with .S19 files generated with GCC GNU work well. But..

Hiwave can debug elf files from IDEA COSMIC Compiler (cross compliler as GNU GCC), using the tool "Cvdwarf". The result is a ELF/DWARF file that can be debug with Hiwave.

In GCC you can use the flag option -gdwarf-version for 2.0 but the debugger show "error in object file".

Why?

0 Kudos

198 Views
jawwaj
Contributor II

Yes, it works, but is it possible to use Hiwave as a C debugger ???

I was working with Noice12 on 9S12 microcontrollers, but now with 9S12X, I can not see the Xgate core.

Hiwave can debug Xgate.

I'm testing elf files generated with the Cosmic compiler, and It work properlytly, but the elf files generated with GCC show me "Error in Object-File (debug-info)".


What is the difference?

Not all ELF / DWARF 2.0 are similar?

Is it possible to convert elf files from GNU to Hiwave ???

0 Kudos

198 Views
spectrum
Senior Contributor I

Well, on hiwave i use always .s19 images, since elf was giving me some trouble. s19 images works fine with hiwave. Whatever mc9s12 compiler you use, compiler or a supplied tool should be able to generate s19.

No, as far as i know, in hiwave you can debug only C source generated with CodeWarrior. Otherwise assembly steps only of whatever s19.

Are you using a proper linker script for GCC ? Btw, generate and try the s19 with hiwave.

0 Kudos

198 Views
spectrum
Senior Contributor I

I load the .s19 and all works

0 Kudos

198 Views
jawwaj
Contributor II

I found this:

Yahoo! Groups 

But no more

0 Kudos

198 Views
jawwaj
Contributor II

Hi, How can you load .elf files created with GCC GNU in Hiwave????

I receive: Warning:Error in object file (debug information)

0 Kudos

198 Views
spectrum
Senior Contributor I

Finally we migrated to mc9s12xep100, found clear gcc explanations on megasquirt open firmware. Banked accesses from local (PPAGE), xgate code and all works fine with gcc. I can build with gcc and program though hiwave.

Regards,

angelo

0 Kudos

198 Views
RadekS
NXP Employee
NXP Employee

Hi Angelo,

Unfortunately, I never use GCC toolchain yet for S12(X/Z).

The banked system split memory into pages ( space is not linear) and we should define every page separately. For example:

MEMORY

  {

  rom_E0 (rx) : ORIGIN = 0xE08000, LENGTH = 16K

  rom_E1 (rx) : ORIGIN = 0xE18000, LENGTH = 16K

  rom_E2 (rx) : ORIGIN = 0xE28000, LENGTH = 16K

  rom_E3 (rx) : ORIGIN = 0xE38000, LENGTH = 16K

  rom_FC (rx) : ORIGIN = 0xFC8000, LENGTH = 16K

  rom_FD (rx) : ORIGIN = 0x4000, LENGTH = 16K

  rom_FE (rx) : ORIGIN = 0xFE8000, LENGTH = 16K

  rom_FF (rx) : ORIGIN = 0xC000, LENGTH = 16128

  m_cfmprotrom (rx) : ORIGIN = 0xFF00, LENGTH = 16

  m_interrupts (rx) : ORIGIN = 0xFF10, LENGTH = 240

  ram (rwx) : ORIGIN = 0x2000, LENGHT = 0x2000

  paged_ram (rwx) : ORIGIN = 0xFD1000, LENGTH = 0x1000

  }

In SECTION area, you may define placement different objects into these memory segments.

Unfortunately, I didn’t found any GCC guide how to concatenate these chunks into one region and use it in SECTION area – keep allocation on linker across all pages.

 

We could simply assign several segments into one user segment in CodeWarrior linker. Or we could use global addresses for define linear address space like 0x780000’G..0x78FFFF’G. Unfortunately, I don’t know how to implemented such things on GNU toolchain.

 

The most useful links about GNU linker where I searched:

http://www.eecs.umich.edu/courses/eecs373/readings/Linker.pdf

http://www.scoberlin.de/content/media/http/informatik/gcc_docs/ld_3.html

http://richardgoyette.com/Research/Papers/FreeRTOSPaperAnnA.pdf

http://www.msextra.com/tools/

 

The S12XE memory map is attached.

I hope it helps you.

Have a great day,
Radek

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

198 Views
spectrum
Senior Contributor I

Hi Radek,

a special thanks for your very kind support. Will see what i can do and will post something here once things are up and running.

I am planning to still use hi-wave, so a mixed solution, gcc produced binary and hiwave for programming (of course only asm step debug will be possible), but will live with uart debug traces.

Still many thanks!

0 Kudos