Serious Bug(s) in Kinetis Example Code!! Warning!

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Serious Bug(s) in Kinetis Example Code!! Warning!

2,219件の閲覧回数
emh203
Contributor II
Beware! http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=K40&nodeId=01624698C9&fpsp=1&tab=Desi... CW_MCU_V10_1_EXAMPLES: CodeWarrior MCU 10.1 Software Examples.. Size (K): 6832 Format: zip Rev #: 10.1 Modified: 6/7/2011 There is a bug in the silicon for all of the kinetis chips. (Errata e2448). All of the example programs I tried with the K60 board I have hang in the PLL_init() function. Whoever ported these from the IAR version forgot to implement this workaround: https://community.freescale.com/thread/79526 I filed a support case. 1-764919891
0 件の賞賛
6 返答(返信)

896件の閲覧回数
emh203
Contributor II

Here is the work around.    I tested it with 2 of the projects.

 

1.)   Modify the linker command file to add this:
_ROMCodeToCopy = ___ROM_AT + SIZEOF(.app_data); 
.copyToRAM: AT(_ROMCodeToCopy) { 
. = ALIGN (0x4); 
__START_COPYTORAM = .; 
*(CopyToRAM) 
__END_COPYTORAM = .; 
} >> m_data
2.)  You have to add some pragmas around code you want to execute from ram (as code warrior does not support the __ramfunc keyword like IAR).    The set_sys_dividers in the MCG.c file needs to run from ram.
#pragma section CopyToRAM begin
void set_sys_dividers(uint32 outdiv1, uint32 outdiv2, uint32 outdiv3, uint32 outdiv4)
{
..
...
..

}

 

#pragma section CopyToRAM end

0 件の賞賛

896件の閲覧回数
emh203
Contributor II

BTW:  This fixed applies to projects that execute from the FLASH.

0 件の賞賛

896件の閲覧回数
jimtrudeau
Senior Contributor I

Just following up - we do pay attention! In the abence of any specifics, we tested them all and haven't been able to replicate the problem, running in both RAM and flash. We're still trying to nail down if this is a replicatable problem, but so far, have not been successful duplicating this.

 

We genuinely appreciate reports like this. THis is why forums are so cool - if there are problems, you help us find them. Even if it turns out to be a false alarm, that's OK. Sometimes that smell of smoke turns out to be a real fire. It definitely pays to check.

0 件の賞賛

896件の閲覧回数
emh203
Contributor II

Sorry Jim,   I just saw this. 

 

I noticed that the exmaple programs now seem to have a __relocate_code__ macro to handle e2448.

 

Let me check everything again.

 

Its wierd,  not all chips exhibit e2448.....

 

 

0 件の賞賛

896件の閲覧回数
emh203
Contributor II

Jim:

 

Also could you have your apps guy look into the linker files?   Here is the issue:

 

in the KINETIS_SC examples, there are a bunch of linker files for the example code.   But these linker files are alot different from the ones used when you create a "bare bones" project in code warrior, often making code porting difficult if the have to work around e2448.

 

For example compare the 256KB_flash.lcf in the samples to what codewarrior by default generates.   Alot of the exmaple code needs the .relocate_code section but the default codewarrior linker file does not have this.   It would nice if these were all in agreement.

 

0 件の賞賛

896件の閲覧回数
jimtrudeau
Senior Contributor I

Can you identify which particular examples you had the problem with? I'll point them out to the apps team and we'll test them and fix them if required. I sit about 50 meters from the apps manager. :smileyhappy: These were all tested on the CodeWarrior MCU 10.1 tools, so this should not be an issue. But... let's see what's happening.

 

 

0 件の賞賛