> 1. MCF52258 watchdog can't be disabled by external pin reset? Only can be disabled by power-on reset?
That's what you've said the manual says and it is exactly what the manual says. So "Yes".
But your problem is really with programming it.
I read "only part is programmed" as saying "the part is programmed", but then re-read it as "it is only partially programmed". So I'm guessing the Watchdog is resetting the chip part way through the programming phase.
When you say "the watchdog is enabled", where is it enabled? In the setup of the programmer or in the PREVIOUSLY LOADED code? If the problem is that your previously-loaded code runs on power-up, enables the watchdog, and then you try to program it without first power-cycling, then the watchdog will bite partway through programming. If that is the case, how do you ever get "watchdog disabled" code in there to then let you program it properly?
> When ezport is enabled, the MCF52258 is not in any mode()?
What is your question? Is in a mode, isn't in a mode or is in what mode? From the manual:
23.2 Modes of Operation
The EzPort can operate in one of two different modes:
• Enabled—When enabled, the EzPort steals access to the flash memory, preventing access from
other cores or peripherals. The rest of the micro-controller is disabled when the EzPort is enabled
to avoid conflicts.
23.3.2.2 EZPCS — EzPort Chip Select
EzPort chip select (EZPCS) is the chip select for signalling the start and end of serial transfers. If EZPCS
is asserted during and when the micro-controller’s reset out signal is negated, then EzPort is enabled out
of reset; otherwise it is disabled.
When EzPort is enabled the CPU is disabled. It is possible the Watchdog is still active.
I would say you need to connect EzPort, have it drive EZPCS low and then power the MCF52258 on (and not just reset it). That way the Micro won't have run any code and won't have enabled the watchdog. Then you should be able to program it properly.
Here's a previous post I found that looks to say that this is the proper way to do it:
https://community.freescale.com/message/457418#457418
My program does the following:
do the power on and enable procedure: power off. set cs low. power on
Here's another one saying "Assert EZPCS and then POWER ON":
https://community.freescale.com/docs/DOC-102282
It is possible that when the EzPort disables the CPU it may put it in STOP, DOZE or WAIT mode, and the mode might be visible to the Watchdog. So maybe programming the watchdog with one of STOP/WAIT/DOZE will stop it from interrupting EzPort programming. That may be another solution.
There's nothing I can find in the manual to say if that is the case. The only way to find out would be for you to TEST this yourself. I'd suggest writing code to enable the Watchdog, but with STOP/WAIT/DOZE bit all set. Program that. Then see if you can program it again with that code having run. If you can, try again to find out which single bit allowed you to do this and then POST that back here.
But from all my reading of previous posts you're meant to POWER CYCLE the board into EzPort mode, and that simply resetting it doesn't work and can't be expected to work.
Here are some more previous posts on EzPort you should read (just type "EzPort" into the Search Field like I did):
https://community.freescale.com/message/331401#331401
https://community.freescale.com/message/27887#27887
The last one above details lots of other things that go wrong. You have to erase THEN PROGRAM without Resetting between.
Tom