In K60DN512VMD100, SIM_SOPT6 exists or not? And two copies of PE_low_level_init ?

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

In K60DN512VMD100, SIM_SOPT6 exists or not? And two copies of PE_low_level_init ?

865 Views
jpa
Contributor IV

I'm trying to bring up my own design and cloned a BSP for the Tower Kit K60DN512VMD100.  I'm building under GCC, and MQX 4.0.2.

During startup, I end up in the default ISR.  Tracing, I found that I jump there while in PE_low_level_init, while stepping over code that sets PMC_LVDSC1. 

The line just previous to that, however, sets SIM_SOPT6 = 0x00U.  Curiously, the documentation for the K60 (RM rev 2, June 2012) has no SOPT6, just 5 and 7. 

What gives?  Is MQX writing to an unsupported register?  Or just an undocumented one?

Also, I've noted that there are two functions called "PE_low_level_init", one in "bsp_cm.c" and one in Cpu.c in "Generated Code", although it should be noted that both set SIM_SOPT6.  Have I done something to screw up the BSP ?  It appears that the "Generated Code" version appears to win, or is at least what Eclipse tells me is being executed during stepping. 

John

Tags (3)
0 Kudos
5 Replies

531 Views
santiago_gonzal
NXP Employee
NXP Employee

Hello John,

What BSP did you use to generate your own BSP? the one of TWR-K60N512 or TWR-K60D100M? Because K60N512 has version 1 silicon and K60D100M version 2. So probably if you use K60D100M BSP as a reference you won't have any problems.

Regards,

Santiago

0 Kudos

531 Views
miguelpalos
Contributor II

Hi John,

The second function "PE_low_level_init" appear because:

The BSP has files with basic configuration, among which is the "bsp_cm"  which has some functions for setting the clock & initialization HW.

And when you use Processor Expert to make modifications to these configurations, in the generated code create functions that already exist in the archives of the BSP.

But this is not a problem, because the PE is responsible for create some macros to disable the code from initial BPS files that are no longer used.

A good reference for this is:

<MQX_install_dir>\doc\tools\cw\"Howto_SetupKinetisClock_UsingPE.pdf"

Regards.

Miguel.

531 Views
jpa
Contributor IV

As an update...I tried the (now) obvious and commented out the line setting SIM_SOPT6...and everything works.  No more halt in the ISR, and blinky lights abound.

So the question remains why MQX and ProcessorExpert both seem determined to set this apparently non-existent register, and why it wasn't a problem with the TowerKit board?

John

0 Kudos

531 Views
carlos_chavez
NXP Employee
NXP Employee

Hi John,

The SIM_SOPT6 register was removed when moving from Revision 1 to Revision 2 of the silicon.  The change can be found in our Migration Guide below:

http://cache.freescale.com/files/32bit/doc/app_note/AN4445.pdf

It appears that MQX and PE still reference this old register.  I will submit a request to those teams in order to correct that.  As for why there are two functions called "PE_low_level_init", I do not know.  I will have to follow up with those respective teams.

I hope that this helps explain the issue that you observed.

BR,

Carlos

531 Views
jpa
Contributor IV

Carlos,

Are there any other known MQX bugs related to Rev 2 silicon?  My USB device app that was working on the TowerKit board is halting with USB_RESETs, for instance, and while I note that there were some changes to the USB, it's not clear that it would really affect my application, given that I'm not running off the regulator or (intentionally) going into standby.   {Edited to strike out previous line...this was caused by old client code on my end.}  Surely I'm not the first to use MQX with Rev 2 silicon?

John

0 Kudos