Re: [Sdcc-user] pointer target lost const qualifier -warning

2017-07-28 Thread Kustaa Nyholm
> On 21 Jul 2017, at 23:07, Raphael Neider wrote: > > Could you post all relevant build output - with verbose enabled to see the > files being linked? > If the error occurs during compilation - could you provide the .asm file? > (sdcc with -S and -o foo.asm could do the trick)? > Below is th

Re: [Sdcc-user] pointer target lost const qualifier -warning

2017-07-28 Thread Kustaa Nyholm
> On 21 Jul 2017, at 23:07, Raphael Neider wrote: > > Regarding the second issue: Do you link main.o twice by any chance? Maybe by > compiling main.c once as part of the sources and again to trigger linking > with all .o files including main.o? > Could you post all relevant build output - with

Re: [Sdcc-user] pointer target lost const qualifier -warning

2017-07-28 Thread Kustaa Nyholm
> On 21 Jul 2017, at 23:07, Raphael Neider wrote: > > You could try copying the library function to your project and adjust the > arguments (and s) just to see if it helps? > Hi, I copypasted the def from your mail to my main.c where that function is used and changed the name to memcpypg

[Sdcc-user] warning: Relocation symbol "_cinit" [0x000000] has no section. (pass 0)

2017-07-21 Thread Kustaa Nyholm
When linking my code I get this (same line seven times): warning: Relocation symbol "_cinit" [0x00] has no section. (pass 0) warning: Relocation symbol "_cinit" [0x04] has no section. (pass 0) warning: Relocation symbol "_cinit" [0x08] has no section. (pass 0) warning: Relocation symbo

[Sdcc-user] pointer target lost const qualifier -warning

2017-07-21 Thread Kustaa Nyholm
I'm runnin sdcc 3.4.0 and targeting PIC18F45K50 I get this warning: main.c:670: warning 196: pointer target lost const qualifier from this: memcpypgm2ram(&hid_tx_buffer.uint8[0],get_toad4_config(),63); with these defs: __code void* get_toad4_config(); volatile hid_buffer_t hid_tx_buffer; t

[Sdcc-user] ADCON0bits.CHS missing from pic18f45k50.h

2017-07-13 Thread Kustaa Nyholm
Hi, ADCON0bits struct def seems to miss CHS bit field which is available for 18F4550 in pic18f4550.h Also CHS0..CHS3 are missing. Further pic18f4550.h defines GO_NOT_DONE, GO, NOT_DONE and DONE fields for ADCON0, last of which seems wrong because the bit meaning is "go/not done" so DONE does

Re: [Sdcc-user] Can't link a simple example using PIC16 with SDCC : ASlink no definition of area errors

2016-12-15 Thread Kustaa Nyholm
Sorry don't have time to look at this, but on this page you find my project complete with Makefile that should compile out of the box with SDCC so if you look at the Makefile it might help you. http://www.sparetimelabs.com/usbcdcacm/usbcdcacm.php Below is the relevant part from that Makefile. ch

Re: [Sdcc-user] Bug in 'removed redundant BANKSEL' ?

2016-09-06 Thread Kustaa Nyholm
> On 7 Sep 2016, at 00:24, Raphael Neider wrote: > > Hi, > > I have now created the ticket: https://sourceforge.net/p/sdcc/bugs/2543/ > > I'm currently trying to get (regression) tests for pic16 running with gpsim, > but setup, execution, assertions, ... seem to not work for me :-(. Needs --

Re: [Sdcc-user] Bug in 'removed redundant BANKSEL' ?

2016-09-04 Thread Kustaa Nyholm
>Please create a bug ticket in http://sourceforge.net/p/sdcc/bugs/, and attach >your patch. > >Thanks. Was the ticket created? wbr Kusti -- ___ Sdcc-user mailing list Sdcc

Re: [Sdcc-user] Compiling SDCC from source on Mac OS ... instructions anyone?

2016-08-30 Thread Kustaa Nyholm
> On 30 Aug 2016, at 18:11, Kustaa Nyholm > wrote: > > Hi, > > I tried to compile gutils 1.5.0 and sdcc 3.6.0 from source. > > Assertion failed: (gp_archive_have_index(Archive)), function > gp_archive_read_index, file gparchive.c, line 598. > But if I use

Re: [Sdcc-user] Bug in 'removed redundant BANKSEL' ?

2016-08-30 Thread Kustaa Nyholm
>I believe I have a fix for all issues you reported: I can report that I'm now able to build from source and test this and initial impression is that this fixes the issue, still need to put back my original and see that it works alright in this situation and that I don't see regression anywhere e

[Sdcc-user] Compiling SDCC from source on Mac OS ... instructions anyone?

2016-08-30 Thread Kustaa Nyholm
Hi, I tried to compile gutils 1.5.0 and sdcc 3.6.0 from source. Downloaded them and compiled/installed gputils like this: cd ~/gputils ./configure make make install No errors reported and looks like everything is ok. Then installed boost from homebrew with: brew install boost and compiled s

Re: [Sdcc-user] Bug in 'removed redundant BANKSEL' ?

2016-08-29 Thread Kustaa Nyholm
k it in around 23:00 CEST today. Good night, Raphael 2016-08-29 15:33 GMT+02:00 Kustaa Nyholm : Here is a minimal self contained test case that produces the problem: //-- typedef struct { char member; } test_type; extern test_type g_test1[]; exte

Re: [Sdcc-user] Bug in 'removed redundant BANKSEL' ?

2016-08-29 Thread Kustaa Nyholm
Here is a minimal self contained test case that produces the problem: //-- typedef struct { char member; } test_type; extern test_type g_test1[]; extern test_type g_test2; void foobar() { g_test2.member = g_test1[0].member; g_test2

Re: [Sdcc-user] Bug in 'removed redundant BANKSEL' ?

2016-08-29 Thread Kustaa Nyholm
nderstand that you probably need the structures to be volatile, so this would only help analyse the issue, not fix it. Best regards, Raphael On Aug 29, 2016 9:22 AM, "Kustaa Nyholm" mailto:kustaa.nyh...@planmeca.com>> wrote: Hi, spent a better part of the evening

[Sdcc-user] Bug in 'removed redundant BANKSEL' ?

2016-08-29 Thread Kustaa Nyholm
Hi, spent a better part of the evening trying to figure out why my code does not work. In the early hours of the morning I came up with this test code (in "main.c"): void testxxx() { hid_tx_buffer.uint8[33] = g_stepper_state[1].position.uint8[1]; hid_tx_buffer.uint8[34] = g_step

[Sdcc-user] PIC compilation weirdness

2016-08-28 Thread Kustaa Nyholm
Hi, I've got this statement in main.c: // hid_tx_buffer.uint8[35] = g_stepper_state[0].position.uint8[3]; // and it compiles to: // DA C??? F??? 00630 MOVFF (_g_s

Re: [Sdcc-user] Using SDCC with Linux to program the Silicon Labs EFM8

2016-08-09 Thread Kustaa Nyholm
> >If former, you should contact Silicon Labs or ask in their forum, most chip >manufactures are very supportive IME. > >wbr Kusti I meant to write, of course, " if later" ... This e-mail may contain confidential or privileged information. If you are not the intended recipient (or have receive

Re: [Sdcc-user] Using SDCC with Linux to program the Silicon Labs EFM8

2016-08-09 Thread Kustaa Nyholm
On 09/08/2016 19:48, "Benjamin Larsson" wrote: >Simplicity Studio does not support C2 programmers under linux. At least >I was not able to get it working. Which? Does not support (as per some documentation) or you did not get it to work (although it looks like it should)? If former, you shoul

Re: [Sdcc-user] Using static inline function with assembly labels in SDCC (8051)

2016-07-04 Thread Kustaa Nyholm
> If I replace the labels to 0001$ , then the errors dont exist anymore. Is > there any other way to use inline assembly with labels? What's wrong with 0001$ ? From SDCC manual: 3.11.4 Use of Labels within Inline Assembler SDCC allows the use of in-line assembler with a few restrictions rega

Re: [Sdcc-user] New user / header files / optimisations STM8

2016-04-19 Thread Kustaa Nyholm
>The compiler can still do computations using the max >precision fp type it has Perhaps, but depending on the hypothetical libraries and hypothetical algorithms and rounding rules computing at max precisions might not produce exactly same results. Don't know for sure as I'm no expert on the intr

Re: [Sdcc-user] New user / header files / optimisations STM8

2016-04-19 Thread Kustaa Nyholm
>perhaps there is some technical or >historical precedent for this? Most likely just a matter of priority. However, just a few days ago we discussed various floating point formats and one of them was to leave the actual computations to the FP library, which would make it hard for the compiler to

Re: [Sdcc-user] A floating-point type cheaper than float

2016-04-13 Thread Kustaa Nyholm
> >It would be nice if you can confirm this, especially the actual >16-bit float format used. If the elements of the float are not >byte-aligned, then did you pack and unpack the bit fields for each >operation? What operations did you implement? Are you talking about my densitometer project? This

Re: [Sdcc-user] A floating-point type cheaper than float

2016-04-12 Thread Kustaa Nyholm
> >How about this: Given a choice between a 24-bit float format >that's made simple for 8-bit MCUs (e.g. add back the first missing >bit-1), and 16-bit standards-based half float (though the main >users are GPUs), which one would you prefer to use? That is a though one! In general I tend to alway

Re: [Sdcc-user] A floating-point type cheaper than float

2016-04-12 Thread Kustaa Nyholm
On 13/04/2016 05:07, "KHMan" wrote: >bit MCU program that uses 16 bit floats, or >something very close in spirit... I posted this before: http://www.sparetimelabs.com/densitometer/densitometer.php That is a story of a densitometer (film optical density measurement device) that was implemented

Re: [Sdcc-user] A floating-point type cheaper than float

2016-04-11 Thread Kustaa Nyholm
On 12/04/2016 05:45, "KHMan" wrote: >Hard to imagine an 8-bit project >that truly need half floats. Some years ago I did an 8-bit project where I deemed that writing a floating point package in assembly was the *easiest* way to do it: http://www.sparetimelabs.com/densitometer/densitometer.

Re: [Sdcc-user] Should malloc() and friends be reentrent?

2015-10-06 Thread Kustaa Nyholm
>> We are planning to replace SDCC'c current two memory allocators by a new >> one. In one of the curent two (used in mcs51, ds390, hc08) malloc() and >> friends code is in a critical section, in the other, it is not. I've never used malloc and not se my going to use it in interrupt so personally

Re: [Sdcc-user] Sourceforge alternative?

2015-08-08 Thread Kustaa Nyholm
> With sourceforge's impending demise, are there any plans to move sdcc > development, mailing lists and release downloads to a new host? It > just took me 15 minutes to get a working download link for 3.5.0… I’ve got a couple projects in github and like it. br Kusti This e-mail may contain co

Re: [Sdcc-user] Issue with 32 bit assignment in interrupt?

2015-05-13 Thread Kustaa Nyholm
>I am not familiar with the pic16 port, if you really think it is a bug, please >create a ticket on http://sourceforge.net/p/sdcc/bugs/ Well, I'm not ready to call this a bug in the compiler. I also now realise that there are a lot of other places in the interrupt that use those same temp variab

[Sdcc-user] Issue with 32 bit assignment in interrupt?

2015-05-13 Thread Kustaa Nyholm
Hi, I've been tracking a wierd problem, 100% repeatable although the failures vary. I'm using: /Users/nyholku/sdcc-3.4.0/bin/sdcc -v SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ds390/pic16/pic14/TININative/ds400/hc0 8/s08/stm8 3.4.0 #8981 (Apr 5 2014) (Mac OS X i386) published under GNU Genera

Re: [Sdcc-user] CONFIG in PIC18F4550

2015-05-08 Thread Kustaa Nyholm
> Since every protection (code, eeprom, etc) seems to be disabled, why don't > you ask your user to read back what he programs so you can compare? Right, that is good idea, the only thing is I have to first learn to do that to be able talk him through. But I do have PICKit3 and MPLAB so should n

Re: [Sdcc-user] CONFIG in PIC18F4550

2015-05-07 Thread Kustaa Nyholm
On 08/05/2015 08:58, "KHMan" wrote: >Has that been >ruled out? Good point! No it hasn't ... hmmm ... maybe the easiest way to rule that out would be for me to just mail him a chip that works for me. Would also eliminate any doubt about the software. br Kusti This e-mail may contain confiden

[Sdcc-user] CONFIG in PIC18F4550

2015-05-07 Thread Kustaa Nyholm
Hi, I've got a weird problem. I have written a firmware: https://github.com/nyholku/TOAD4 I have two versions 1.5.3 and 1.5.5 which both work fine for me. For one user the version 1.5.5 shows very strange symptoms. This is 100% repeatable, he program 1.5.3 and everything works, he programs 1

[Sdcc-user] (0x300000) is absolute but occurs in more than one file

2015-03-20 Thread Kustaa Nyholm
I was trying to compile a project that compiled cleanly last time I tried (with SDCC 3.2.0), meanwhile I've upgraded to 3.4.0: ~/sdcc-3.4.0/bin/sdcc -v SDCC : mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ds390/pic16/pic14/TININative/ds400/hc0 8/s08/stm8 3.4.0 #8981 (Apr 5 2014) (Mac OS X i386) published

Re: [Sdcc-user] Optimizing code for PIC18F

2015-02-18 Thread Kustaa Nyholm
On 17/02/2015 16:13, "Philipp Klaus Krause" wrote: >One can still manually run the regression tests for pic16 ("make >test-pic16" in sdcc/support/regression). I tried that (after succesfully configure:ing and compiling sdcc 3.4.0) but somethings not right: make test-pic16 Running pic16 regress

[Sdcc-user] PIC16 port asm listing line numbers do not match

2015-02-17 Thread Kustaa Nyholm
Hi, it looks to me that the source code line numbers in the .asm file for PIC16 port do match. Lines are missing and the code generated does not correspond to the referred to lines. Is this a known issue? Any workarounds? Worth reporting as bug? br Kusti Below is an example, starting from C-s

Re: [Sdcc-user] Message[1301] Using default destination of 0 (Access Bank)

2015-02-17 Thread Kustaa Nyholm
rnings and would like to know what >they are about. Should one be explicit about the banks or something. Is >it so that this thread should go to the gputils mailing lists? > >/ >Tomas > >On Sun, Feb 08, 2015 at 04:45:00PM +0200, Kustaa Nyholm wrote: >> Now I'm get

Re: [Sdcc-user] Optimizing code for PIC18F

2015-02-17 Thread Kustaa Nyholm
On 17/02/2015 15:43, "Philipp Klaus Krause" wrote: > >Looks like inline is broken on pic16. Please file a bug report. Done: #2356 'inline' broken on pic16 port > tested in the nighly regressio tests (which are not done for the pic >ports). Why is that, some tests not working? What is the probl

Re: [Sdcc-user] Optimizing code for PIC18F

2015-02-16 Thread Kustaa Nyholm
On 17/02/2015 06:54, "Kustaa Nyholm" wrote: > >Ok, gpasm choked (will investigate that later) > >+ gpasm -DSTACK_MODEL_SMALL -D__STACK_MODEL_SMALL -o ../obj/testc2asm.o -c >../obj/testc2asm.asm returned errorcode 256 Hmm some quick notes. Even a short functio

Re: [Sdcc-user] Optimizing code for PIC18F

2015-02-16 Thread Kustaa Nyholm
On 17/02/2015 06:35, "Kustaa Nyholm" wrote: >On 17/02/2015 00:42, "Philipp Klaus Krause" wrote: > >>Actually (with some exceptions in std lib functions), sdcc doesn't do >>anything fancy about inlining at all: we inline exactly the functions >>

Re: [Sdcc-user] Optimizing code for PIC18F

2015-02-16 Thread Kustaa Nyholm
On 17/02/2015 00:42, "Philipp Klaus Krause" wrote: >Actually (with some exceptions in std lib functions), sdcc doesn't do >anything fancy about inlining at all: we inline exactly the functions >declared inline. > > Hmmm, I missed that in the manual, we can actually do inline? Must try that next

[Sdcc-user] Optimizing code for PIC18F

2015-02-16 Thread Kustaa Nyholm
Hi, I'm optimising my code, mainly for size. Knowing how much better code SDCC creates for global variables I made an interesting comparison which I thought I share here, see code below. Interestingly the code (bar4) that four times expands the whole 'get position' calculation is smaller (585 <

Re: [Sdcc-user] Symbol not previously defined: "_g_toad4_status"for static volatile toad4_status_t g_toad4_status;

2015-02-08 Thread Kustaa Nyholm
On 08/02/2015 17:13, "Philipp Klaus Krause" wrote: > >This looks like an error mesage from the assembler, not the compiler. >Did you also upgrade gputils? > >Philipp I did not but I did that not so long ago: nyholkus-MacBook-Pro:src nyholku$ gpasm -v gpasm-1.4.0 #1107 (Oct 28 2014) This e-ma

[Sdcc-user] Symbol not previously defined: "_g_toad4_status" for static volatile toad4_status_t g_toad4_status;

2015-02-08 Thread Kustaa Nyholm
With sdcc 3.4.0 I get ../obj/main.asm:17:Error[113] Symbol not previously defined: "_g_toad4_status" for this in my source code: volatile toad4_status_t g_toad4_status; if I add the word 'static' as in the title of this message, then this compiles ok. 3.2.0 did not choke on this ... is thi

[Sdcc-user] Message[1301] Using default destination of 0 (Access Bank)

2015-02-08 Thread Kustaa Nyholm
Now I'm getting bunch of warnings (see title of this message): I found this: https://sourceforge.net/p/gputils/support-requests/8/ so this is related to gputils/version, right? What is the recommended way of getting rid of this (false) warning? It is false, right? br Kusti This e-mail

Re: [Sdcc-user] SDCC 3.4.0 PIC18 includes

2015-02-08 Thread Kustaa Nyholm
On 08/02/2015 16:07, "Kustaa Nyholm" wrote: >Hi, > > >I just upgraded from 3.2.0 to 3.4.0 and now I get a lot of these >from a project that compiled clean under 3.2.0: > >I can surely figure out the root cause, just checking out if there is >something I sh

[Sdcc-user] SDCC 3.4.0 PIC18 includes

2015-02-08 Thread Kustaa Nyholm
Hi, I just upgraded from 3.2.0 to 3.4.0 and now I get a lot of these from a project that compiled clean under 3.2.0: >make /Users/nyholku/sdcc-3.4.0/bin/sdcc -c --no-crt --ivt-loc=0x800 -V -L /Users/nyholku/sdcc-3.2.0/share/sdcc/non-free/lib/pic16 -Wl,-m,-s18f45k50.lkr -mpic16 -p18f45k50 --disa

[Sdcc-user] ANNOUNCE diolan-plus2 bootloader

2015-01-31 Thread Kustaa Nyholm
Hi, I'm happy to say that now my diolan's bootloader works with standard instructions set and the code compiled with SDCC works with it too! I've published it here as required by the GPL: https://github.com/nyholku/diolan-plus2 thanks for all your help! br Kusti This e-mail may contain con

Re: [Sdcc-user] PIC18 extended instruction set support

2015-01-30 Thread Kustaa Nyholm
On 30/01/2015 16:22, "M L" wrote: >2015-01-30 14:03 GMT+01:00, Kustaa Nyholm : >> First of all, I'm talking about existing code and hardware. >> >> The existing code (without the bootloader) already pretty much >> fills the PIC18F4550. >> >

Re: [Sdcc-user] PIC18 extended instruction set support

2015-01-30 Thread Kustaa Nyholm
On 30/01/2015 14:15, "M L" wrote: >Hi, >I don't really get it, why You trying (so hard) use a bootloader which >won't fit in boot block, so what? >Bootloader can be with any size, just move user code to location >after bootloader (to first free block of flash erase boundary). > >If size of user

Re: [Sdcc-user] Sdcc-user Digest, Vol 103, Issue 14

2015-01-29 Thread Kustaa Nyholm
On 30/01/2015 06:15, "Jesse Lackey" wrote: >Be aware that XC8 doesn't support the extended instruction set... I had >to disable it in the chip config for the compiler to produce output. >Surprising. > > > >This may clarify the choice for you! >J A ke

Re: [Sdcc-user] PIC18 extended instruction set support

2015-01-29 Thread Kustaa Nyholm
sti Hoping to report back soon, Raphael 2015-01-29 21:09 GMT+01:00 Kustaa Nyholm mailto:kustaa.nyh...@planmeca.com>>: Hi, I'm at cross roads, should I go on with SDCC (which I'm happy with and familiar) or move to MPLAB X compilers... The dilemma: I'm planning to use the Di

[Sdcc-user] PIC18 extended instruction set support

2015-01-29 Thread Kustaa Nyholm
Hi, I'm at cross roads, should I go on with SDCC (which I'm happy with and familiar) or move to MPLAB X compilers... The dilemma: I'm planning to use the Diolan bootloader which uses extended instructions set. That bootloader is very nice as it is in asm and fits (just!) into the boot block and

Re: [Sdcc-user] Converting away extended instruction set on PIC18F4550

2015-01-25 Thread Kustaa Nyholm
On 25/01/2015 13:18, "Molnár Károly" wrote: Thanks! I will have a go at these. br Kusti This e-mail may contain confidential or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail.

[Sdcc-user] Converting away extended instruction set on PIC18F4550

2015-01-25 Thread Kustaa Nyholm
In removing extended instructions from the Diolan bootloader I had to change a lot of instructions like: < subfsr FSR2, 3 --- > ;subfsr FSR2, 3 > movf POSTDEC2, W > movf POSTDEC2, W > movf POSTDEC2, W < addfsr FSR2, 4 --- > ;addfsr FSR2, 4 > movf POSTINC2, W > movf POSTINC2, W > movf P

Re: [Sdcc-user] PIC18F4550 Extended instruction set / Re: memcpyram2ram crashes, debug ideas?

2015-01-25 Thread Kustaa Nyholm
On 25/01/2015 11:44, "Molnár Károly" wrote: > >I found something here: >http://dangerousprototypes.com/forum/viewtopic.php?t=3269&p=40918 >(On the following link: >http://dangerousprototypes.com/forum/download/file.php?id=7722&sid=f549638 >b834112dfa1c4ef976c40ec92) >Perhaps might work. > >Károly

Re: [Sdcc-user] PIC18F4550 Extended instruction set / Re: memcpyram2ram crashes, debug ideas?

2015-01-25 Thread Kustaa Nyholm
Blast from the past! Debugging my 'memcpyram2ram problem' (going on for 20 hours now!) I may have found the problem, I've yet to verify this but it looks like my (Diolan's really) USB bootloader enables the extended instruction set and searching the web I came across this interesting exchange bet

Re: [Sdcc-user] memcpyram2ram crashes, debug ideas?

2015-01-24 Thread Kustaa Nyholm
I've now pruned the code to just: #include "PIC-config.c" #include #include // memcpyram2ram #define LED_PIN LATBbits.LATB4 #define LED_TRIS TRISBbits.TRISB4 char buffer[64]; void main(void) { OSCCON = 0x70; LED_TRIS=0; LED_PIN = 0; while (1) { volatile unsigned long i; f

Re: [Sdcc-user] memcpyram2ram crashes, debug ideas?

2015-01-24 Thread Kustaa Nyholm
Replace the memcpyram2ram with spelled out version: { char __data *d = (void*)&hid_tx_buffer; char __data *s = (void*) &g_toad4_status; char acount=64; /* * copy from lower addresses to higher addresses */ while (acount--) { *d++ = *s++; }

Re: [Sdcc-user] memcpyram2ram crashes, debug ideas?

2015-01-24 Thread Kustaa Nyholm
Forgot to say this is on PIC18F4550 This e-mail may contain confidential or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution o

[Sdcc-user] memcpyram2ram crashes, debug ideas?

2015-01-24 Thread Kustaa Nyholm
Hi, Background: I've got a piece of code (USB HID and then some) that works. Now I'm moving this to work with a UBS bootloader that allows me to update the code via USB. The bootloader naturally lives at 0x so I've relocated my code to 0x0800 by including a custom crt0iz.c which locates th

Re: [Sdcc-user] Dropping support for returning expression of type void?

2015-01-17 Thread Kustaa Nyholm
On 17/01/2015 18:51, "Philipp Klaus Krause" wrote: >Currently, when compiling using --std-sdcc89 or --std-sdcc99 (but not >when using --std-c89, --std-c99 or --std-c11), sdcc allows functions >with return type void to return expressions of type void. Example: > >void f1(void); > >void f2(void) >{

Re: [Sdcc-user] Dropping support for omitting integer promotion on arguments of vararg functions

2015-01-17 Thread Kustaa Nyholm
On 17/01/2015 19:03, "Philipp Klaus Krause" wrote: >Currently, when compiling using --std-sdcc89 or --std-sdcc99 (but not >when using --std-c89, --std-c99 or --std-c11), sdcc does not do integer >promotion on explicitly cast arguments to functions with variable >arguments: > >void f1(int, ...); >

Re: [Sdcc-user] Relocating (PIC16) code

2014-12-20 Thread Kustaa Nyholm
On 20/12/2014 22:40, "Kustaa Nyholm" wrote: >Hi, > > >I'm implementing a bootloader that will allow the actual application >code to be updated on the field via USB. > > >As the bootloader code resides in 0x .. 0x0800 I need to relocate >the actual ap

[Sdcc-user] Relocating (PIC16) code

2014-12-20 Thread Kustaa Nyholm
Hi, I'm implementing a bootloader that will allow the actual application code to be updated on the field via USB. As the bootloader code resides in 0x .. 0x0800 I need to relocate the actual application to address 0x0800 along with the interrupt vectors. I'm targeting PIC18F4550 I set my

Re: [Sdcc-user] Changing the default for char from signed char to unsigned char

2014-10-07 Thread Kustaa Nyholm
--- > >Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer >Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports >Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper >Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog

Re: [Sdcc-user] STM8 ascii / extended ascii

2014-10-06 Thread Kustaa Nyholm
> So my question, is , is it worthy to make the assembler ; extended-ascii > aware ? that all :) I don't think it is worth the effort. Even if it was implemented and available I would not use it in my code because sooner or later the code ends up in an other assembler that does not support exte

Re: [Sdcc-user] Optimising a+=b;

2014-06-26 Thread Kustaa Nyholm
Hi, last night I decided to bite the bullet and coded all of my interrupt in assembly which allowed me to rise the interrupt frequency from 60 kHz up to 170 kHz after which it it leaves so few cycles for the anything else that the USB stack stops working. This is fine, as at my target freq of 120

Re: [Sdcc-user] Optimising a+=b;

2014-06-24 Thread Kustaa Nyholm
>I can currently not verify this, but anyways: I think that union's were >and possibly are implicitly >treated as volatile by SDCC and/or the PIC backend(s) due to problems in >maintaining correct >potential alias sets. This might explain the bad code that is generated >for the a+=b operation >

Re: [Sdcc-user] Optimising a+=b;

2014-06-24 Thread Kustaa Nyholm
, CODIE, OW2 and Gartner awards >http://p.sf.net/sfu/Bonitasoft >_______ >Sdcc-user mailing list >Sdcc-user@lists.sourceforge.net >https://lists.sourceforge.net/lists/listinfo/sdcc-user > -- Kustaa Nyholm Research Manager, Software Research

[Sdcc-user] Optimising a+=b;

2014-06-24 Thread Kustaa Nyholm
Hi, its me again ;) Any idea how difficult it would be to add optimisation operators like '+=' and company? Here is a piece of compiled C from my project: ; .line 150; stepperirq.c MOTOR.nco += MOTOR.speed; MOVF (_g + 10), W, B ADDWF (_g + 4), W, B MOVWF r0x00 MOVF (_g + 11), W, B ADDWFC

Re: [Sdcc-user] PIC reducing interrupt overhead

2014-06-24 Thread Kustaa Nyholm
On 24/06/2014 11:59, "Kustaa Nyholm" wrote: > >How about taking advantage of the 'FAST REGISTER STACK' of >PIC16 architecture? Never mind that, I just recalled that in the manual it is called "__shadowregs", sorry about the noise. The extra register saving

[Sdcc-user] PIC reducing interrupt overhead

2014-06-24 Thread Kustaa Nyholm
Hi last night I was optimising my code and I noticed that SDCC generated 'needless' code to save and restore some 'internal' registers. The interrupt servicer routine prologue contains 2A C??? F??? 00368 MOVFF r0x00, POSTDEC1 2E C??? F??? 00369 MOVFF r0x01,

[Sdcc-user] Bug?

2014-06-23 Thread Kustaa Nyholm
Good Morning, I'm pruning some dead wood from my code and so I happened across this this situation: In the .h file I've got: extern volatile stepperState __at( 0x0600 ) steppers[]; and in the .c file: volatile stepperState __at( 0x0600 ) steppers[NUM_OF_MOTORS]; the arrays/variable 'st

Re: [Sdcc-user] PIC forcing variables to be on the same bank

2014-06-22 Thread Kustaa Nyholm
Brilliant, that did the trick! I can work with that as anyway most of the variable are in an array (with compile time knows indexes) of structs anyway so I need to just wrap all variables in in struct. Of course it would be nice and logical if the compiler had understood that the variables are

[Sdcc-user] PIC (18F) re-entrant interrupt

2014-06-22 Thread Kustaa Nyholm
Hi, I need to create a re-entrant interrupt service routine, is the code generated by SDCC for PIC compatible with that? I need to have my interrupt running at about 100 kHz but sometimes there is lengthy processing that runs for several msec and I need to allow the main task of the interrupt to

[Sdcc-user] PIC forcing variables to be on the same bank

2014-06-22 Thread Kustaa Nyholm
Hi I'm trying to optimise a critical section of my code and to get rid of the BANKSEL instructions I would like to place variables on the same bank. I tried: #pragma udata bank2 COUNTER NCO SPEED OLDV char COUNTER; short NCO; short SPEED; short OLDV; ... NCO += SPEED; ... But this compile

Re: [Sdcc-user] PIC variable definitions in header files

2014-06-21 Thread Kustaa Nyholm
>your definition (in the. c file) is missing the __at() keyword including >the address argument. The only difference between > header and implementation file is the extern keyword (and optionally the >initializer, do not use them here, though). Of course, getting late here, time to get some sle

Re: [Sdcc-user] PIC variable definitions in header files

2014-06-21 Thread Kustaa Nyholm
>why not do as the libraries declare and define SFRs? >In the header use >extern __at(0x0400) volatile BDT ep0_o; Ah, of course, I should have looked at the headers thanks, that is exactly what I was looking for! Hmm, spoke too soon, now the linker complains: error: missing definition for symb

Re: [Sdcc-user] PIC variable definitions in header files

2014-06-21 Thread Kustaa Nyholm
On 18/06/2014 16:41, "Maarten Brock" wrote: > >I don't know. I don't work on the pic backend. But try it and you'll find >out soon enough I guess by looking at the generated asm. Maybe I should have tried this first... In the .h I put: extern volatile BDT ep0_o; In the .c that includes above

Re: [Sdcc-user] PIC variable definitions in header files

2014-06-18 Thread Kustaa Nyholm
On 18/06/2014 15:16, "Maarten Brock" wrote: > >When you use __at without initializer however, SDCC does not allocate and >you can define another variable (with __at) at the same address. It will >also not zero the variable at startup. This is probably exactly what you >need for a hardware register

Re: [Sdcc-user] PIC variable definitions in header files

2014-06-18 Thread Kustaa Nyholm
On 18/06/2014 14:48, "Maarten Brock" wrote: >Hello Kusti, > >Though I have no problem with your proposed change, it's probably not >exactly as you expect here. That's why I asked ;) > Like the manual says, when a variable has an >absolute location but no initializer it is not allocated by the >

[Sdcc-user] PIC variable definitions in header files

2014-06-18 Thread Kustaa Nyholm
Hi I noticed one of projects has (for some historical reason) a few definitions like this: typedef struct _BDT { unsigned char STAT; unsigned char CNT; unsigned int ADDR; } BDT; volatile BDT __at (0x0400+0*8) ep0_o; ...etc... (These define a USB end points at the given addresses

Re: [Sdcc-user] PIC programmer support

2014-06-07 Thread Kustaa Nyholm
On 07/06/2014 10:07, "Richard Gray" wrote: >Hi Folks, > >I'm sorry that this is a bit off-topic, but if ever there was an audience >to >ask this question of, if would have to be here. > >Quite a few years ago, I did a project using a mid-range PIC16F84A - >mostly >about digital inputs and outputs

Re: [Sdcc-user] STM8 bootloader flash software

2014-04-06 Thread Kustaa Nyholm
On 06/04/2014 14:45, "Georg Icking-Konert" wrote: >hello Georg O., > >sure, no problem. Actually I never bothered about license, yet. So how do >I release something under a GPL? Before you do you might want to consider what license(s) you want to release your code under. Think what you want, th

Re: [Sdcc-user] SDCC/STM8 questions

2014-03-30 Thread Kustaa Nyholm
> 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

Re: [Sdcc-user] Newcomer to sdcc

2014-03-02 Thread Kustaa Nyholm
On 02/03/2014 02:46, "JuanPi" wrote: >Our platform uses a PIC18f4550, which I am not sure how well supported >it is by sdcc, but I plan to find out. For what it is worth, I've used SDCC with PIC18F4550 with great success, see for example http://www.sparetimelabs.com/eazycnc/toad4/toad4.php an

Re: [Sdcc-user] IAR with SDCC

2014-02-14 Thread Kustaa Nyholm
On 14/02/2014 13:00, "Sebastien Lorquet" wrote: >Hello > >I'm just saying that freedom is not a direct measure of quality, which is >obvious but may have been a bit overlooked in the original post. Hmm, the original question mentioned open source not freedom and I tried to say that with open sou

Re: [Sdcc-user] IAR with SDCC

2014-02-13 Thread Kustaa Nyholm
On 13/02/2014 16:56, "Sebastien Lorquet" wrote: >yes, but that's only the bright side. > >Also, > >-developers are not often paid, so you have to wait until they have >enough free time That is true, then again you don't get a good service from commercial player always either, especially the big

Re: [Sdcc-user] IAR with SDCC

2014-02-13 Thread Kustaa Nyholm
> using in safety-related embedded systems. Open source has several advantages: 1) with open source you evaluate/validate compiler internals which might me import if you take safety seriously 2) the tools cannot be discontinued, this has happened to me with commercial tools in the p

Re: [Sdcc-user] IAR with SDCC

2014-02-13 Thread Kustaa Nyholm
>If I understood you well, my original task (use IAR generated library in SDCC) >is also not feasible? Yes, it is not feasible. > Do you know of any other C compiler that I might use as a replacement for > SDCC. Keil has already been mentioned. > Maybe choosing an open source compiler is not

[Sdcc-user] gplink returned errorcode 256?

2013-06-22 Thread Kustaa Nyholm
Hi, I returned to a project I'm working on after a few months and things had gone sour. When I tried to build my code (with no code changes) I found my gpasm had disappeared, probable because I had messed with Mac OS X homebrew (great package manager for Mac OS IMO/BTW). So I re-installed it from

Re: [Sdcc-user] USB firmware

2013-03-30 Thread Kustaa Nyholm
On 29.3.2013 17.07, "Kustaa Nyholm" wrote: >I've got a USB CDC ACM firmware that compiles with latest sdcc, >I'll see if I can put it up on my webpage this weekend. > > Find the update project here: http://www.sparetimelabs.com/usbcdcacm/usbcdcacm.php br

Re: [Sdcc-user] USB firmware

2013-03-29 Thread Kustaa Nyholm
t game demo contest. Compete >for recognition, cash, and the chance to get your game on Steam. >$5K grand prize plus 10 genre and skill prizes. Submit your demo >by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2 >___ >Sdcc-user mailing lis

Re: [Sdcc-user] --L option not working?

2013-02-14 Thread Kustaa Nyholm
On 14.2.2013 23.33, "Raphael Neider" wrote: >> Ok, so I could not give up so easily, I found 'opensnoop' on Mac OS and >> it shows that SDCC opens: >> >> 501 2232 gplink-1 libdev18f4550.lib >> 501 2232 gplink-1 >> /Users/nyholku/sdcc-3.2.0/share/sdcc/lib/pic16//libdev18f455

Re: [Sdcc-user] --L option not working?

2013-02-14 Thread Kustaa Nyholm
On 14.2.2013 21.14, "Raphael Neider" wrote: > >$ strace -o trace.log -f -eopen sdcc >$ grep libdev18f4550.lib trace.log | grep -v ENOENT > >should yield several hits and reveal the path to the libdev18f4550.lib >that is being used by the linker. > >$ gplib -s /path/to/your/libdev18f4550.lib | gre

Re: [Sdcc-user] --L option not working?

2013-02-14 Thread Kustaa Nyholm
On 14.2.2013 21.14, "Raphael Neider" wrote: >Hi again, > >(This is a potential double-post since my previous post does not seem >to have made it to the list. This version is edited/updated.) > >I tried with r8008 and cannot reproduce this with properly built >libraries. >___eeprom_gptr{get,put}[1

Re: [Sdcc-user] --L option not working?

2013-02-14 Thread Kustaa Nyholm
On 14.2.2013 20.19, "Raphael Neider" wrote: >Hi, > >I think you are missing libdev18f4550.lib in the to-be-linked >libraries. If adding this just before or after libsdcc.lib does not Tried both, no change: >help, please provide the output of your failing command with the -V >("capital-V") flag

Re: [Sdcc-user] --L option not working?

2013-02-14 Thread Kustaa Nyholm
Hi, I had already tried the --print-search-dirs nyholkus-MacBook-Pro:kusti nyholku$ /Users/nyholku/sdcc-3.2.0/bin/sdcc --print-search-dirs -L /Users/nyholku/sdcc-3.2.0/share/sdcc/lib/pic16/ -Wl,-m,-s18f4550.lkr -mpic16 -p18f4550 --disable-warning 85 --std-sdcc99 --obanksel=3 --use-non-free -o ../

Re: [Sdcc-user] --L option not working?

2013-02-14 Thread Kustaa Nyholm
>-- > >Free Next-Gen Firewall Hardware Offer >Buy your Sophos next-gen firewall before the end March 2013 >and get the hardware for free! Learn more. >http://p.sf.net/sfu/sophos-d2d-feb >___ >Sdcc-user

  1   2   3   >