[elektro]
Info
info at kiralyelektronika.hu
Wed Jul 18 15:30:59 CEST 2012
> Próbáltam linkert scriptet csinálni hozzá, de maradtam a gyári
> automatikusan generált változatnál.
> Az IAR C-ben tudod a memterület lefoglalni, elérhetőség megadni
> majd a szegmens hozzárendelni, nem kell hozzá linker script?
Nem C-ben, de nem is script. Valami kevert konfigszerűség:
===========================
define symbol __ICFEDIT_intvec_start__ = 0x00002000;
define symbol __ICFEDIT_region_ROM_start__ = 0x00002000;
define symbol __ICFEDIT_region_ROM_end__ = 0x00013FFF;
define symbol __ICFEDIT_region_RAM_start__ = 0x10000000;
define symbol __ICFEDIT_region_RAM_end__ = 0x10001FDF;
define symbol __ICFEDIT_size_cstack__ = 0x200;
define memory mem with size = 4G;
define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];
define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
initialize by copy { readwrite };
do not initialize { section .noinit };
place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
place at address mem: 0x100000C0 { readwrite section .param_table };
do not initialize { section .param_table };
place at address mem: 0x13C00 { readonly section .corrtable };
place at address mem: 0x13E00 { readonly section .deftable };
place at address mem: 0x10001DD8 { block CSTACK };
place in ROM_region { readonly };
place in RAM_region { readwrite };
===========================
Láthatod, hogy pl kihagytam a bootloader részt, van benne corrtable,
deftable, stb. amiket betöltéskor írok (főleg AD korrekciók).
Aztán C-ben:
===========================
#pragma location = ".corrtable"
const short int CORRTABLE[] = {
5500,
...
===========================
Vagy pl a kódba fix kódszavat így kezel:
__root const dword CRP_code @ "CRP_CODE" = 0x43218765;
> Nincs szükségem változóra, csak egy a fontos, hogy a FLASH-be
> (code, vagy .text) 32 bitre illesztve a program ellenörző összeget
> tudjam tárolni.
Erre a linkernek szokott lenni opciója, pl.:
<http://www.google.hu/imgres?q=iar+fill+checksum&um=1&hl=hu&sa=N&tbm=isch&tbnid=XqmYfT3rejqABM:&imgrefurl=http://supp.iar.com/Support/%3Fnote%3D64424%26from%3Dnote%2B11927&docid=6eEB-IhD13K2KM&imgurl=http://netstorage.iar.com/SuppDB/Public/SUPPORT/006186/ProjectOptionsLinkerChecksum.gif&w=540&h=489&ei=WboGUKzZN-jl4QSQoeX1CA&zoom=1&iact=hc&vpx=173&vpy=138&dur=2192&hovh=214&hovw=236&tx=153&ty=168&sig=106208085731747916276&page=1&tbnh=131&tbnw=145&start=0&ndsp=41&ved=1t:429,r:0,s:0,i:71&biw=1680&bih=927>
More information about the Elektro
mailing list