Rolf Schroder | 20 Nov 16:28 2014

Migrating from Cosmic to SDCC; ASlink-Warning-Undefined Global

Dear All,

<at> Maarten, Philip, Raphael:
thank you for your comments. You were all right: I did not pass the STM8 lib as an argument and it wasn't in the current folder. I tried to link against the lib which came with the SDCC 3.4.0 (win32) install but it did not work (same errors). I managed to compile the two STM8 libraries (discovery + periph-driver; again slightly adapting the src), put them into one binary and were able to compile my main.c without warnings. I think this did the trick. I did not have the time to test this out but I hope I will in the future. Thank you again for answering.

FYI: I could not find any information about Storage Class Language Extensions for the STM8 in the doc so I removed the " <at> near" / " <at> far" extensions used by the COSMIC compiler (instead of replacing them with SDCC's version). I am not sure whether the code will still work.

<at> Maarten: I am not sure where the STM8 discovery + periph-driver src comes from. I did not create the project initially.

<at> Philip: Thank you for clarifying about ihx format + MCU damaging.

Best,
Rolf



------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Sdcc-user mailing list
Sdcc-user@...
https://lists.sourceforge.net/lists/listinfo/sdcc-user
curliph | 20 Nov 12:41 2014
Picon

Help for building sdcc with msvc2010!

Hi Guys,
 
   I try to build the latest sdcc using msvc2010 following the sdcc compiler user guide,
but failed, here is the output from msvc2010:
3>Build started 2014-11-20 13:27:14.
1>CustomBuild:
1>  Generating: asxxxx_config.h
3>InitializeBuildStatus:
3>  Creating "Debug\sdcpp.unsuccessfulbuild" because "AlwaysCreate" was specified.
2>CustomBuild:
2>  Generating Parser: SDCCy.c
4>Build started 2014-11-20 13:27:15.
1>  Generating: version.h
4>InitializeBuildStatus:
4>  Creating "Debug\packihx.unsuccessfulbuild" because "AlwaysCreate" was specified.
1>  Generating: sdcc_vc.h
2>  sdcc.y:182: type clash (`' `sym') on default action
3>CustomBuild:
3>  Generating: auto-host.h
2>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 1.
2>
1>FinalizeBuildStatus:
3>  Generating: options.c and options.h
1>  Deleting file "Debug\config.unsuccessfulbuild".
1>  Touching "Debug\config.lastbuildstate".
1>
1>Build succeeded.
1>
1>Time Elapsed 00:00:00.83
2>Build FAILED.
2>
2>Time Elapsed 00:00:00.50
5>------ Build started: Project: stm8, Configuration: Debug Win32 ------
6>------ Build started: Project: ds390, Configuration: Debug Win32 ------
5>Build started 2014-11-20 13:27:15.
5>InitializeBuildStatus:
5>  Touching "Debug\stm8.unsuccessfulbuild".
6>Build started 2014-11-20 13:27:15.
6>InitializeBuildStatus:
6>  Touching "Debug\ds390.unsuccessfulbuild".
6>CustomBuild:
6>  Generating Peephole Rule: peeph.rul
5>CustomBuild:
5>  Generating Peephole Rule: peeph.rul
4>ClCompile:
4>  packihx.c
6>ClCompile:
6>  ralloc.c
3>ClCompile:
3>  dirent.c
6>e:\projects\sdcc\sdcc\src\common.h(44): fatal error C1083: Cannot open include file: 'SDCCy.h': No such file or directory
6>  main.c
6>e:\projects\sdcc\sdcc\src\common.h(44): fatal error C1083: Cannot open include file: 'SDCCy.h': No such file or directory
6>  gen.c
5>ClCompile:
5>  ralloc.c
5>e:\projects\sdcc\sdcc\src\common.h(44): fatal error C1083: Cannot open include file: 'SDCCy.h': No such file or directory
5>  peep.c
5>e:\projects\sdcc\sdcc\src\common.h(44): fatal error C1083: Cannot open include file: 'SDCCy.h': No such file or directory
5>  main.c
6>e:\projects\sdcc\sdcc\src\common.h(44): fatal error C1083: Cannot open include file: 'SDCCy.h': No such file or directory
6>  Generating Code...
6>
6>Build FAILED.
 
I follow the guide strictly and carefully, but always fail...
What's wrong with me?
 
Thanks,
Best regards
 
curliph
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Sdcc-user mailing list
Sdcc-user@...
https://lists.sourceforge.net/lists/listinfo/sdcc-user
Kio | 18 Nov 16:00 2014
Picon

Re: support for zasm z80 assembler

Hi,

this is the dead for any port to another assembler. :-/
then i'll stick to the non-standard sdas syntax. Eliminating '#' is a job of one line, but parsing the n(IX) syntax requires additional code at multiple positions.

Anyhow a compilation of all emitted z80 opcodes, sdas pseudo opcodes and what each .area is for would be nice.

... Kio !

p.s.: this reply is rather late due to a mailing list hickup just for me…

Am 18.11.2014 um 00:27 schrieb sdcc-user-request <at> lists.sourceforge.net:

From: Philipp Klaus Krause <pkk-dH2bkuHepfc@public.gmane.org>
Subject: Re: [Sdcc-user] support for zasm z80 assembler

On 14.11.2014 19:14, Kio wrote:

i currently implement sdcc support in my z80 assembler zasm
(http://k1.spdns.de/Git/zasm-4.0.git/). My first try was to implement
the sdasz80 syntax until i discovered that sdcc already supports more
than one z80 assemblers.

However the support for others is not working fully: Sometimes asxxx
code will still be emitted, and the peephole rules only work for asxxxx,
too.


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Sdcc-user mailing list
Sdcc-user@...
https://lists.sourceforge.net/lists/listinfo/sdcc-user
Rolf Schroder | 17 Nov 13:05 2014

Migrating from Cosmic to SDCC; ASlink-Warning-Undefined Global

Dear All,

I am trying to compile a firmware for the STM8L. I used STVD & Cosmic (compiler) but want to switch to sdcc. I had made some small code changes to get everything running and I feel it's compiling correctly. I am using the following cmd to compile:

 sdcc -lstm8 -mstm8 -I inc -I ../../Source/inc -I ../../Libraries/STM8L15x_StdPeriph_Driver/inc -I ../../Libraries/STM8L-discovery_Libraries/inc -D STM8L15X_MD -D __CSMC__ --opt-code-size --disable-warning 126 src/main.c

(warning 126 is about unreachable code, I have to define __CSMC__ [Cosmic compiler] because my project was created with STVD which only supports 3 compilers [otherwise, I would need to change a lot of header files]; my MCU is STM8L152C8)

As I said, it compiles, but generates the following warnings:

?ASlink-Warning-Undefined Global '_RTC_SetWakeUpCounter' referenced by module 'main'

?ASlink-Warning-Undefined Global '_GPIO_Init' referenced by module 'main'

?ASlink-Warning-Undefined Global '_ADC_DeInit' referenced by module 'main'

?ASlink-Warning-Undefined Global '_RTC_WakeUpCmd' referenced by module 'main'

?ASlink-Warning-Undefined Global '_FLASH_ProgramOptionByte' referenced by module 'main'

?ASlink-Warning-Undefined Global '_ADC_ChannelCmd' referenced by module 'main'

?ASlink-Warning-Undefined Global '_RTC_ITConfig' referenced by module 'main'

?ASlink-Warning-Undefined Global '_ADC_GetFlagStatus' referenced by module 'main'

?ASlink-Warning-Undefined Global '_CLK_PeripheralClockConfig' referenced by module 'main'

?ASlink-Warning-Undefined Global '_FLASH_EraseOptionByte' referenced by module 'main'

?ASlink-Warning-Undefined Global '_RTC_WakeUpClockConfig' referenced by module 'main'

I am not very experienced and I don't know whether this should be a problem or not. main.map contains:

...
ASxxxx Linker V03.00 + NoICE + sdld,  page 1.
Hexadecimal  [32-Bits]

Area                                    Addr        Size        Decimal Bytes (Attributes)
--------------------------------        ----        ----        ------- ----- ------------
CABS                                00000000    00000000 =           0. bytes (ABS,CON)

      Value  Global                              Global Defined In Module
      -----  --------------------------------   ------------------------
     00000000  _ADC_ChannelCmd
     00000000  _ADC_DeInit
     00000000  _ADC_GetFlagStatus
     00000000  _CLK_PeripheralClockConfig
     00000000  _FLASH_EraseOptionByte
     00000000  _FLASH_ProgramOptionByte
     00000000  _GPIO_Init
     00000000  _RTC_ITConfig
     00000000  _RTC_SetWakeUpCounter
     00000000  _RTC_WakeUpClockConfig
     00000000  _RTC_WakeUpCmd
...

Greping for these keywords tells me that these are function names (without the prefixing underscore) in the STM8L libraries (inside my project). So they are there and I feel I just need a small change in order to prevent this problem.

So, to sum up:
#1 Does anyone know about this problems and how to deal with it?
#2 I don't know whether I can flash my MCU and just check if it still works (as I said, I am inexperienced and I fear to damage the chip with a faulty firmware)
#3 I am not sure, whether I need to use packihx or not. The sdcc manual states the the default output is already the Intel Hex format (which I used previously).

Last but not least: You guys rock! I am really thankful for your project :)
Thanks in advance,
Rolf

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Sdcc-user mailing list
Sdcc-user@...
https://lists.sourceforge.net/lists/listinfo/sdcc-user
Kio | 14 Nov 19:14 2014
Picon

support for zasm z80 assembler

Hi,

i currently implement sdcc support in my z80 assembler zasm (http://k1.spdns.de/Git/zasm-4.0.git/).
My first try was to implement the sdasz80 syntax until i discovered that sdcc already supports more than
one z80 assemblers. I compared their output and found that z80asm provides the most standard and
compatible output, but unfortunately it seems to not support segments and sdcc only emits commented-out
segment declarations for z80asm. So i added code to support zasm in sdcc directly.

Question: is there interest to add support for yet another assembler? (standard z80 syntax plus segments)
and if, how should i best submit the patches? Affected files are src/z80/main.c and mappings.i.

Also, i have implemented zasm support by "similarity", based on z80asm. So i still need some advice on some
settings which i do not understand. Who is the best person to ask; maybe just in the mailing list?

Greetings from Germany,

	... Kio !
--

-- 
http://k1.spdns.de/Vintage/Sinclair/
GPG-ID: 80E6A1DA

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
_______________________________________________
Sdcc-user mailing list
Sdcc-user@...
https://lists.sourceforge.net/lists/listinfo/sdcc-user
Hynek Sladky | 11 Nov 08:24 2014
Picon

Z80: function in RAM

Hello,

I need to make function which must run in RAM (Flash programming in bootloader). So far I haven't found how to do it. Nor in C neither in assembler.

What I have found is way how initialized variables are translated from C to assembly: the value is added to segment _INITIALIZER and space is allocated in _INITIALIZED. But this IMHO can't be used for code: code needs to be compiled for final placement (e.g. _INITIALIZED) and then moved as data to _INITIALIZER segment. Is there any way how to do it?

BTW, it seems to me that there is some problem with crt0.s - I have to have my own start-up routine so I used crt0.s as template. Unfortunately it can't be compiled unless .globl is added for l__INITIALIZE* and s__INITIALIZE* values. Does it work differently when using standard crt0.s?

Thanks,
Hynek Sladky
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
_______________________________________________
Sdcc-user mailing list
Sdcc-user@...
https://lists.sourceforge.net/lists/listinfo/sdcc-user
Gál Zsolt | 8 Nov 20:38 2014
Picon

SDCC compiled successfully on debian Jessie

Hello,

I would like to say about my success with sdcc yesterday. I started with a new computer so I had to install a new system. The stable release of Debian does not work exactly with this new hardver, so I had to look forward something new to force it working. That is why I started with this unstable Debian version named Jessie.
Tell the true, first time I was sad, because the fresh copy of svn source was problematic for the compiler. I always got the same error message. Finally I found a patch on this mail-archive for my problem:

http://sourceforge.net/p/sdcc/mailman/message/32589262/

I don't understand, why that patch isn't applied for the trunk since july. I think that could help other people, like me helped.

Regard,

Zsolt

zsolti <at> acer:~$ cat /etc/*-release
PRETTY_NAME="Debian GNU/Linux jessie/sid"
NAME="Debian GNU/Linux"
ID=debian
HOME_URL="http://www.debian.org/"
SUPPORT_URL="http://www.debian.org/support/"
BUG_REPORT_URL="https://bugs.debian.org/"


zsolti <at> acer:~$ uname -a
Linux acer 3.16-3-amd64 #1 SMP Debian 3.16.5-1 (2014-10-10) x86_64 GNU/Linux


gcc version 4.9.2 (Debian 4.9.2-1)


zsolti <at> acer:~$ sdcc -v
SDCC : pic14 3.4.1 #9098 (Nov  7 2014) (Linux)
published under GNU General Public License (GPL)

------------------------------------------------------------------------------
_______________________________________________
Sdcc-user mailing list
Sdcc-user@...
https://lists.sourceforge.net/lists/listinfo/sdcc-user
Philipp Klaus Krause | 27 Oct 14:24 2014
Picon

stm8 tutorials

I've written a few tutorials for getting started with the stm8 port:

They show doing simple LED I/O, setting up an accurate timer, doing
serial I/O and running the Dhrystone and Whetstone benchmarks:

http://www.colecovision.eu/stm8/

They use the STM8L-DISCOVERY and STM8/128-EVAL boards - I don't have any
other.

Philipp

------------------------------------------------------------------------------
_______________________________________________
Sdcc-user mailing list
Sdcc-user@...
https://lists.sourceforge.net/lists/listinfo/sdcc-user
Philipp Klaus Krause | 26 Oct 12:42 2014
Picon

Eine kurze Einführung zu sdcc 3.4.0

Since there is a somewhat active electronics community in Germany, I
wrote a short introduction to sdcc 3.4.0 in German:

http://www.colecovision.eu/sdcc.shtml

Philipp

------------------------------------------------------------------------------
_______________________________________________
Sdcc-user mailing list
Sdcc-user@...
https://lists.sourceforge.net/lists/listinfo/sdcc-user
Oli | 18 Oct 01:27 2014
Picon

Drastically increased estimated code size after sdcc 3.0.0 for pic14

Hello

Today I tried to recompile an old project for a pic16f690 and the thing
was suddenly too big too fit in the pic :
  error: no target memory available for section "code_happyhourjuhe"

As I changed some of the code I tried to reduce the size, but I had to
remove the complete main function (half of the code) to make it compile.

After some drinking I had the idea to try the old compiler version I was
using back in 2011.

Here's a comparison of the estimated file sizes for different sdcc
versions.

SDCC : pic16/pic14 3.4.0/*rc1*/ #8960 (Mar 10 2014)

bin/obj/EEPROM.asm              ;	   22+   12 =    34 instructions (
92 byte)
bin/obj/Globals_DEF.asm         ;	    0+    0 =     0 instructions (
0 byte)
bin/obj/I2C_adapter.asm         ;	 1061+  355 =  1416 instructions
( 3542 byte)
bin/obj/I2C_slave.asm           ;	  164+   61 =   225 instructions (
572 byte)
bin/obj/IncSwitch.asm           ;	   23+    7 =    30 instructions (
74 byte)
bin/obj/main.asm                ;	 1060+  371 =  1431 instructions
( 3604 byte)
bin/obj/ServoFunctions.asm      ;	  102+   32 =   134 instructions (
332 byte)
bin/obj/StoreLoadValues.asm     ;	  231+   73 =   304 instructions (
754 byte)

SDCC 3.0.1 release

in/obj/EEPROM.asm              ;	   22+   12 =    34 instructions (   92
byte)
bin/obj/Globals_DEF.asm         ;	    0+    0 =     0 instructions (
0 byte)
bin/obj/I2C_adapter.asm         ;	  917+  313 =  1230 instructions
( 3086 byte)
bin/obj/I2C_slave.asm           ;	  155+   60 =   215 instructions (
550 byte)
bin/obj/IncSwitch.asm           ;	   23+    7 =    30 instructions (
74 byte)
bin/obj/main.asm                ;	 1041+  352 =  1393 instructions
( 3490 byte)
bin/obj/ServoFunctions.asm      ;	  102+   32 =   134 instructions (
332 byte)
bin/obj/StoreLoadValues.asm     ;	  240+   73 =   313 instructions (
772 byte)

SDCC 3.0.0 release

bin/obj/EEPROM.asm              ;	   22+   12 =    34 instructions (
92 byte)
bin/obj/Globals_DEF.asm         ;	    0+    0 =     0 instructions (
0 byte)
bin/obj/I2C_adapter.asm         ;	  916+  175 =  1091 instructions
( 2532 byte)
bin/obj/I2C_slave.asm           ;	  155+   54 =   209 instructions (
526 byte)
bin/obj/IncSwitch.asm           ;	   23+    7 =    30 instructions (
74 byte)
bin/obj/main.asm                ;	 1030+  201 =  1231 instructions
( 2864 byte)
bin/obj/ServoFunctions.asm      ;	  100+   28 =   128 instructions (
312 byte)
bin/obj/StoreLoadValues.asm     ;	  242+   41 =   283 instructions (
648 byte)

As you can see, the estimated file size of main.asm for example
increases by ~20% from version 3.0.0 (2.8 kb) to version 3.0.1 (3.4kb)
and another ~3% from version 3.0.1 to the version I last pulled from svn
(3.6 kB).

Did you introduce some new optimisation switches since version 3.0.0 or
changed default libraries or stuff?

The commandline I'm currently using looks like this :
  sdcc  -o bin/obj/main.o -mpic14 -p16f690 -D__16F690__ --use-non-free
--opt-code-speed -I./src -I../../lib/16F690  -c -c src/main.c

(the opt-code-speed or size switch does the same as ever, nothing)

The code compiles fine with version 3.0.0.

Thank for any advice!

Cheeeeers,
Oli

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
Electropepper PIC | 16 Oct 01:32 2014
Picon

Missing definition for symbol

I am trying to compile this header file http://burningsmell.org/pic16f628/src/tsmdelay.h ,
whit code :

#define KHZ 1000L

#include <pic12f1822.h>
#include "tsmdelay.h"
#include "tsmtypes.h"

/* Setup chip configuration */
__code int __at(_CONFIG1) __CONFIG = _FOSC_INTOSC & _WDTE_OFF & _PWRTE_OFF & _MCLRE_ON & _CP_OFF & _CPD_OFF & _BOREN_OFF & _CLKOUTEN_OFF & _IESO_OFF & _FCMEN_OFF;

void setup(void);
unsigned char minute = 60;



void main(void) {

    setup();


    while(1) {

        while (minute--){
            DELAY_BIG_US(1000000LU);
        }
        LATA |= (1<<2);
    }

}

void setup(void) {

    OSCCON = 0b01011000;
    LATA = 0;
    TRISA = 0x00;
    PORTA = 0x00;
}


And i keep getting error :
message: Using default linker script "/usr/local/share/gputils/lkr/12f1822_g.lkr".
error: Missing definition for symbol "_dvar", required by "main.o".
error: Missing definition for symbol "_cycle_eater", required by "main.o".
make: *** [main.o] Error 1

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Sdcc-user mailing list
Sdcc-user@...
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Gmane