hi Philipp,

thanks a lot for your help! Here’s my current status:

1) sdcc IDE: I’ll check Eclipse and Code::Blocks, which were both proposed here

2) graphical debugging: I understand that graphical debugging via SWIM/ST-Link is not supported, yet. However, with printf working (see below), I can live with that

3) support for float: after I linked the file "stm8.lib“, float worked right away :-)

4) code in RAM: actually I don’t need it for performance but to log data to the program flash, because the EEPROM is too small for my needs. To my understanding the program flash of the STM8 doesn’t support execute-while-write, so I need the actual flash write&erase routines in RAM…? At least the Cosmic compiler (and STM8 boot loader) require that. The Cosmic compiler supports that via #pragma and linker settings. Can this be done in SDCC as well and, if yes, how? A small example would be highly welcome… ;-)

5) printf/sprintf support: yep, same story as float. Linking to "stm8.lib“ and implementing a custom putchar() did the job :-)

6) allocate flash segments: in the link Maarten provided, I also found the option to just allocate arrays with absolute address in source code. Actually I like that idea because it keeps everything together. Since the segment I for data logging, I first need to solve item 4)

7) far points for >64kB: when item 4) is solved, I’ll need to access >64kB memory space when reading out the data log. Would it work if I manually load the 24bit address to the respective STM8 register via inline assembler? Again, any help is highly appreciated! However, I’ll need to wait until I have something to read out… ;-)

Again, thanks a lot for your great support!

Georg


------------------------------

Message: 4
Date: Mon, 31 Mar 2014 10:09:03 +0200
From: Philipp Klaus Krause <pkk@spth.de>
Subject: Re: [Sdcc-user] SDCC/STM8 questions
To: sdcc-user@lists.sourceforge.net
Message-ID: <5339229F.4050901@spth.de>
Content-Type: text/plain; charset=windows-1252

Signierter PGP Teil
On 30.03.2014 00:41, Master Postfach wrote:
> hello all,
>
> after evaluating SDCC for STM8 for a few weeks now, I still have
> some questions. I hope they are simple, and that someone will
> answer them. For your support thanks a lot in advance!!! :-)  So,
> here?re my questions:
>
> * currently I use SDCC via an ASCII editor and a console. Is ok,
> but feels solo 80s? ;-)   Is there any *IDE with built-in support*
> or configurable for SDCC/STM8? Ideally with compiling, linking,
> upload and debug (see below wish list)

Someone did some work for Code::Blocks, but I didn't try it
http://www.mikrocontroller.net/topic/326808 (post in GErman, but there
shuld be English instructions in the download).

>
> * since I?m into physical computing, debugging via simulator is not
> a viable option. Is there a *debugger with GUI*, which supports
> SDCC and ST-Link (from STM8 discovery board)? If required, R-Link
> would also be ok

AFAIK, not yet.

>
> * does SDCC for STM8 also support *float operations*? I try to
> avoid float wherever possible, but sometimes it would come very
> handy, independent of speed and memory. In the (8051) manual it
> seems so, but I always get an error message when I try an operation
> with float numbers

float is supported. The stm8 port passes the regression tests,
incuding the tests of foat operations. There is no support for double
though: sdcc emits a warning for doubles and replaces them by floats.

>
> * how can I write *code to execute from RAM*? I need to log data
> to flash, but since the flash is single-ported, the actual flash
> operations have to be executed from RAM (or so I think).

According to my understanding of the stm8 architecture you should be
able to have both code and your data in flash (resulting in a few
pipeline stalls once in a while, which slow your code down a bit;
however AFAIK the RAM data bus is just 8 bits wide, so you'd get even
more pipeline stalls with code in RAM). But I haven't done something
like this before.

>
> * if *printf/sprintf supported* by SDCC/STM8? Of course each
> instance could be replaced somehow, but I?d rather not sieve
> through all my old projects...

printf() and sprintf() are supported.

>
> * how do I *specify flash segments/locations for the linker*? I
> need to reserve some part of the flash for data logging, but I
> don?t know how to tell the linker which

I don't use such functionality often, but AFAIR, the -b option
(possibly with some custom area for the reserved part) should help.

>
> * and, last but not least, *how can I define a far pointer* to a
> >64kB address (i.e. 24 or 32 bit)

Far pointers are not supported yet.

Philipp




------------------------------

Message: 5
Date: Mon, 31 Mar 2014 10:42:31 +0200 (CEST)
From: "Maarten Brock" <sourceforge.brock@dse.nl>
Subject: Re: [Sdcc-user] SDCC/STM8 questions
To: sdcc-user@lists.sourceforge.net
Message-ID: <42876.82.161.160.72.1396255351.squirrel@www.dse.nl>
Content-Type: text/plain;charset=iso-8859-1

Hi,

>> * how do I *specify flash segments/locations for the linker*? I
>> need to reserve some part of the flash for data logging, but I
>> don?t know how to tell the linker which
>
> I don't use such functionality often, but AFAIR, the -b option
> (possibly with some custom area for the reserved part) should help.

Have a look at this forum thread:
https://sourceforge.net/p/sdcc/discussion/1864/thread/d4bf46f1/

Maarten



------------------------------

Message: 6
Date: Mon, 31 Mar 2014 09:54:38 +0200
From: Sebastien Lorquet <sebastien@lorquet.fr>
Subject: Re: [Sdcc-user] SDCC/STM8 questions
To: sdcc-user@lists.sourceforge.net
Message-ID: <53391F3E.1080507@lorquet.fr>
Content-Type: text/plain; charset=ISO-8859-1

Signierter PGP Teil
hello

yes, SDCC can be integrated with code blocks. You can choose a "sdcc" compiler
type in the project settings.

The built-in option list may be a little outdated, but you can still add any
option by hand.

I have used that myself a few times with the PIC16 tols.

Best regards,

S?bastien Lorquet

Le 30/03/2014 20:17, Philipp Klaus Krause a ?crit :
> On 30.03.2014 20:04, Kustaa Nyholm wrote:
>>> Is there any *IDE with built-in support* or configurable for
>> SDCC/STM8? Ideally with compiling, linking, upload and debug (see below
>> wish list)
>
>
>> I use SDCC with Eclipse (CDT) as described here:
>
>> http://www.sparetimelabs.com/funwith08/funwith08.php
>
>> ...but I don't use debugger, would not be much any good with the kind of
>> software I write and the kind of debugging I need, good old printf is
>> all I need...
>
>> cheers Kusti
>
> Apparently someone made something for Code::Blocks at
> http://www.mikrocontroller.net/topic/326808, but haven't tried it myself
> (the post is in German, but the download should include English
> instructions).
>
> Philipp
>
>
> ------------------------------------------------------------------------------
>
>
>
_______________________________________________
> Sdcc-user mailing list Sdcc-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sdcc-user
>