How to use Cyclone FX to perform flash programming on the mpc565 that is not supported by it

By gong d. : May 20, 2025 at 09:44 AM (09:44 hours)
Staff: Johnny N. : 14 comments

Cyclone FX was able to successfully connect to the MPC565 target board.
Freescale_MPC565_1x32x128k_UC3F_A_512k_Memory_Blk
Erased successfully
Blank check reminder
Module word not erased at address $0008001 word is $4804

Error during programming

Upload data successful
Module erase prompt successful
Actual unerased data successful
Programming prompt error

How to solve this problem!

The following FAQ addresses the MPC555 but should also apply to the MPC565.

You can add some code to drive the IO port in the algorithm header. This is a modification that you can do yourself in any text editor. Please see the note below. Register addresses are in the reference manual of the MPC565.
https://www.nxp.com/docs/en/data-sheet/MPC565RM.pdf

FAQ ID # 236

Question
I am unable to erase or program the internal flash on a MPC555.

Answer
There are two pins on the mpc555lf8mzp40 as well as other revisions of the MPC555 that are required for erasing and programming of the CMF flash modules.

The EPEE input pin is an external enable signal and controls the program or erase operations. When this pin is high, high voltage operations on the flash are enabled. When this pin is low, high voltage operations on the flash are disabled.

The VPP input pin is the flash supply voltage used during program and erase operations of the flash memory. This pin must be connected to 5V for flash operations.

Some boards might have the EPEE pin connected to a processor GPIO which must be driven high. This can be done in your algorithm.

Let's say your EPEE pin is connected to MPIO15. The following lines need to be added to the header of the algorithm.

;epee pin is connected to mpio32b15 which needs to be driven high
WRITE_WORD=8000/00306102/ ;mpiosmddr - bit 15 is an output
WRITE_WORD=8000/00306100/ ;mpiosmdr - bit 15 high

The commands follow the format WRITE_WORD=HHHH/AAAAAAAA where HHHH is a word hex value and AAAAAAAA is the address of the register.

Example of a .pcp algorithm header:

;version 1.03, 05/01/2001, Copyright P&E Microcomputer Systems, www.pemicro.com
;device Freescale, MPC555, 1x32x112k, desc=CMF_448k_revm_mpio32b15
;begin_cs device=$00000000, length=$00070000, ram=$003F9800
;portions 1999 Copyright Motorola (CMF driver routines), used with permission
;uses CMF driver code to parallel program/erase
; CMF code requires 40MHz internal frequency
;end_cs
NO_TIMING_TEST
USE_CMF_DRIVER=0D/06/0F/000B/00008000/ 14-32k blocks, 512 segments, 64 byte page
WRITE_SPR=00000800/027E/ ;enable internal CMF Flash
WRITE_LONG=FFFFFF80/002FC004/ ;Turn off watchdog timer
WRITE_LONG=84000000/002FC800/ ;Enable first 256K CMF Flash
WRITE_LONG=84000000/002FC840/ ;Enable second 192K CMF Flash
WRITE_LONG=00000000/002FC100/ ;Turn off CS0
WRITE_LONG=00000000/002FC140/ ;Turn off Dual Mapping
;epee pin is connected to mpio32b15 which needs to be driven high
WRITE_WORD=8000/00306102/ ;mpiosmddr - bit 15 is an output
WRITE_WORD=8000/00306100/ ;mpiosmdr - bit 15 high

;end_cs
;Blocks 14-32k
USER=BE Block Erase 1Block > /00000000/0000000D/
;Pattern in Hex, leftmost_bit=Block 0, Rightmost_bit=Block 13, B=1 > erase block
USER=PE Pattern Erase 4Block > /00000000/00003FFF/
;

Regards,
Johnny
PEmicro

Could you help me modify an algorithm file for the MPC565 chip that can erase blank checks and successfully complete the process?

Hi gong,

Could you provide more information about your board?

What is the voltage of the following pins when you try to erase or program?

VDD
EPEE
B0EPEE
VFLASH
VDDF
VSSF

Regards,
Johnny

When erasing or programming, the voltage of the following pins is 2.65V.
I'm using the PORTG interface with 10 pins. Power MPC5xx/8xx BDM Pinout
VFLS0* 1 2 SRESET
GND 3 4 DSCK
GND 5 6 VFLS1*
HRESET 7 8 DSDI
TVCC 9 10 DSDO

I'm not asking about the debug pins. They are the flash control pins for program and erase operations.

What is the voltage of the following pins on the microcontroller when you try to erase or program?

VDD
EPEE
B0EPEE
VFLASH
VDDF
VSSF

VDD 2.6V
EPEE 0.3V
B0EPEE 2.6V
VFLASH Connect to GND
VDDF 2.5V
VSSF Connect to GND

EPEE has the wrong voltage. Is EPEE connected to any other pins or components?

Since your EPEE pin is connected to AD16, we will need to modify the algorithm to drive this pin high. We will move this issue to a support ticket. I will email you once a ticket has been opned.

OK. Thank you. Looking forward to your good news.

I sent you a few messages in the support ticket. Are you getting notifications about them? I just want to make sure since I haven't gotten any responses from you in the support ticket.

I haven't received any response from you.

Please look in the support ticket then. I have an algorithm attached in there for you to test.

Go here: https://www.pemicro.com/support/index.cfm

Then click on Support Tickets

The voltage at pin B0EPEE is 0.3 volts. The B0EPEE pin is connected to the IRQ5_B_SGPIOC 5_MODCK1 (AD25) pin with two 4.7K resistors for pull-down.