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 0x0000 so I've relocated my code to 0x0800 by including a custom crt0iz.c which locates the start up code to 0x0800 and I've changed my linker file like this: CODEPAGE NAME=vectors START=0x0800 END=0x829 PROTECTED CODEPAGE NAME=page START=0x082A END=0x7FFF The works bootloader and loading the code works. Also the bootloader starts my code and it starts, even the interrupts seem to run ok. However, it crashes at this line: memcpyram2ram(&hid_tx_buffer, &g_toad4_status, 64); (There is also something else wrong as the USB code does not work, ie my device does not get enumerated). This particular piece of hw I'm doing this on only has one LED to help in debugging so I'm sort of stabbing in the dark. Here is what the .map says about those two variables concerned in the crashing line. _hid_tx_buffer 0x0005b0 data extern ../obj/usb_core.asm _g_toad4_status 0x000060 data extern ../obj/main.asm How do I know this is where it crashes? I insert a LED blink before that line and it blinks, put it after that, and it won't. My SDCC is: nyholkus-MacBook-Pro:src nyholku$ /Users/nyholku/sdcc-3.2.0/bin/sdcc -v SDCC : mcs51/gbz80/z80/z180/r2k/r3ka/ds390/pic16/pic14/TININative/ds400/hc08/s08 3.2.0 #8008 (Jul 6 2012) (Mac OS X i386) Any ideas how can memcpyram2ram crash? 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. 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