I've now pruned the code to just:
#include "PIC-config.c" #include <pic18fregs.h> #include <string.h> // 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; for (i = 0; i<200000;) i++; LED_PIN = !LED_PIN; memcpyram2ram(&buffer, &buffer, 64); } } Complete project with all files is here: http://www.sparetimelabs.com/temp/blinky.zip And the compiled object code, listings and map are here: http://www.sparetimelabs.com/temp/blinky-obj.zip I will also include the verbatim compile output at the end of this mail. I'm guessing this is a problem with crt start up code, probably the stack pointer is not set properly, however everything looks good to me when I look at the compiled code so I stumped atm. I guess next I need figure how to get a PIC simulator run on mac. br Kusti nyholkus-MacBook-Pro:src nyholku$ make /Users/sdcc-builder/build/sdcc-build/orig/sdcc/src/pic16/main.c:670 setting interrupt vector addresses 0x800 /usr/local/sbin:/usr/local/bin:/Users/nyholku/Desktop/ImageMagick-6.7.9/bin :/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bi n:/opt/X11/bin:/usr/texbin:/Users/nyholku/android/tools:/sw/bin:/Users/nyho lku/sdcc/bin:/Users/nyholku/bl08:/Users/nyholku/TOAD3/pk2cmd:/usr/local/sha re/npm/bin:/Applications/Wine/.wine/bin:/Users/nyholku/vsfm-osx/cmvs/progra m/main:/Applications/microchip/xc8/v1.32/bin:/Users/nyholku/TOAD3/pk2cmd:/u sr/local/bin/ /Users/nyholku/sdcc-3.2.0/bin/sdcc -c --ivt-loc=0x800 --no-crt -V -L /Users/nyholku/sdcc-3.2.0/share/sdcc/non-free/lib/pic16 -Wl,-m,-s18f4550.lkr -mpic16 -p18f4550 --disable-warning 85 --std-sdcc99 --obanksel=3 --use-non-free main.c -o ../obj/main.o /Users/sdcc-builder/build/sdcc-build/orig/sdcc/src/pic16/main.c:670 setting interrupt vector addresses 0x800 + "/Users/nyholku/sdcc-3.2.0/bin/sdcpp" -nostdinc -Wall -Dpic18f4550 -D__18f4550 -D__SDCC_PIC18F4550 -DSTACK_MODEL_SMALL -D__STACK_MODEL_SMALL -obj-ext=.o -D__SDCC_USE_NON_FREE -DSDCC_USE_NON_FREE -D__SDCC=3_2_0 -DSDCC=320 -D__SDCC_REVISION=8008 -DSDCC_REVISION=8008 -D__SDCC_pic16 -DSDCC_pic16 -D__pic16 -D__STDC_NO_COMPLEX__ -D__STDC_NO_THREADS__ -D__STDC_NO_ATOMICS__ -D__STDC_NO_VLA__ -isystem "/Users/nyholku/sdcc-3.2.0/bin/../share/sdcc/include/pic16" -isystem "/usr/local/share/sdcc/include/pic16" -isystem "/Users/nyholku/sdcc-3.2.0/bin/../share/sdcc/include" -isystem "/usr/local/share/sdcc/include" -isystem "/Users/nyholku/sdcc-3.2.0/bin/../share/sdcc/non-free/include/pic16" -isystem "/usr/local/share/sdcc/non-free/include/pic16" -isystem "/Users/nyholku/sdcc-3.2.0/bin/../share/sdcc/non-free/include" -isystem "/usr/local/share/sdcc/non-free/include" "main.c" + "gpasm" -DSTACK_MODEL_SMALL -D__STACK_MODEL_SMALL -o "../obj/main.o" -c "../obj/main.asm" ../obj/main.asm:9:Warning[212] __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG. ../obj/main.asm:10:Warning[212] __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG. ../obj/main.asm:11:Warning[212] __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG. ../obj/main.asm:12:Warning[212] __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG. ../obj/main.asm:13:Warning[212] __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG. ../obj/main.asm:14:Warning[212] __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG. ../obj/main.asm:15:Warning[212] __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG. ../obj/main.asm:16:Warning[212] __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG. ../obj/main.asm:17:Warning[212] __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG. ../obj/main.asm:18:Warning[212] __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG. ../obj/main.asm:19:Warning[212] __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG. ../obj/main.asm:20:Warning[212] __CONFIG has been deprecated for PIC18 devices. Use directive CONFIG. /Users/nyholku/sdcc-3.2.0/bin/sdcc --ivt-loc=0x800 --no-crt -V -L /Users/nyholku/sdcc-3.2.0/share/sdcc/non-free/lib/pic16 -Wl,-m,-s18f4550.lkr -mpic16 -p18f4550 --disable-warning 85 --std-sdcc99 --obanksel=3 --use-non-free -o ../obj/blinky.hex ../obj/main.o ../obj/crt0iz_toad4.o libc18f.lib libio18f4550.lib libm18f.lib libsdcc.lib /Users/sdcc-builder/build/sdcc-build/orig/sdcc/src/pic16/main.c:670 setting interrupt vector addresses 0x800 + "gplink" -I"/Users/nyholku/sdcc-3.2.0/share/sdcc/non-free/lib/pic16" -I"/Users/nyholku/sdcc-3.2.0/bin/../share/sdcc/lib/pic16" -I"/usr/local/share/sdcc/lib/pic16" -I"/Users/nyholku/sdcc-3.2.0/bin/../share/sdcc/non-free/lib/pic16" -I"/usr/local/share/sdcc/non-free/lib/pic16" -m -s18f4550.lkr -w -r -o "../obj/blinky.hex" "../obj/main.o" "../obj/crt0iz_toad4.o" "libc18f.lib" "libio18f4550.lib" "libm18f.lib" "libsdcc.lib" "libdev18f4550.lib" "libsdcc.lib" ~/TOAD4-firmware/bootloader/encoder/build/encoder -ix ../obj/blinky.hex -ox ~/TOAD4-firmware/obj/toad4-encoded.hex -e 30313233343536373839414243444546 java -cp ~/FirmwareUpdate/bin:/Users/nyholku//PureJavaHidApi/bin/purejavahidapi.jar: /Users/Nyholku/PureJavaHidApi/lib/jna-4.0.0.jar Test 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 of the material in this e-mail is strictly forbidden. We will not be liable for direct, indirect, special or consequential damages arising from alteration of the contents of this message by a third party or as a result of any virus being passed on or as of transmission of this e-mail in general. ------------------------------------------------------------------------------ New Year. New Location. New Benefits. New Data Center in Ashburn, VA. GigeNET is offering a free month of service with a new server in Ashburn. Choose from 2 high performing configs, both with 100TB of bandwidth. Higher redundancy.Lower latency.Increased capacity.Completely compliant. http://p.sf.net/sfu/gigenet _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user