Michel Bouissou | 1 Nov 2009 07:46

Re: "This is probably a compiler bug..." message

Hi,

I've found another situation causing sdcc to spit :
« encountered NULL pcop--this is probably a compiler bug... »

A line trying to set a variable but using by mistake "==" instead of "=", i.e.

somevariable==1;
	instead of
somevariable=1;

Then the compiler spits this message without giving any indication about the 
line that is the cause of the problem.

--

-- 
Michel Bouissou (OpenPGP ID 0xEB04D09C)

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
Michel Bouissou | 1 Nov 2009 14:50

The damned loop from hell

Hi guys,

I fell on a problem on which I just spent a day and a half, plus a whole 
night, with no clue :-(

At this step, as every poor programmer would, I think "this is probably a 
compiler issue, otherwise my brain is dead", so it's quite ashamed that I 
submit this here...

I have a function called SubReadInputs() that does something complex yet 
simple ;-) :

1/ It first "statically" fills an array/structure of 12 entries by copying ports 
inputs into it.

2/ It then processes the array using a for (i=0; i<=11; i++) { ...blah... } 
loop to perform some "logical debounce magic" on said entries.

However the loop doesn't work as expected at all, and when used the whole 
thing goes crazy and all inputs shift permanently in a completely random way 
that I'm completely unable to understand.

I've come to incriminate the loop logic itself when I noticed that :
- If I set the loop values to process a single value, it still behaves crazy 
for the corresponding input.
- If I remove the loop logic and set "i" manually to any given constant value, 
then the corresponding input is processed appropriately ?!?

i.e.:

(Continue reading)

Anton Staaf | 1 Nov 2009 04:35

PIC18F67J60 compilation trouble

    Hello, I am trying to compile a simple test program for the
PIC18F67J60 using the Ubuntu Karmic version of SDCC.  The version
information is:

SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08
2.9.0 #5416 (Aug 15 2009) (UNIX)

    My test program is:

#include "pic18fregs.h"

int main()
{
    volatile int	count = 0;

    while (1)
	++count;
}

    And my compilation line is:

	sdcc -mpic16 -p18f67j60 -Wl /usr/share/gputils/lkr/18f67j60.lkr
test.c -o test_out

   The resulting compiler error has proved hard to diagnose:

error: invalid processor type (0xb760) in "libdev18f67j60_a-pic18f67j60.o"
gplink: gpprocessor.c:715: gp_processor_rom_width: Assertion `0' failed.

    I've looked at the libdev source for the pic18f67j60 that was
(Continue reading)

Gordon Henderson | 1 Nov 2009 16:50
Favicon

Re: PIC18F67J60 compilation trouble

On Sat, 31 Oct 2009, Anton Staaf wrote:

>    Hello, I am trying to compile a simple test program for the
> PIC18F67J60 using the Ubuntu Karmic version of SDCC.  The version
> information is:
>
> SDCC : mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08
> 2.9.0 #5416 (Aug 15 2009) (UNIX)
>
>    My test program is:
>
> #include "pic18fregs.h"
>
> int main()
> {
>    volatile int	count = 0;
>
>    while (1)
> 	++count;
> }
>
>    And my compilation line is:
>
> 	sdcc -mpic16 -p18f67j60 -Wl /usr/share/gputils/lkr/18f67j60.lkr
> test.c -o test_out
>
>   The resulting compiler error has proved hard to diagnose:
>
> error: invalid processor type (0xb760) in "libdev18f67j60_a-pic18f67j60.o"
> gplink: gpprocessor.c:715: gp_processor_rom_width: Assertion `0' failed.
(Continue reading)

Michel Bouissou | 1 Nov 2009 18:19

Re: PIC18F67J60 compilation trouble

Le dimanche 1 novembre 2009, Anton Staaf a écrit :
> error: invalid processor type (0xb760) in "libdev18f67j60_a-pic18f67j60.o"
> gplink: gpprocessor.c:715: gp_processor_rom_width: Assertion `0' failed.

With the 1st programs I started for PIC using sdcc in piklab, I had hard times 
with such messages until I discovered that I needed to start my prog with:

#define __16F886
#include <pic16f886.h>

(When creating initial source code, piklab was suggesting the "include", but 
missing the "define").

If I create a blank project for your processor model in piklab, it suggests
#include <pic18f67j60.h>
(and that file actually exists in /usr/share/sdcc/include/pic16/ )

As it's missing from the source code you gave, you should for sure give it a 
shot, and possibly try a "define", even though I'm unsure if it's necessary or 
not with your PIC model.

--

-- 
Michel Bouissou (OpenPGP ID 0xEB04D09C)

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
(Continue reading)

Michel Bouissou | 1 Nov 2009 18:32

sdcc and PIC18F2550 ?

Hi,

As my current project is slowly growing bigger than the memory in my 
PIC16F886, I'm considering moving it onto a PIC18F2550.

Does anybody here have good or bad feedback using the PIC18F2550 with sdcc ?

I see from its datasheet that it has a richest instructions set than the 16F 
family, supposedly more efficient for C compilers.

Furthermore, it has an "extended instructions set" that must be enabled thru 
the config register, and that is supposedly "yet even more C-complier 
friendly". Does sdcc make use of these instructions ? Should the extended 
instructions be enabled for use with sdcc ?

TIA, kind regards.

--

-- 
Michel Bouissou (OpenPGP ID 0xEB04D09C)

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
George M. Gallant, Jr. | 1 Nov 2009 19:28
Picon

Re: The damned loop from hell

I have

 SDCC :  ms51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08
2.9.0 #5416 (Oct  6 2009) (UNIX)

installed and am unable to replicate your problem. I wrote a Makefile to
compile from the command line. Did not generate a hex as I do have you
CPU chip.

George

On Sun, 2009-11-01 at 14:50 +0100, Michel Bouissou wrote:
> Hi guys,
> 
> I fell on a problem on which I just spent a day and a half, plus a whole 
> night, with no clue :-(
> 
> At this step, as every poor programmer would, I think "this is probably a 
> compiler issue, otherwise my brain is dead", so it's quite ashamed that I 
> submit this here...
> 
> I have a function called SubReadInputs() that does something complex yet 
> simple ;-) :
> 
> 1/ It first "statically" fills an array/structure of 12 entries by copying ports 
> inputs into it.
> 
> 2/ It then processes the array using a for (i=0; i<=11; i++) { ...blah... } 
> loop to perform some "logical debounce magic" on said entries.
> 
(Continue reading)

George M. Gallant, Jr. | 1 Nov 2009 19:34
Picon

Re: sdcc and PIC18F2550 ?

Michel,

PIC18F2550 if a nice step up. PIC24F or dsPIC33 is even a nicer. Similar
cost & pinout. 16 bit instructions with linear data space. These parts
are 3.3V with limited tolerance for 5.0V I/O. Some also have user
configuration pinout, 

George

On Sun, 2009-11-01 at 18:32 +0100, Michel Bouissou wrote:
> Hi,
> 
> As my current project is slowly growing bigger than the memory in my 
> PIC16F886, I'm considering moving it onto a PIC18F2550.
> 
> Does anybody here have good or bad feedback using the PIC18F2550 with sdcc ?
> 
> I see from its datasheet that it has a richest instructions set than the 16F 
> family, supposedly more efficient for C compilers.
> 
> Furthermore, it has an "extended instructions set" that must be enabled thru 
> the config register, and that is supposedly "yet even more C-complier 
> friendly". Does sdcc make use of these instructions ? Should the extended 
> instructions be enabled for use with sdcc ?
> 
> TIA, kind regards.
> 

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
(Continue reading)

Michel Bouissou | 1 Nov 2009 19:40

Re: The damned loop from hell

HI George, and many thanks for the time you spent on this :-)

Le dimanche 1 novembre 2009, George M. Gallant, Jr. a écrit :
> 
>  SDCC :  ms51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08
> 2.9.0 #5416 (Oct  6 2009) (UNIX)

Mine is from latest Ubuntu Karmic packages and displays: 2.9.0 #5416 (Aug 15 
2009), so same version number but older date...

> installed and am unable to replicate your problem. I wrote a Makefile to
> compile from the command line. Did not generate a hex as I do have you
> CPU chip.

Hmm... well, if you were able to compile it, I'm able too... But that's the 
actual running of this part of this program that shows completely erratic on 
my system (i.e. reacting as if the same input was changing state all the time 
in a random way when I know for sure it isn't... and not reacting to actual 
state changes...).

If the for(...) loop is there, the program's behaviour is completely erratic, 
if I remove the loop and manually set the "i" value to any possible value that 
"i" should be able to take, then that part of the program processes the 
corresponding entry perfectly well.

I supposed there might be either something wrong in my code (although I spent 
2 days and a night checking it...) or something weird in the way sdcc 
translates this part of the code into assembler and that could be visible in 
the assembly code for sdcc specialists or developpers... But well, yes, it 
compiles, it just runs plain wrong :-(
(Continue reading)

Vaclav Peroutka | 1 Nov 2009 19:47
Picon
Favicon

Re: sdcc and PIC18F2550 ?


> Hi,
> 
> As my current project is slowly growing bigger than the memory in my 
> PIC16F886, I'm considering moving it onto a PIC18F2550.
> 
> Does anybody here have good or bad feedback using the PIC18F2550 with sdcc ?
> 
> I see from its datasheet that it has a richest instructions set than the 16F 
> family, supposedly more efficient for C compilers.
> 
> Furthermore, it has an "extended instructions set" that must be enabled thru 
> the config register, and that is supposedly "yet even more C-complier 
> friendly". Does sdcc make use of these instructions ? Should the extended 
> instructions be enabled for use with sdcc ?
> 
> TIA, kind regards.
> 

Hi Michel,

I used SDCC for 18F2455/4550 and USB stack by Alex Enzmann without problem (after I found working linker
script version). I used SDCC for 18F2480 and for some CAN communication. I wrote some test code for LAN
controller ENC28J60 - and it worked as well. So I can recommend sdcc for 18F family. The code generated is a
little bit bigger than ouput from other compilers but compiler is not buggy. And if you find some problem,
community here ( Raphael, are you still here ? ) helps as much as possible.

Best Regards,
Vasek

(Continue reading)


Gmane