REKLAMA

st7.zip

ST7Lite29 + Cosmic Idea 4K, pierwsze starcie == problem

Trochę głupio samemu odpowiadać sobie na pytanie ale może się przyda innym użytkownikom :). Otóż mój problem rozwiązuje dodanie dwóch lini w pliku komend linkera: ... "C:\Program Files\COSMIC\EVAL_ST7\Lib\crtsi.st7" # Put your files here #crts.o - plik crtsi.s wyrzucony zamiast tego powyzsza biblioteka # object pliku z funkcja main main.o # # float and integer library names depend on the model used # #"C:\Program Files\COSMIC\EVAL_ST7\Lib\libisl.st7" # machine library zalatwia wszystko "C:\Program Files\COSMIC\EVAL_ST7\Lib\libm.st7" ... Wszystko ładnie ale przybyło dodatkowe 400 bajtów kodu wynikowego. Trochę pewnie startup a część to efekt dolinkowania machine library. Wiec teraz już linker nie próbuje 'wrzucać' mi obszarów RAM do hexa. Ciekaw jestem co dokładnie jest zdefiniowane w tej bibliotece że wszystko jest ok. Załączam przykład testowego pseudo-projektu. Pozdr, rn


Pobierz plik - link do postu
  • st7.zip
    • IDEABLD.BAT
    • output.hex
    • project.map
    • int_vect.o
    • int_vect.c
    • int_vect.sbr
    • main.sbr
    • project.lkf
    • crts.o
    • IDEA.ERR
    • st7_test.prj
    • crts.s
    • clean.bat
    • main.o
    • Test_Projerct
    • main.c


st7.zip > main.c

/* main file */
#include & lt; io7flit2.h & gt;

static char cnt = 5;

int last_val = 0;

void port_init(void)
{
PBDDR = 0x0F;
PBOR = 0x0F;
PBDR = 0;
}


int main(void)
{
port_init();
while(1)
{
cnt++;
if(cnt & gt; 100)
{
cnt = 5;
PBDR = ~PBDR;
last_val = cnt;
}
}
return 0;
}


st7.zip > int_vect.c

/* INTERRUPT VECTORS TABLE FOR ST7LITE0
* Copyright (c) 2000 by COSMIC Software
*/
#define NULL 0


extern void _stext(); /* startup routine */

@interrupt void Unhandled_Interrupt(void);

void (* const _vectab[])() =
{
Unhandled_Interrupt, /* unused */
Unhandled_Interrupt, /* SPI */
Unhandled_Interrupt, /* LITE TIMER RTC */
Unhandled_Interrupt, /* LITE TIMER Input Compare */
Unhandled_Interrupt, /* AT TIMER Overflow */
Unhandled_Interrupt, /* AT TIMER Output Compare */
Unhandled_Interrupt, /* AVD */
Unhandled_Interrupt, /* unused */
Unhandled_Interrupt, /* unused */
Unhandled_Interrupt, /* External Interrupt 3 */
Unhandled_Interrupt, /* External Interrupt 2 */
Unhandled_Interrupt, /* External Interrupt 1 */
Unhandled_Interrupt, /* External Interrupt 0 */
Unhandled_Interrupt, /* unused */
Unhandled_Interrupt, /* TRAP */
_stext, /* RESET */
};

@interrupt void Unhandled_Interrupt(void)
{

}