cancel
Showing results for 
Search instead for 
Did you mean: 

printf + float library

krzysiekadmi2
Associate II
Posted on December 04, 2007 at 12:13

printf + float library

5 REPLIES 5
krzysiekadmi2
Associate II
Posted on December 02, 2007 at 11:39

Hi all.

I'm trying to use printf function. I'am using ST7VD 3.3.4 and Cosmic C Compiler 4.5.7 (version limited to 16kB).

I write own putchar procedure, to send char to LCD display.

When i use printf and integer operations library it's ok, but when i select float operations library in linker configuration while compiling i see:

#error clnk Debug\calc.lkf:1 segment .text size overflow (940)

#error clnk Debug\calc.lkf:1 segment .const size overflow (141)

#error clnk Debug\calc.lkf:1 segment .init size overflow (3)

#error clnk Debug\calc.lkf:1 segments .text (0xe000-0x103ac) and .const (0xffe0-0x10000) overlap

I'm using Long Memory model, but problem appears in all models.

I have attached my project files.

I need to use float operations library and printf because in future i want to display double type numbers on LCD screen

Thanks in advance

Sorry for my english, but I'm from Poland

[ This message was edited by: krzysiekadmi on 02-12-2007 16:12 ]

________________

Attachments :

st7-test.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HzgF&d=%2Fa%2F0X0000000bVN%2Fy4xOPnJgtKTm4868D_VaTI1z6U8XpQxSEVYAdYSgLvU&asPdf=false
luca239955_st
Associate III
Posted on December 03, 2007 at 04:59

the floating point libraries are bigger than the integer ones, you need to change your linker file (and maybe your chip?) to allow more place for the extra code.

Regards,

Luca (Cosmic)

krzysiekadmi2
Associate II
Posted on December 03, 2007 at 12:40

So, how to change it?

I'm using ST7FLITE29

luca239955_st
Associate III
Posted on December 04, 2007 at 04:14

you need to edit the linker file (calc.lkf). Somewhere in there you will have something like

+seg .text -b 0xe000 -n .text # program start address

change the 0xe000 with a lower value (for example 0x8000 for a 32k memory).

If you use STVD7, this value is probably linked to the chip you have chosen: chenge the chip or look in the menus if you can find a way to override the standard value for your chip.

Needless to say, if you *must* use a chip with only 8k of memory, all the above is just a trial, but your application is too big for your chip.

krzysiekadmi2
Associate II
Posted on December 04, 2007 at 12:13

I have changed linker file as you say, now i'm able to compile program but the file is too big to load into micro.

I consider micro change

Thanks for reply.