KL25Z(with USBDM Firmware) is not programming the target device

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

KL25Z(with USBDM Firmware) is not programming the target device

Jump to solution
1,584 Views
alicankurutepe
Contributor II

Hello All,

I am trying to program my custom board with kl25z-freedom.

Custom board has MKV31F128VLH10.

i did install USBDM and its drivers. After that i uploaded the usbdm sda firmware to kl25z.

to prevent unwanted interference i uploaded BootLoopMKL.elf file to on board mcu of kl25z.

everything was perfect. then i cut the jumper J11 on kl25z and made connections between kl25z and my sutom board.

i connected swdio, swclk and gnd and jtag_reset.

After connections are made i did power my board up and in arm programmer i clicked on detect device. flawlessly, probe detected the

MKV31F128VLH10. to make sure i did mass erase the device. erasing was successful.

But when it comes to programming flash, it fails like that in the picture

Untitled.png

But its confusing that verify flash seems working

Untitled2.png

1 Solution
1,094 Views
pgo
Senior Contributor V

Hi Alican,

I have found an error in the device description used by USBDM for the  MKV31F128M10 but I am unsure if it would account for the errors you are seeing.

Could you use replace the file "C:\Program Files (x86)\pgo\USBDM ....\DeviceData\arm_devices.xml" with the attached file and see if it makes any difference?

You will probably need to select the EraseMass option,

Thanks

View solution in original post

6 Replies
1,091 Views
pgo
Senior Contributor V

Hi Alican,

As usual I don't have a suitable chip for testing - The software was checked on a MKV31F256VLH12 which is similar.

Attached is the minimal circuit used.

Could you try programming using the debug version  of the software which will create a log file in %APPDATA%\usbdm directory.

This may indicate where the problem lies.

I will check the data sheets and see if I can find a difference that would account for the problem.

Also can you provide the image you are programming for testing in case there is something specific to that file that is triggering a bug?

bye

1,084 Views
alicankurutepe
Contributor II

Hello Pgo

Thank you for reply.

Only difference between your schematic and mine, i connected to VBAT nothing (there is a battery holder but i did not mount the battery yet)

This time something different happened. usbdm couldnt detect chip also( with same error "Cannot read from target")

After some trials i got this message from "Detect Chip" this might be an useful tip

Untitlednew.png !

also please find the attached log file and one of the image file that i use for testing.

(log file might be a bit long that i did some trials:) sorry for mess )

thank you again.

0 Kudos
1,084 Views
pgo
Senior Contributor V

Hi Alican,

I'm sorry I should have been more specific about what to do.

The error you are seeing now is due to the device being fully erased.  This will cause various problems with programming the device related to watchdog time-out and/or illegal instruction trap - both of which causes the chip to continuously reset. Hence the message about target reset pin timeout.

Could you try programming the chip again and select EraseMass.  This is the only reliable way of connecting to a target in the above state.

This will (probably) re-produce your original error.

Please do the minimum steps to reduce the size of the log file:

  1. Load your file
  2. Manually select the target device
  3. Select Unsecure or Smart for Security
  4. Program with EraseMass selected

As a separate test - you can also try

  1. Load your file
  2. Manually select the target device
  3. Do Mass Erase Now
  4. Select Unsecure or Smart for Security
  5. Program with EraseMass selected

It is also possible that Detect Chip is upsetting it. It has to probe the device multiple times which may be unpredictable.

Thanks - sorry for the bother.

I will try programming the image you provided tonight - I don't have a suitable chip with me.

bye

1,082 Views
alicankurutepe
Contributor II

Hello Pgo

Thank you again.

This time i did not use Detect chip function as you said. unfortunetely it did not work.

i got another error this time.

Untitled2.png

i also tried some combinations in advanced tab bdm parameters. but i got nothing.

I attached my schematic file also in addition to log file that i may have been missing a point in schematic.

Please note that i bypassed SN74LVC and connected the reset pin of usbdm directly to  the net MCU_RESET_L.

Have a nice weekend.

0 Kudos
1,095 Views
pgo
Senior Contributor V

Hi Alican,

I have found an error in the device description used by USBDM for the  MKV31F128M10 but I am unsure if it would account for the errors you are seeing.

Could you use replace the file "C:\Program Files (x86)\pgo\USBDM ....\DeviceData\arm_devices.xml" with the attached file and see if it makes any difference?

You will probably need to select the EraseMass option,

Thanks

1,081 Views
alicankurutepe
Contributor II

Hello pgo

Thank you for your efforts.

At least it seems working after replacing the xml file.

i did a few trials but it did not fail proframming with mass erase before programming.

last.png

i will also share anything notable while working on.

thanks again.

0 Kudos