PEmicro logo
Cart New Account Login

Logo image
HomeAbout usProductsSupportForumsBlogCustomer Service

search inside this forum
search inside all forums
MPC562 Cannot Program External Flash
Dick B. Feb 25, 2021 at 02:30 AM (02:30 hours)
Staff: Johnny N.

  • I am trying to program a word in the external flash, connected to a MPC562, using the command Program Words. The software correctly reads the flash, however programming fails. I looked at the communication between the PE Micro and the MCU with a logic analyzer, and what I was able to see is that after an RFI command, the processor does not come back into debug mode.

    Do I need to erase the whole flash before I program it, or am I missing something in the procedure?



    • Hi,

      Which .pcp file are you trying?

      Are you able to erase, program, and verify the entire flash so we know you selected the correct .pcp algorithm for it?


      • Hi,

        I am using Micron_58BW016D-B_1x32x512k_CS0_Bosch_Auto_edc16plus.pcp. I am able to put the MPC into debug mode and read the whole flash; however, programming fails. When I scoped the lines, I found that when I try to write a word, immediately after the RFI command the processor does not return to debug mode. SRR0 is set to 0x00302168, which is the address of the Program Words routine in the PCP file.

        I can see that the word I want to be programmed is written on the buffer before the RFI. Some other variables, which I assume to be relevant to the operation, are recorded in:
        0x00302214 in r1   - Stack address
        0x10000000 in r4   - Module (flash) address (should be R1?)
        0x00000004 in r5   - ? Looks like length of block to be programmed in bytes (should be R2?)
        0x00302244 in r6    - Buffer address (should be R3?)

        The PCP_PROGPPCNEXUS User Manual (page 35 from v1.00. Jan 2016) states that R1 should contain starting address of module into which the words are to be programmed, and R3 should contain address of the buffer, while R2 should contain the block length in bytes.

        Can you please confirm if the manual is correct?


        • I think I might have found a possible reason for the behavior. Just before issuing the RFI, SRR1 is programmed to 0x00020002. That's only setting bit Machine State is Recoverable. I thought that SRR1 should hold 0x00002002 prior an RFI: that's flags Floating Point Available and Machine State is Recoverable.

          Is there a way to test if changing SRR1's value will affect the algorithm?

          • Hi,

            I appreciate your efforts to try to understand how the programming algorithms work and in troubleshooting this issue before you contacted us. Before we go further in this, let's check a few other basic things first so we're not spending a lot of time going down the wrong path. The first thing we should do is verify that the algorithm you selected is indeed correct for your board. After that has been verified, then we can do further troubleshooting of the algorithm.

            Fill out this form and let us know about the details of your external


            For "Please choose what type of flash support you require" choose -> External Flash Connected to Microcontroller on Address/Data Bus

            We will look at the information you provide and check that the algorithm Micron_58BW016D-B_1x32x512k_CS0_Bosch_Auto_edc16plus.pcp is the right one for your board.

            PEmicro Support

Add comment

   Want to comment? Please login or create a new PEmicro account.

© 2021 P&E Microcomputer Systems Inc.
Website Terms of Use and Sales Agreement