Hi, I'm trying to port and older RTX project which uses external SDRAM. But before it gets to main() I'm getting an Undef_handler error. When I single step I find that the error occurs at a specific point (address 0x2A4 below) at a DD instruction? I though DD instructions were just data tables and not executed? This does not happen on the demo code that uses the same setup files hardware etc however there is more memory used. The only difference I can see is the DD value at 0x2A4 is 0xA0044DD0 Memory is tested and working OK.
Any ideas please.
1498: ; User Initial Stack & Heap 1499: AREA |.text|, CODE, READONLY 1500: 1501: IMPORT __use_two_region_memory 1502: EXPORT __user_initial_stackheap 1503: __user_initial_stackheap 0x0000026C E24DA050 SUB R10,R13,#0x00000050 1504: 0x0000026C E24DA050 SUB R10,R13,#0x00000050 0x00000270 E01FC000 DD 0xE01FC000 0x00000274 00FF7FFF DD 0x00FF7FFF 0x00000278 FFE08000 DD 0xFFE08000 0x0000027C E002C000 DD 0xE002C000 0x00000280 05010115 DD 0x05010115 0x00000284 55555555 DD 0x55555555 0x00000288 50055555 DD 0x50055555 0x0000028C 00000303 DD 0x00000303 0x00000290 00080280 DD 0x00080280 0x00000294 0015F900 DD 0x0015F900 0x00000298 00000183 DD 0x00000183 0x0000029C 002BF200 DD 0x002BF200 0x000002A0 00000103 DD 0x00000103 0x000002A4 A0044DD0 DD 0xA0005340 0xA0044DD0 __main: 0x000002A8 EB000000 BL __scatterload_rt2(0x000002B0) 0x000002AC EB00005B BL __rt_entry_sh(0x00000420) __scatterload_rt2: 0x000002B0 E28F002C ADD R0,PC,#0x0000002C
Your program most likely fails during scatter loading. Are you getting any linker warnings?
Sorry made a mistake on line 0x2A4 it should only read:
0x000002A4 A0044DD0 DD 0xA0005340 (works OK) 0x000002A4 A0044DD0 DD 0xA0044DD0 (does not work)
One additional thing I forgot to mention is that in the list file I can't see either value they are identical (see below) so I assume it is the linker at work.
1487 00000270 ; Enter the C code ------------------------------------- ------------------------ 1488 00000270 1489 00000270 IMPORT __main 1490 00000270 1491 00000270 1492 00000270 IF :DEF:__MICROLIB 1498 00000270 ; User Initial Stack & Heap 1499 00000270 E01FC000 00FF7FFF FFE08000 E002C000 05010115 55555555 50055555 00000303 00080280 0015F900 00000183 002BF200 00000103 00000000 AREA |.text|, CODE, READONLY 1500 00000000 1501 00000000 IMPORT __use_two_region_memory 1502 00000000 EXPORT __user_initial_stackheap 1503 00000000 __user_initial_stackheap 1504 00000000 1505 00000000 E59F000C LDR R0, = Heap_Mem 1506 00000004 E59F100C LDR R1, =(Stack_Mem + USR_Stack_Siz e) 1507 00000008 E59F200C LDR R2, = (Heap_Mem + Heap_Siz e)
No linker warnings (non suppressed), it does not even get to scatterload. That's the next instruction (see below) unless the debugger is hiding something but the demo code (below) works fine and executes the scatterload successfully and runs to main().
0x000002A0 00000103 DD 0x00000103 0x000002A4 A0005340 DD 0xA0005340 __main: 0x000002A8 EB000000 BL __scatterload_rt2(0x000002B0)