Hi All
The problem was solved and found to be due to the initialisation of FLASHBAR in the start up code.
/* Initialize FLASHBAR - -simplified routine (usually it does work from SRAM) */
move.l #__FLASH,d0
add.l #0x21,d0
movec d0,RAMBAR0
__FLASH is defined in the linker script file and is usually 0.
If the flash starts at 0x1000 (__FLASH = 0x00001000) RAMBAR gets written with the value
0x00001021.
The 0x1000 is a non-defined bit in the FLASHBAR register but if set causes strange behavior (DMA memory operation failure and parts of FLASH can not be read correctly).
To avoid such problems the start up code should not allow undefined bits in the FLASHBAR register to be set. eg.
move.l #__FLASH,d0
and.l #0xfff80000,d0 /* protect undefined bit positions in FLASHBAR */
etc...
Regards
Mark
www.uTasker.com