Programming TWR-K70F120M using keil

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

Programming TWR-K70F120M using keil

Jump to solution
2,007 Views
vibhu
Contributor III

Hi Guys,

I am new to freescale/nxp contollers. I got twr-k70f120m kit and twr-ser board. I tried the demo given in the manual TWRK70F120MQSDLAB.pdf which I have attached below.  It worked as mentioned.

Now I wanted to program the controller using keil uvision Is it possible ? or are there any other free software which can be used to program the board ? I prefer using Keil, So if there is any document which explains how to program using keil it would be helpful. 

I tried copying the example blinky code given in the boards example in keil.

I dont know which debugger to choose.

I chose #pemicro Debugger 

 capture1.PNG

And, Selected the device as below and tried to load the code.

capture2.PNG

It is showing error.

Capture3.PNG

Please Help Guys,

Thanks.

0 Kudos
1 Solution
1,674 Views
robertboys
Contributor IV

UPDATE:

My K70 board needed a P&E firmware update.

I was only able to do this on a Windows 7 machine.

Then, I was able to reinstall the P&E drivers on my Win 10 and it all works correctly now.

There were some issues a while ago about updating Freescale boards with Win 10.

Bob Boys

Arm/Keil

San Jose, California

View solution in original post

0 Kudos
15 Replies
1,676 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Vibhu Sounder,

Considering you are new to freescale/nxp controllers, MCUXpresso SDK supported MCU or TOWER board are recommended.

TOWER board SDK supported.png

Unfortunately the TWR-K70F120M(K60 K70 120MHz) are not in the support list of MCUXpresso SDK.
For the MCUXpresso SDK supported controllers, you can direct get Keil MDK based examples.

select Keil MDK IDE.png

The way you select debugger seems correct, maybe caused by wrong project setting.
I didn't found Keil project that you mentioned, so can't test it on my side.

You can have a look at this free software: Overview of MCUXpresso IDE v10.2.0

Best Regards,

Robin

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,677 Views
vibhu
Contributor III

Hi Robin_Shen,

Thank you for suggesting MCUXpressoSDK, But my project is on TWR-K70F120M and I have already purchased it. So I have to use that only. Sorry.

The Keil example which I told earlier can be found below.

Capture4.PNG

Is the device selection in the below screenshot correct ?

On the top of the board it is given MK70FN1M0VMJ123N96B

capture2.PNG

Thanks :smileyhappy:

PS: I have directly connected the USB from PC to Mini USB to the board.

       Is that the correct way to connect or should I use any debugger kind of thing ?

0 Kudos
1,677 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

I am using Keil MDK V5.23.
I can import the Blinky example now.
After build the example, the on board PEMicro Debugger is able to work.

Blinky.png
Here is the default setting of debug configuration.

Blinky PEMicro Debugger.pngPE Connection Manager.png

Best Regards,

Robin

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,677 Views
vibhu
Contributor III

Hi Robin_Shen,

I am using keil version 5.22.0.0

Capture4.PNG

I imported the example code but the debugger is not working.Capture6.PNG

It is throwing that error whenever I click on the debug icon.

I have the same configuration as you mentioned.

Capture2.PNG

However the highlighted part seems to re-enable itself when I disable it. Is there any problem because of it ?

Capture3.PNG

The P&E connection manager seems to be able to detect the port of my device, If I disconnect my device it is showing no port found. So what else can be the issue ? Is there anything else which I need to install before using keil ?

Or should I download anything else to the board before making it work with Keil?

Thanks :smileyhappy:

Vibhu.

0 Kudos
1,677 Views
robertboys
Contributor IV

Hello

If you can find a different debug adapter such as Keil ULINK, Segger J-Link or external LPC-Link, you will have less trouble.  You need to be able to connect to the CoreSight 20 pin Connector J11.

Also - you can get Serial Wire Viewer data trace with ULINK or J-Link.

If you purchase a Keil ULINK-Pro - you will also get ETM Instruction Trace which adds Performance Analysis and Code Coverage.

SWD Serial Wire Debug is a two wire alternative to JTAG (4  or 5 wires) 

Their performance is generally about the same.

Here is a lab I wrote for the TWR-K64 - it will have some useful information for you.

www.keil.com/appnotes/docs/apnt_288.asp

I tried to connect with P&E and MDK 5.28 but P&E fails or me.  I will try again tomorrow.

You will find many cool features in Keil uVision.

Thanks

Bob Boys

Arm/Keil

0 Kudos
1,675 Views
robertboys
Contributor IV

UPDATE:

My K70 board needed a P&E firmware update.

I was only able to do this on a Windows 7 machine.

Then, I was able to reinstall the P&E drivers on my Win 10 and it all works correctly now.

There were some issues a while ago about updating Freescale boards with Win 10.

Bob Boys

Arm/Keil

San Jose, California

0 Kudos
1,674 Views
vibhu
Contributor III

Hi Robert,

Thank you for your suggestion.

I was first using a win 7 system only I updated the firmware but still I was not able to program it. So then I changed to windows 10 and now I am able to program it using P&E method mentioned in the document of your previous reply.

Thanks :smileyhappy:

Vibhu.

0 Kudos
1,677 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Vibhu,

Please try to install: Freescale Kinetis OSJTAG Drivers V1.20

Best Regards,

Robin

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,677 Views
vibhu
Contributor III

Hi Robin,

I had already installed the drivers which you have mentioned.

I again installed them and the problem is still there.

Keil is throwing the same error.

Thanks :smileyhappy:

Vibhu.

0 Kudos
1,677 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Vibhu,

Do you consider using the free software: CodeWarrior IDE?

KINETIS_120MHZ_SC mentioned by my colleague in TWR-K70P120M demo code will help you learn this MCU quickly.

 

Best Regards,

Robin

0 Kudos
1,677 Views
vibhu
Contributor III

Hi Robin,

Is CodeWarrior IDE free ?

Or is it a trial version for a limited period of time ?

Does it have any restrictions ?

And if you are able to flash the code using keil why am I not able to use it ?

Thanks :smileyhappy:

Vibhu.

P.S. will the version of keil matter ?

0 Kudos
1,677 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

If you have the same version keil MDK, then you can install it and have a try to test it.

0 Kudos
1,677 Views
vibhu
Contributor III

Hi Robin,

Thank You for your suggestion.

I downloaded the latest version of keil - 5.28 and tried to flash the code to twr k70 and now I am able to flash the code to the board. The example LED blink is happening.

Now how do I create a new project ? I want to test the UART and other peripherals using keil itself. Is there any example for keil involving k70 board ? How do I get started ?

Thanks a tonne :smileyhappy:

Vibhu.

0 Kudos
1,677 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Vibhu,

Glad to hear that you can flash the code using Keil now.
But unfortunately there almost no example for Kinetis K70 120MHz using Keil.
So I recommend you using CodeWarrior IDE.

----------------------------------------------------------------------

KINETIS_120MHZ_SC mentioned by my colleague in TWR-K70P120M demo code will help you learn this MCU quickly.

Best Regards,

Robin

0 Kudos
1,677 Views
BlackNight
NXP Employee
NXP Employee

>>Is CodeWarrior IDE free ?

There is a code size limited version. It is called 'Special Edition'.

>>Or is it a trial version for a limited period of time ?

Yes, it is called 'Evaluation'.

>>Does it have any restrictions ?

The 'Professional' does not have any restrictions.

See https://www.nxp.com/docs/en/fact-sheet/950-00437.pdf 

And as well CodeWarrior® Embedded Software Development Tools | NXP 

I hope this helps,

Erich

0 Kudos