2006-07-07 07:40 PM
GNU Toolchain / RIDE moving entry point
2006-07-07 07:40 PM
In order to use a DFU I need to move my application so it runs at 0x40002000 instead of 0x40000000. I combined the default linker scripts loaded in STR71xF2_FLASH.ld into one big file and changed the MEMORY entry for FLASH to 0x40002000. I also added an ''entry(_start)'' at the top of the script file.
I also copied crt0.s to my own version and modified the EIC_INIT code to map offsets into the SIRx registers and to put 0x40000000 in the IVR register. Then I changed the IRQ_Handler to use the vector in IVR instead of jumping to an instruction in the IVR. This seemed necessary because the defualt code ANDs the Peripheral IRQ offsets with 0x0FFF so those could not be loaded at 0x2000 or above. After making all the changes the application behavior is strange. Sometimes it seems to work, but USB interrupts never occur. Other times the app jumps into never never land, like 0x40001df9, which shouldn't be possible. And sometimes the PLL never locks. Which error actually occurs seems to be related to where breakpoints are set. Running the app with no breakpoints always results in a hangup waiting on the PLL. This is a very simple application right now, mostly just setting up the USB code. I know I must be missing something very basic, but I can't find it. The startup files are attached. Any help will be greatly appreciated! A RIDE based example of the USB DFU demo might help ..... :) Actually, I can follow the bootloader code, it's the application part that is giving me fits. Thanks, David [ This message was edited by: davidp on 08-07-2006 08:22 ]