Problems running demo examples from FRDM-KL05Z on Keil uVision5 MDK-ARM

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

Problems running demo examples from FRDM-KL05Z on Keil uVision5 MDK-ARM

Jump to solution
2,029 Views
rflmota
Contributor II

Hey all!

I've bought a FRDM-KL05Z development board and I'm trying to setup the development environment in Keil uVision MDK-ARM v5.15 by trying to run the demo examples included in the FRDM-KL05Z Sample Code Package.

First I've loaded OpenSDA bootloader with PEMicro FRDM-KL05Z Mass Storage/Debug App v1.14 and I'm able to program sucessfully the board from Keil uVision.

Capture.PNG

However, when i try to debug a simple project like LED_Blink on uVision, I'm unable to run the code, it always halts in the HardFault_Handler at beginning and I can't figure out why.

Capture.PNG

Can somebody please help me figure out the problem and point me where I can get more information about the reason the program is halting?

Many thanks for your help and attention!

Best regards,

Labels (1)
1 Solution
1,811 Views
mjbcswitzerland
Specialist V

Ricardo

I just downloaded the package and opened the "LED_Blink" project.

It is set up for the KL25 and not the KL05 - if you change the device to suit it's memory map is then correct.

Regards

Mark

Kinetis: µTasker Kinetis support

KL05: µTasker FRDM-KL05Z support

For the complete "out-of-the-box" Kinetis experience and faster time to market

View solution in original post

8 Replies
1,811 Views
mjbcswitzerland
Specialist V

Hello Ricardo

There is not enough information shown to see what the problem is (eg. you haven't shown the register values).

If you don't make progress there is a complete solution at µTasker FRDM-KL05Z support including uVision5 support for your board (as well as [approx.] real-time KL05 and FRDM-KL05Z board simulation).

Regards

Mark

Kinetis: µTasker Kinetis support

KL05: µTasker FRDM-KL05Z support

For the complete "out-of-the-box" Kinetis experience and faster time to market

1,811 Views
rflmota
Contributor II

Which registers should I show you to help me figure out the problem?
Capture.PNG

Are these enough?

Thank you very much for your help mjbcswitzerland​ !

0 Kudos
Reply
1,811 Views
mjbcswitzerland
Specialist V

Hello Ricardo

All looks correct at that location.

Are you sure that it will crash at this point or does it do so later?

Regards

Mark

Kinetis: µTasker Kinetis support

KL05: µTasker FRDM-KL05Z support

For the complete "out-of-the-box" Kinetis experience and faster time to market

0 Kudos
Reply
1,811 Views
rflmota
Contributor II

Hi mjbcswitzerland​,

Here are all the steps of execution in sequence, from Reset state until the program halts:
1.PNG2.PNG3.PNG4.PNG5.PNG

Thank you very much for your help!

0 Kudos
Reply
1,811 Views
mjbcswitzerland
Specialist V

Ricardo

Your stack pointer is set up incorrectly.

It is at 0x1ffff420 but the KL05 (largest version with k RAM) has RAM between 0x1ffffc00 and 0x20000c00.

pastedImage_0.png

Regards

Mark

Kinetis: µTasker Kinetis support

KL05: µTasker FRDM-KL05Z support

For the complete "out-of-the-box" Kinetis experience and faster time to market

0 Kudos
Reply
1,811 Views
rflmota
Contributor II

How can i solve it then?

Since these code examples were downloaded from Freescale's website - FRDM-KL05Z Sample Code Package  - weren't they supposed to run out of the box?! :\

0 Kudos
Reply
1,812 Views
mjbcswitzerland
Specialist V

Ricardo

I just downloaded the package and opened the "LED_Blink" project.

It is set up for the KL25 and not the KL05 - if you change the device to suit it's memory map is then correct.

Regards

Mark

Kinetis: µTasker Kinetis support

KL05: µTasker FRDM-KL05Z support

For the complete "out-of-the-box" Kinetis experience and faster time to market

1,811 Views
rflmota
Contributor II

Worked perfectly! Thank you very much for your help and attention mjbcswitzerland​ ! :smileywink:

0 Kudos
Reply