> 1) Try turning off the MAM to eliminate > this from the set of variable. Already using MAM_OFF. > 2) Are you using Thumb code? If so, perhaps the .data assignment is > throwing away the thumb attributes. Nope, 32b code. > 3) A Prefetch Abort means that there is no memory available at the > address you specify (like a data abort, but for instructions). > > The code > > LDR PC,[R5,#0] > > should be loading the pointer from this address > (ie. R5 + #0 should be a 32-bit value that is the pointer > to the code). > > Check that the address actually contains the **pointer** > to the code you want to execute and not the actual code itself. Now we're getting somewhere. I think this is the problem. I want it to jump to and execute at the 0x4000000 adr. There is no pointer there. > Perhaps try > > static const (*fnptr)(void) = IAP_Test; > ... > *fnptr(); That gives a compiler error: main.c:107: error: invalid type argument of `unary *' D:\GNUARM\bin\make: *** [main.o] Error 1 > which should put the pointer in the literal pool and generate > different code. Yeh I think this is on the right track. I need to get my C syntax correct here to generate a long jump directly rather than loading a pointer. The function is at 0x40000000 not a pointer to it. If you have any other ideas for this, please pass them on. Meanwhile I check my C books to try to figure out the needed syntax. Chris.
Message
Re: How to declare RAM functions in GCC
2005-01-17 by sig5534
Attachments
- No local attachments were found for this message.