Cannot flash demo code on MPC5744P motor control dev kit with multilink universal FX

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cannot flash demo code on MPC5744P motor control dev kit with multilink universal FX

3,854 Views
Zeeico
Contributor II

Hello,

I am working with an NXP MTRCKTSPS5744P dev kit and got a PE Micro multilink universal FX connector to be able to flash code to it. When trying to flash the demo code, following the guide here, I encounter errors. Weirdly, the errors aren't consistent. The latest error I am getting is error 216. Here is the console output:

Connection from "127.0.0.1" via 127.0.0.1. Connection from port "51323" to 7224
Copyright 2018 P&E Microcomputer Systems,Inc.
Command Line :C:\NXP\S32DS_Power_v2017.R1\eclipse\plugins\com.pemicro.debug.gdbjtag.ppc_2.0.4.202103012147\win32\pegdbserver_power_console -device=MPC5744P -startserver -singlesession -serverport=7224 -gdbmiport=6224 -interface=USBMULTILINK -speed=5000 -Ø
P&E Interface detected - Flash Version 10.46
Flash Data in range 0x00FA0000-0x00FA0007.
Flash Data in range 0x01000000-0x01000291.
Flash Data in range 0x01001000-0x010010F3.
Flash Data in range 0x01002000-0x01002B77.
Flash Data in range 0x01002B80-0x010087BB.

CMD>RE

Initializing.

Device IDCODE is $00000345
Device ID revision is $00000003
Initializing Ram Block 0x40000000-0x40007FFF.
MPC5744P Device detected.
Target has been RESET and is active.
CMD>CM C:\NXP\S32DS_Power_v2017.R1\eclipse\plugins\com.pemicro.debug.gdbjtag.ppc_2.0.4.202103012147\win32\gdi\P&E\nxp_mpc5744p_1x32x616k_cflash.pcp

Initializing.

Device IDCODE is $00000345
Device ID revision is $00000003
Initializing Ram Block 0x40000000-0x40007FFF.
MPC5744P Device detected.

DOUBLE BUFFERING enabled.
Initialized.

;version 1.05, 12/13/2016, Copyright P&E Microcomputer Systems, www.pemicro.com [5744P_2464k]

;device NXP, MPC5744P, 1x32x616k, desc=CFlash

;begin_cs device=$00F98000, length=$00268000, ram=$40000000

Loading programming algorithm ...
Done.
Programming sequency is : erase, blank check, program, and verify {default}
CMD>VC
Verifying object file CRC-16 to device ranges ...
block 00FA0000-00FA0007 ...
Calculated CRC-16 does not match block. (File = $250D, Device = $6820)
Current content of flash does not match application to be programmed

CMD>EM

Erasing.
Module has been erased.
CMD>PM

Programming.
Processing Object File Data ...


.
Programmed.
CMD>VC
Verifying object file CRC-16 to device ranges ...
block 00FA0000-00FA0007 ...
Ok.
block 01000000-01000291 ...
Ok.
block 01001000-010010F3 ...
Ok.
block 01002000-01002B77 ...
Calculated CRC-16 does not match block. (File = $D6D9, Device = $0558)
Error verifying flash of device
Error occured during Flash programming.

Device IDCODE is $00000345
Device ID revision is $00000003

Starting reset script (C:\NXP\S32DS_Power_v2017.R1\eclipse\plugins\com.pemicro.debug.gdbjtag.ppc_2.0.4.202103012147\win32\gdi\P&E\s32e200_mpc574xp.mac) ...
REM This script is compatible with MPC574xP devices.
REM Clean GPRs to remove residual data after using algorithm
REM Initialize all of the Main SRAM - 384KB
Initializing RAM from $40000000 to $4005FFFF.
Initializing Ram Block 0x40000000-0x4005FFFF.

Reset script (C:\NXP\S32DS_Power_v2017.R1\eclipse\plugins\com.pemicro.debug.gdbjtag.ppc_2.0.4.202103012147\win32\gdi\P&E\s32e200_mpc574xp.mac) completed.

MPC5744P Device detected.

PEmicro GDB Launch Failure : Error during flash programming. Terminating debug session.

I really need to be able to flash code, especially as during the flashing process, the demo code that was previously on the flash has been erased.

Thanks for your help.

0 Kudos
Reply
12 Replies

3,808 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

I did quick test on my side and I'm able to program the same project to flash by Multilink Universal FX.

Does it work if you try to load another project?

What can you see in the affected area (01002000-01002B77 as I can see in the log) when you attach the debugger? You can take a look at this thread - it describes how to attach the debugger without loading of new code:

https://community.nxp.com/t5/S32-Design-Studio/How-attach-to-running-program/m-p/1030375

Regards,

Lukas

0 Kudos
Reply

3,796 Views
Zeeico
Contributor II

Hi Lukas,

Thanks for your reply. I did manage to connect to the board without flashing code, but I'm not sure how to check the block in question, could you perhaps tell me where to look to find that information? 

Also, where could I find another demo project for the inverter dev kit? I'd be happy to try to flash that, but I don't want to flash any random code to the dev kit to avoid damaging it.

Thanks for your help

0 Kudos
Reply

3,785 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

you can simply watch the memory like this:

lukaszadrapa_0-1638889484606.png

And then you can export the memory like:

lukaszadrapa_1-1638889736195.png

Well, I'm not sure if this will help but it would be interesting to know what happened there.

You can import some SDK example:

File -> New -> S32DS Project from Example

Then select some example from "S32PA RTM SDK v3.0.0 Example Projects" for MPC5744P.

stm_periodic_interrupt_mpc5744p could be a good one. It uses only one GPIO, so you can only comment out PINS_DRV_Init function and toggling in interrupt by PINS_DRV_TogglePins to be sure it does not touch the pins. If you can load this project, I would try to put some constant arrays to make the project bigger.

I know that these are rather stupid tests but I'm not really sure what's going on, so I'm trying to find something what could move us forward...

Regards,

Lukas

 

0 Kudos
Reply

3,757 Views
Zeeico
Contributor II

Hi Lukas,

I have done the steps you described above, but I also couldn't flash the stm_periodic_interrupt_mpc5744p project onto the board. Here is the console output: 

Connection from "127.0.0.1" via 127.0.0.1. Connection from port "63994" to 7224
Copyright 2018 P&E Microcomputer Systems,Inc.
Command Line :C:\NXP\S32DS_Power_v2017.R1\eclipse\plugins\com.pemicro.debug.gdbjtag.ppc_2.0.4.202103012147\win32\pegdbserver_power_console -device=MPC5744P -startserver -singlesession -serverport=7224 -gdbmiport=6224 -interface=USBMULTILINK -speed=5000 -Ø
P&E Interface detected - Flash Version 10.46
Flash Data in range 0x00FA0000-0x00FA0007.
Flash Data in range 0x01000000-0x0100018B.
Flash Data in range 0x01001000-0x010010B3.
Flash Data in range 0x01002000-0x01002BCB.
Flash Data in range 0x01002BD0-0x010067E7.

CMD>RE

Initializing.

Device IDCODE is $00000345
Device ID revision is $00000003
Initializing Ram Block 0x40000000-0x40007FFF.
MPC5744P Device detected.
Target has been RESET and is active.
CMD>CM C:\NXP\S32DS_Power_v2017.R1\eclipse\plugins\com.pemicro.debug.gdbjtag.ppc_2.0.4.202103012147\win32\gdi\P&E\nxp_mpc5744p_1x32x616k_cflash.pcp

Initializing.

Device IDCODE is $00000345
Device ID revision is $00000003
Initializing Ram Block 0x40000000-0x40007FFF.
MPC5744P Device detected.

DOUBLE BUFFERING enabled.
Initialized.

;version 1.05, 12/13/2016, Copyright P&E Microcomputer Systems, www.pemicro.com [5744P_2464k]

;device NXP, MPC5744P, 1x32x616k, desc=CFlash

;begin_cs device=$00F98000, length=$00268000, ram=$40000000

Loading programming algorithm ...
Done.
Programming sequency is : erase, blank check, program, and verify {default}
CMD>VC
Verifying object file CRC-16 to device ranges ...
block 00FA0000-00FA0007 ...
Ok.
block 01000000-0100018B ...
Ok.
block 01001000-010010B3 ...
Ok.
block 01002000-01002BCB ...
Ok.
block 01002BD0-010067E7 ...
Calculated CRC-16 does not match block. (File = $8957, Device = $F6A6)
Current content of flash does not match application to be programmed

CMD>EM

Erasing.
Module has been erased.
CMD>PM

Programming.
Processing Object File Data ...


.
Programmed.
CMD>VC
Verifying object file CRC-16 to device ranges ...
block 00FA0000-00FA0007 ...
Ok.
block 01000000-0100018B ...
Ok.
block 01001000-010010B3 ...
Ok.
block 01002000-01002BCB ...
Ok.
block 01002BD0-010067E7 ...
Calculated CRC-16 does not match block. (File = $8957, Device = $B954)
Error verifying flash of device
Error occured during Flash programming.

Device IDCODE is $00000345
Device ID revision is $00000003

Starting reset script (C:\NXP\S32DS_Power_v2017.R1\eclipse\plugins\com.pemicro.debug.gdbjtag.ppc_2.0.4.202103012147\win32\gdi\P&E\s32e200_mpc574xp.mac) ...
REM This script is compatible with MPC574xP devices.
REM Clean GPRs to remove residual data after using algorithm
REM Initialize all of the Main SRAM - 384KB
Initializing RAM from $40000000 to $4005FFFF.
Initializing Ram Block 0x40000000-0x4005FFFF.

Reset script (C:\NXP\S32DS_Power_v2017.R1\eclipse\plugins\com.pemicro.debug.gdbjtag.ppc_2.0.4.202103012147\win32\gdi\P&E\s32e200_mpc574xp.mac) completed.

MPC5744P Device detected.

PEmicro GDB Launch Failure : Error during flash programming. Terminating debug session.

 

Weirdly enough, the data error seems to be in a different flash block...

I have also attached the data from the memory on the board, but I'm not sure you'll find anything there, it was displaying as all '?' on the IDE.

Thanks for your help

0 Kudos
Reply

3,741 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Could you download this tool from Pemicro and try to erase all blocks?

https://www.pemicro.com/downloads/download_file.cfm?download_id=194

It's free starter edition limited to 64KB but the erase will work.

If you can see all '??' in the memory map, it means it cannot be read, probably due to double bit ECC errors. But the erase should do the recovery. If not, the flash could be damaged for some reasons.

Regards,

Lukas

0 Kudos
Reply

3,691 Views
Zeeico
Contributor II

Hi Lukas,

I downloaded and ran the utility. There was not reset script originally running, so I went to Configuration>Automated Script Options and linked the reset script that was running in the S32 IDE, so if this script was the issue this would not be solved. When I ran the script, I saw that all the registers were set back to 0, so I assume it is at least doing something. I still only saw XX in the memory window, as you suggested might happen.

Once I did all this, I went back to S32 and tried flashing the periodic_interrupt project again, but it still didn't work and the error was the same. I have also attached my workspace to this post if you want to take a look at it and see if the error is caused by something in there.

If the flash is indeed damaged, what could I do about that?

Thanks for your help.

 

Tags (1)
0 Kudos
Reply

3,653 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

I'm fighting with some licensing issue of my S32DS 2017.R1 versions, so I can't test it on my side now. I hope I will make it working later.

Not sure if I can understand - was it possible to execute erase command in Pemicro utility or not?

Do you know the history of this MCU? Is it brand new or did you got it from someone? Did anyone play with DCF records? There's a feature called OTP (One Time Programable) Blocks when a flash block can be make OTP by writing a DCF record to the UTEST flash.

Or was there a code which programmed/erased the flash? Like EEPROM Emulation or something like that?

Regards,

Lukas

0 Kudos
Reply

3,641 Views
Zeeico
Contributor II

Hi Lukas,

I think it was possible to execute the command from the utility, using the reset script that was getting used in the S32 IDE (see attached screenshot). However, I still encounter the same error when trying to program the flash.

 

As far as I know, the only time this MCU was flashed before was at NXP when putting the MTRCKTSPS5744P_S32DS project on it as part of the motor control dev kit. We have had it for a while, but we had not flashed anything to it as we did not have a jtag or nexus cable, but we did play around in freemaster a bit, mostly checking and controlling the run states. This issue is therefore on out first attempt at flashing code to the MCU.

 

And as far as I know, the only time the flash was erased was when trying to flash and debug the MTRCKTSPS5744P_S32DS project the first time on my end, which was using the same reset script as I used in the pemicro utility 

Thanks for your help.

0 Kudos
Reply

3,629 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

could you try to update Pemicro plugin? The procedure is described here:

https://community.nxp.com/t5/S32-Design-Studio-Knowledge-Base/HOWTO-Install-update-from-3rd-party-ve...

Thanks,

Lukas

0 Kudos
Reply

3,618 Views
Zeeico
Contributor II

Hi Lukas,

I had some issues trying to install a new version of the plugin as my company's firewall was getting in the way. I can however get updates from S32 Design Studio for Power Updates, and the GNU E200 PEMicro Interface Debugging Support does show up here. When I tried to install that one, S32 told me that I had a newer one installed. 

I have submitted a ticket with my company's IT system, but in the meanwhile is there anyway to download the package and perform the update manually? Or is the one I have currently installed, which is version 2.0.4.202103012147, good enough?

Thanks.

0 Kudos
Reply

3,571 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Now I realized that that you probably used ICDPPCNEXUS.EXE because you was talking about reset script. My fault, I should provide more details what to do. Let me describe how to use the Pemicro utility in detail:

1. Run c:\PEMicro\PKGPPCNEXUSSTARTER\progppcnexus.exe

2. Select this PCP file:

lukaszadrapa_0-1640086819790.png

 

3. Double click on Erase module. You should get confirmation in the status window:

lukaszadrapa_1-1640086865587.png

 

4. Double click on Blank check module. You should also get confirmation in the status window:

lukaszadrapa_2-1640086913561.png

 

Is this working on your side? If yes, could you try it in S32DS now?

I checked the version of the plugin in my S32DS and it is the same, there should be no problem with this.

Regards,

Lukas

0 Kudos
Reply

3,543 Views
Zeeico
Contributor II

Hi Lukas,

Thanks a lot for the information. Unfortunately, I am currently on winter break (I am an intern and cannot work during break) and will not be able to work on it until mid January at the earliest. I will try your solution as soon as I get back and let you know then.

Thanks for your help, and happy holidays!

0 Kudos
Reply