How to Run/Debug ProcessorExpert example?

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

How to Run/Debug ProcessorExpert example?

Jump to solution
2,197 Views
markusbraitner
Contributor IV

Hi,

 

I'm trying to evaluate ProcessorExpert, but debugging my code always stops at PE_DEBUGHALT(); in cpu.c when clicking "run" and nothing seems to be executed. This is the case also with the example (see below) that came with CodeWarrior - execution stops at PE_DEBUGHAL(); and no LEDs are activated/nothing is sent over the serial interface.

 

One line above in the code it says

 

/* This code can be changed using the CPU component property "Build Options / Unhandled int code" */

 

I tried this by commenting the corresponding code, but execution stopped at the "}" in the following line then...

 

I'm using

- TWR-K60D100M tower system with TWR-SER

- CodeWarrior for MCU, Version 10.5, Build Id 130916

- ProcessorExpert example from \CW MCU v10.5\MCU\CodeWarrior_Examples\Processor_Expert\Kinetis\TWR-K60N512\TSI

 

Has anybody got an idea? Maybe again a problem with the example being incompatible with the CW version?

 

Greetings from Vienna,

 

Markus

Labels (1)
1 Solution
1,714 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Markus:

The reason is simple: in most cases the code developed for TWR-K60N512 will not be compatible with TWR-K60D100.

These 2 boards have different K60 silicon revisions (refer to application note AN4445). So for example, in the TSI project, you will find inside of the "PE_low_level_init()" function, a line of code writing to SIM_SOPT6. This register no longer exists in revision 2.x of K60 100 MHz silicon, and therefore execution enters a hard fault exception. Try debugging step-by-step and you will confirm this.

The sample code available for TWR-K60D100 is in the package called "KINETIS512_V2_SC" under Snippets, Boot Code, Headers, Monitors, etc.., in the next link:

K60_100: Kinetis K60 Ethernet Crypto 100 MHz MCUs

In the package there is a TSI example code, although it was not made with processor expert.


Regards!
Jorge Gonzalez

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

View solution in original post

0 Kudos
7 Replies
1,715 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Markus:

The reason is simple: in most cases the code developed for TWR-K60N512 will not be compatible with TWR-K60D100.

These 2 boards have different K60 silicon revisions (refer to application note AN4445). So for example, in the TSI project, you will find inside of the "PE_low_level_init()" function, a line of code writing to SIM_SOPT6. This register no longer exists in revision 2.x of K60 100 MHz silicon, and therefore execution enters a hard fault exception. Try debugging step-by-step and you will confirm this.

The sample code available for TWR-K60D100 is in the package called "KINETIS512_V2_SC" under Snippets, Boot Code, Headers, Monitors, etc.., in the next link:

K60_100: Kinetis K60 Ethernet Crypto 100 MHz MCUs

In the package there is a TSI example code, although it was not made with processor expert.


Regards!
Jorge Gonzalez

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

0 Kudos
1,714 Views
markusbraitner
Contributor IV

Hi Jorge,

thank you for your answer - this explains something, of course... Thanks for the helpful reference to AN4445!

I had already found out that the program gets stuck in an ISR due to an hardware fault interrupt caused in PE_low_level_init(), but I had not yet found the line causing the problem. Now it is clear to me why it couldn't work - thank you!

So is there another processor expert example available for my board?

Greetings from Vienna,

Markus

0 Kudos
1,714 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hi Markus:

I am glad my explanation helped. I think there are no processor expert examples ready for your board, but maybe you can take those existing for the TWR-K60N512 and do the next:

- Create new project with PE support.

- Copy the components to your new project.

- Copy the application source files.

Give a check to the next tutorial by Erich:

Copy of Processor Expert Components | MCU on Eclipse

Hope this helps!


Regards!
Jorge Gonzalez

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

1,714 Views
markusbraitner
Contributor IV

Hi Jorge,

thanks for the hints and the link to Erich's tutorial! With some other tutorial from Erich, I have managed to create a new project with PE from the scratch. Thanks again for your help!

Greetings,

Markus

1,714 Views
BlackNight
NXP Employee
NXP Employee

I suggest that you use 'own handler for every' in the build settings (see/search for this in http://mcuoneclipse.com/2012/02/20/oh-my-an-interrupt/).

That way you know which interrupt is firing.

Erich

1,714 Views
markusbraitner
Contributor IV

Hi Erich,

thank you for your extremely fast answer! I'll immediately try your suggestion!

Kind regards,

Markus

0 Kudos
1,714 Views
markusbraitner
Contributor IV

Hi Erich,

just wanted to say thank you for your excellent tutorials on your blog - they helped me a great deal to get started with PE! Thank you very much!

Greetings from Austria,

Markus

0 Kudos