Thnaks for the fast answer!

I fill really stupid now...

As an extra check I tried to reproduce the problem in order to confirm the behaviour of the 3 versions of gputils I reported and I could not reproduce the problem on squeeze.

I still can produce wrong hex files on a standard debian lenny, but not on standard squeeze.

On standard lenny installation the compilation ends with no errors/warnings, but when I try to burn the generated hex I get:
...
pulser_1.hex:49:invalid address 0x2008, possibly not hex file for correct pic type?
...

On squeeze (gputils v 0.13.7 beta) I get quite different hex files (compared to the one with gputils v 0.13.4) but they burn and run properly.

I really can not understand what I did different last time I tried (unfortunately I did not keep a log of what I did exactly).

I am really sorry for having reported this as a bug...

Just in case I am still missing something I attach here the source of the simple program and two generated hex files.

Luca

On Mon, 15 Aug 2011, Taisuke Yamada wrote:

Hi. Thanks for reporting. I also checked out your report on gputils site.

So you're saying

- gputils-0.13.4 works
- gputils-0.13.5 generates totally different hex, and won't work
- gputils-0.13.7 generates similar hex to 0.13.4, but still won't work

right? Could you provide me the problematic C source code so I can
verify the issue?

Package: gputils
Version: 0.13.7-1

Hi,
I am facing problems compiling c code for pic16f88 since years.
In the beginning I was using an old debian 4.0 32bit system and with sdcc I
was able to get good .hex files.
When I moved to debian 5.0 64bit the .hex generated (still with sdcc) were
broken and my programmer refused to burn them to the pic. The same happens
now with debian 6.0 64bit.

First I thought that the problem was in sdcc, but from hints by sdcc guy and
the last tests I did, I verified the same intermediate .asm files on both
systems (the working one and the non-workgin one) mentioned above (except
some commented lines).

Trying to track the problem I think I found something: on my new debian 6.0
64bit system I can get the correct .hex if I use gputils-0.13.4 compiled
from source.
If I use gputils-0.13.5 compiled from source I get .hex files messed up a
lot.
If I use gputils-0.13.7 compiled from source I get .hex files quite similar
to the ones generated by gputils-0.13.4, but with few lines different, and
they do not work.

I also wrote to gputils bug tracking system almost one month ago, but I
suspect that nobody is taking care of that bugs submissions.

If you need further informations just ask.

Ciao,
       Luca


      .-------------------------------------.
 -=<(§  Luca <morpheus AT ferrara.linux.it>  §)>=-
      °-------------------------------------°


       .-------------------------------------.
  -=<(§  Luca <morpheus AT ferrara.linux.it>  §)>=-
       °-------------------------------------°
/*
# pulser_1.c  [pic16f88]
# (C) Luca Barion
# Simple pulser for pic16f88
#
# Last update: 30/11/2010
#
### Pinout ###
#
# PIC       Connections
#  1 RA2   
#  2 RA3   
#  3 RA4   
#  4 RA5   
#  5 Vss   -
#  6 RB0   
#  7 RB1   
#  8 RB2   RX data
#  9 RB3   
# 10 RB4   
# 11 RB5   TX data
# 12 RB6   
# 13 RB7   
# 14 Vdd   +
# 15 RA6   
# 16 RA7   
# 17 RA0   
# 18 RA1   
#
#
*/

#define __16f88

// connections
#define OUT0 RB3
#define OUT0_TRIS TRISB3

#include "pic/pic16f88.h"
#include <stdio.h>
#include <stdlib.h>

/* Setup chip configuration pagina 130 */
typedef unsigned int config_word;
config_word at 0x2007 __CONFIG =
  _CP_ALL &
  _CCP1_RB0 &
  _DEBUG_OFF &
  _CPD_OFF &
  _LVP_OFF &
  _BODEN_OFF &
  _MCLR_ON &
  _PWRTE_ON &
  _WDT_OFF &
  _INTRC_IO
  ;

void msDelay(int ms);


void main(void)
{
 // I/O setup (1=input 0=output)
 NOT_RBPU=1;
 PORTB=0;
 PORTA=0;
 OUT0_TRIS=0;
 OSCCON |= 0x60; //(0110 0000) Clock to 4 MHz

 while ( 1 )
 {
  OUT0 = 0;
  OUT0 = 0;
  OUT0 = 0;
  OUT0 = 0;
  OUT0 = 0;
  OUT0 = 1;
  msDelay(10);
 }

}


 ///////////////////
/**** Functions ****/
 ///////////////////


void msDelay(int ms) // 0.001 s
{
 int a,b;
 for (a=0;a<ms;a++) {for(b=0;b<89;b++);}
}



unsigned int leggi_ad(unsigned char channel)
{
 unsigned int x;
 ADCON0 = 0xC1; // 11000001 (00000000) Accende ADC
// if (channel==0) ADCON0 = 0xC1; // 11000001 (00000000) Inizia conversione canale0
// if (channel==1) ADCON0 = 0xC9; // 11001001 (00000000) Inizia conversione canale1
// msDelay(20);
 if (channel==0) ADCON0 = 0xC1; // 11000001 (00000000) canale0
 if (channel==1) ADCON0 = 0xC9; // 11001001 (00000000) canale1
 if (channel==2) ADCON0 = 0xD1; // 11010001 (00000000) canale2
 msDelay(10);
 GO=1;
 while (NOT_DONE);
 ADCON0 = 0xC0; // 11000000 (00000000) Spegne ADC
 x=ADRESH;
 x<<=8;
 x+=ADRESL;
 return x;
}

:020000040000FA
:0800000000008A110A12052814
:06000A005E30FE00013033
:10001000FF0080308A110A123D218A110A128312D0
:100020000313A1007F08A0006030A2000130A300EC
:10003000831203132008A4002108A500FF30A007A5
:10004000031CA10324082504031995280430220762
:10005000A400A501A50D2308A5072408FE00250876
:10006000FF0080308A110A123D218A110A12831280
:100070000313A7007F08A6002208FE002308FF0044
:1000800080308A110A123D218A110A128312031349
:10009000A900A5007F08A800A40002302207A40040
:1000A000A501A50D2308A5072408FE002508FF00CB
:1000B00080308A110A123D218A110A128312031319
:1000C000A500AB007F08A400AA0083120313260832
:1000D000AA002708AB00FF30A607031CA7032A08C5
:1000E0002B0403198E282808FE002908FF00803001
:1000F0008A110A122A218A110A1283120313AA00F2
:10010000240884008313251883172A088000A80A6E
:100110000319A90AA40A0319A50A6528063083123F
:100120000313A2070318A30A18288A110A12992890
:1001300008008316031381178312031386018501B8
:1001400083160313861160308F0483120313861104
:10015000861186118611861186150A30FF0000303F
:100160008A110A1201218A110A12A5280800831295
:100170000313B200C130831203139F0083120313D1
:100180003208031DC728C130831203139F00831256
:1001900003133208013A031DD128C9308312031317
:1001A0009F00831203133208023A031DDB28D1306B
:1001B000831203139F000A30FF00003001218312D5
:1001C00003131F15831203131F19E228C0309F0069
:1001D0001E0883120313B200B3013208B300B20148
:1001E000831603131E0883120313B400B5013408E9
:1001F000B20700300318350FB3073208FF00330889
:10020000080083120313AD007F08AC00AE01AF01FC
:10021000831203132F08803EB0002D08803E300269
:10022000031D14292C082E02031829295930831282
:100230000313B000B101FF3083120313B007031C96
:10024000B10330083104031D1B29AE0A0319AF0A9C
:1002500008290800003A03193129803A031938297E
:1002600000347E08840083137F1883170008080079
:100270007F088A007E0882000800003A0319452999
:10028000803A03194F29FF0100347E08840083134C
:100290007F1883170008FF00840A000808008A11ED
:1002A0000A123821FD00FE0FFF03FF0A8A110A120D
:1002B0003821FC007D08FF007C0808000134003470
:0E02C000663401343634003401340034003426
:02400E00301F61
:04401000FC3FFFFF73
:00000001FF
:020000040000FA
:1000000000008A1103285A30FE000130FF008030C2
:100010008A11000039218A11000083120313A10004
:100020007F08A0005C30A2000130A30083120313FC
:100030002008A4002108A500FF30A007031CA1038D
:10004000240825040319932804302207A400A501DD
:10005000A50D2308A5072408FE002508FF00803011
:100060008A11000039218A11000083120313A700AE
:100070007F08A6002208FE002308FF0080308A11B6
:10008000000039218A11000083120313A900A50082
:100090007F08A800A40002302207A400A501A50D36
:1000A0002308A5072408FE002508FF0080308A11D8
:1000B000000039218A11000083120313A500AB0050
:1000C0007F08A400AA00831203132608AA002708A9
:1000D000AB00FF30A607031CA7032A082B04031953
:1000E0008C282808FE002908FF0080308A110000B3
:1000F00026218A11000083120313AA002408840019
:100100008313251883172A088000A80A0319A90A4F
:10011000A40A0319A50A6328063083120313A20751
:100120000318A30A16288A110000972808008316CE
:1001300003138117831203138601850183160313AA
:10014000861160308F048312031386118611861185
:100150008611861186150A30FF0000308A11FD20B5
:100160008A11A328080083120313B200C13083123E
:1001700003139F00831203133208031DC328C130E9
:10018000831203139F00831203133208013A031DE5
:10019000CD28C930831203139F0083120313320842
:1001A000023A031DD728D130831203139F000A306F
:1001B000FF000030FD20831203131F158312031369
:1001C0001F19DE28C0309F001E0883120313B200DF
:1001D000B3013208B300B201831603131E08831261
:1001E0000313B400B5013408B20700300318350F0B
:1001F000B3073208FF003308080083120313AD0071
:100200007F08AC00AE01AF01831203132F08803EBC
:10021000B0002D08803E3002031D10292C082E024C
:1002200003182529593083120313B000B101FF30A0
:1002300083120313B007031CB10330083104031DFC
:100240001729AE0A0319AF0A04290800003A031956
:100250002D29803A0319342900347E088400831341
:100260007F188317000808007F088A007E08820034
:100270000800003A03194129803A03194B29FF016C
:1002800000347E08840083137F1883170008FF0062
:10029000840A000808008A1100003421FD00FE0FC6
:1002A000FF03FF0A8A1100003421FC007D08FF00D3
:1002B0007C080800013400346234013436340034E0
:0602C0000134003400349B
:02400E00301F61
:02401000FC3F73
:00000001FF
:020000040000FA
:0600000000008A11052832
:06000A005C30FE00013035
:10001000FF0080308A1100003B218A11000083120A
:100020000313A1007F08A0005E30A2000130A300EE
:10003000831203132008A4002108A500FF30A007A5
:10004000031CA10324082504031995280430220762
:10005000A400A501A50D2308A5072408FE00250876
:10006000FF0080308A1100003B218A1100008312BA
:100070000313A7007F08A6002208FE002308FF0044
:1000800080308A1100003B218A1100008312031383
:10009000A900A5007F08A800A40002302207A40040
:1000A000A501A50D2308A5072408FE002508FF00CB
:1000B00080308A1100003B218A1100008312031353
:1000C000A500AB007F08A400AA0083120313260832
:1000D000AA002708AB00FF30A607031CA7032A08C5
:1000E0002B0403198E282808FE002908FF00803001
:1000F0008A11000028218A11000083120313AA002C
:10010000240884008313251883172A088000A80A6E
:100110000319A90AA40A0319A50A6528063083123F
:100120000313A2070318A30A18288A1100009928AC
:1001300008008316031381178312031386018501B8
:1001400083160313861160308F0483120313861104
:10015000861186118611861186150A30FF0000303F
:100160008A11FF208A11A528080083120313B20008
:10017000C130831203139F00831203133208031D3F
:10018000C528C130831203139F0083120313320862
:10019000013A031DCF28C930831203139F00831235
:1001A00003133208023A031DD928D13083120313F6
:1001B0009F000A30FF000030FF20831203131F1539
:1001C000831203131F19E028C0309F001E088312FA
:1001D0000313B200B3013208B300B2018316031354
:1001E0001E0883120313B400B5013408B2070030AF
:1001F0000318350FB3073208FF00330808008312D5
:100200000313AD007F08AC00AE01AF0183120313EE
:100210002F08803EB0002D08803E3002031D1229B9
:100220002C082E0203182729593083120313B0001B
:10023000B101FF3083120313B007031CB103300870
:100240003104031D1929AE0A0319AF0A0629080053
:10025000003A03192F29803A0319362900347E0801
:10026000840083137F188317000808007F088A0022
:100270007E0882000800003A03194329803A0319D6
:100280004D29FF0100347E08840083137F188317F3
:100290000008FF00840A000808008A1100003621C7
:1002A000FD00FE0FFF03FF0A8A1100003621FC004B
:1002B0007D08FF007C0808000134003464340134F8
:0A02C00036340034013400340034F9
:02400E00301F61
:00000001FF

Reply via email to