> BTW I have also attached a reset-init script that not only does a
 > soft_reset_halt and vector table remap, but also disables MAM and PLL
 > after reset - without that two steps I experienced really crazy
 > behaviour in a very simple and correct code while debugging.

This is a little bit same what we have done recently in here. I have 
never figured out how these scripts could have worked "out of box" for 
anyone unless using internal RC oscillator as the only clock source.... 
Without dealing with this things went crooked from time to time.

What we actually did was making another procedure function called 
"activateInternalOsc" to target script that basically does the same 
things described here previously; disabling PLL, switching to internal 
RC oscillator, etc. Most importantly: putting the target device into 
/known/ state. This way we didn't have to worry about what crystal or 
PLL settings the device is used with. This function is called from 
reset-init event.

We also made another procedure function called "writeToInternalFlash" 
that can be evoked when we want to use OOCD just to program the FLASH 
memory. One of the first things this function does is calling the 
"activateInternalOsc", again to bring the device into known state and 
then perform what is necessary for flash programming.

> - JTAG_FREQ - CRYSTAL_FREQ / 8 works for me all the times, but 
> CRYSTAL_FREQ / 6 - not (in the .tcl file I divide by 8 now)

Agreed. Divided by 8 seems to be a more stable option in here as well.
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to