Update 1:
I have a feeling that the debugger is unreliable. What I have found is that I can only load the program occasionally - if I repeat three or four times it does load (fatal error the first few times but occasionally it works).
In fact I managed to get my own program to run (although I had to manually change the SP and PC to allow it to start in each case) although this also stopped working after several loads and runs (although I hadn't changed any code I found that a memcpy (with valid pointers and size) would not return and IAR and its debugger would freeze during its execution and have to be shot down (and try again)).
Although there was a period where I could run the code after multiple loads (I think the demo always loaded since it is so small and larger code has less change) the sitation became so bad that I decided to give up with IAR (it crashed every time when it had managed to load without a fatal error but the code never completly ran successfully any more).
Now I have moved to DS-5 to see whether the simuation is any better. It also has a demo program "Freescale-Vybrid-VF6xx-M4_RAM" and this looked to run. It loaded and there was "Hello world from Cortex-M4" on the App Console.
Then I repeated a few times and found that it too looks to be unreliable. Sometimes I get
ERROR(CMD16-TAD11-NAL22):
! Failed to load "Freescale-Vybrid-VF6xx-M4_RAM.axf"
! Failed to write 3'136 bytes to address 0x3F040000
! General error on memory or register access.
But sometimes it does load and run, although I am not yet sure of how reliably/unreliably because it may run once but fail after a reset (which would normally re-load).
However, the fact that loading to internal RAM is failing sometimes also using DS-5 does points to a problem with the HW or the debugger.
Therefore there are new questions that are thrown up:
1. Are there known problems with the debugger on the TWR-VF65GS10 and are there updates somewhere? (I see that DS-5 calls it a "Keil Software OpenSDA CMSIS-DAP") Edit: I reloaded CMSIS-DAP.S19 from the TWR-VF65GS10-QSP but it didn't help. The board links to the P&E web site so I downloaded the latest set of SDAs but nothing for the Vybrid in it. Other threads from 2013 talk about improved features (with USB-MSD loading but it seems these didn't get done)
2. I have tried allowing a reference SW to be loaded by the Vybrid's boot loader (from SD card) as well as having no SW to load plus trying to connect during the loading process and with IAR I has best results (highest chance of it loading without fatal error) when I do it just as the loaded program is starting. Are there rules as to the state of the processor when connecting?
In the documentation to the DS-5 reference there is this:
"Power-up the Freescale Vybrid VF6xx, let its loader initialize and prevent the OS boot."
It talks about "preventing the OS boot". But what does this mean and how is it done? Could it be relevant to the problems?
Regards
Mark
P.S. My TWR-VF65 is Rev. H.