KSDK 1.3 hello_world demo crashes on TWR-K60N512

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

KSDK 1.3 hello_world demo crashes on TWR-K60N512

Jump to solution
1,778 Views
surrealist14
Contributor III

Hi Folks,

 

I have A TWR-K60N512 KIT with the TWR-K60N512, two elevator boards, and the TWR-SER board.  Using KSDK 1.3, I am simply trying to build, load, and run the hello_world demo using IAR Embedded Workbench 7.40.3.  I am using a J-Link pod from Segger as my JTAG connection.

 

The ksdk_platform_lib project builds fine, no errors.  The hello_world project also builds fine, no errors.  I can download the project into Flash without errors.

 

However, when the code gets into CLOCK_HAL_PrepareOsc(), it fails with a HardFault.  This function is in fsl_mcg_hal.c.  The failure appears to be happening at the line:

 

if (MCG_BRD_C2_EREFS(base))

 

In the disassembly window, I can see the following code:

 

    MCG_BWR_C7_OSCSEL(base, setting);

       0x1176: 0xf114 0x000c  ADDS.W    R0, R4, #12             ; 0xc

       0x117a: 0x0140         LSLS      R0, R0, #5

       0x117c: 0xf110 0x4084  ADDS.W    R0, R0, #1107296256     ; 0x42000000

       0x1180: 0x7005         STRB      R5, [R0]

    if (kMcgOscselOsc == setting)

       0x1182: 0xb2ed         UXTB      R5, R5

       0x1184: 0x2d00         CMP       R5, #0

       0x1186: 0xd10c         BNE.N     0x11a2

        if (MCG_BRD_C2_EREFS(base))

       0x1188: 0x1c60         ADDS      R0, R4, #1

       0x118a: 0x0140         LSLS      R0, R0, #5

       0x118c: 0xf8df 0x1348  LDR.W     R1, [PC, #0x348]        ; [0x14d8] 0x42000008 (1107296264)

       0x1190: 0x5c08         LDRB      R0, [R1, R0]

       0x1192: 0xb2c0         UXTB      R0, R0

       0x1194: 0x2800         CMP       R0, #0

       0x1196: 0xd004         BEQ.N     0x11a2

            while(!CLOCK_HAL_IsOsc0Stable(base)){}

       0x1198: 0x0020         MOVS      R0, R4

       0x119a: 0xf7ff 0xffc8  BL        CLOCK_HAL_IsOsc0Stable  ; 0x112e

       0x119e: 0x2800         CMP       R0, #0

 

Whenever I try to execute the code at 0x118c, the code immediately goes to HardFault_Handler at location 0xe66.

 

Any idea what could be causing this?  Not sure if I have something configured incorrectly in board.h, or if I have incorrect jumper settings on either the processor board or the serial board.

 

Any help is greatly appreciated!

 

Scott

Labels (1)
0 Kudos
Reply
1 Solution
1,278 Views
DavidS
NXP Employee
NXP Employee

Hi Scott,

The TWR-K60N512 (no longer available) is old silicon and the newer silicon is on TWR-K60D100M.

KSDK_1.3 is only supporting the newer silicon so I think that is your issue.

There is appnote discussing the differences if you want to try and reverse engineer the code.

Regards,

David

View solution in original post

0 Kudos
Reply
6 Replies
1,278 Views
victorferleyper
Contributor I

I have the same problem too. ;(  I bought my TWR-K60N512 -IAR  KIT in july 2012.

0 Kudos
Reply
1,278 Views
surrealist14
Contributor III

Hi Victor,

It's rather sad that Freescale (now NXP) doesn't provide any reasonable upward migration for those of us who got stuck with a kit based on broken silicon.  They should institute an exchange program to keep people interested in using their platforms and silicon on new projects.

I'm not sure that anyone is really listening, though... I didn't get any real help on the KBOOT port for the K60 from Freescale, only from a very kind and thorough third party, as I mentioned above.

Best wishes, and if you hear of an inexpensive way to upgrade your K60 TWR board, please share it!  Will do the same.

Scott

0 Kudos
Reply
1,279 Views
DavidS
NXP Employee
NXP Employee

Hi Scott,

The TWR-K60N512 (no longer available) is old silicon and the newer silicon is on TWR-K60D100M.

KSDK_1.3 is only supporting the newer silicon so I think that is your issue.

There is appnote discussing the differences if you want to try and reverse engineer the code.

Regards,

David

0 Kudos
Reply
1,278 Views
surrealist14
Contributor III

Thanks David,

That would certainly explain the behavior.  I bought the system second-hand, and don't think the seller even knew that it was a discontinued board.  I certainly didn't think to ask, and I can't afford the time to reverse engineer anything.  I just wanted to use a known-good platform to do some evaluation for work.

It would be nice if Freescale had a program to allow purchasers of obsolete evaluation boards to trade up to the latest, supported version.  I'll have to look for another TWR-K60D100 board.  I wonder if the TWR-SER or the elevator boards have been changed, too.

Very frustrating, but I do appreciate your help and your prompt answer.

Best regards!

Scott

0 Kudos
Reply
1,278 Views
DavidS
NXP Employee
NXP Employee

Hi Scott,

I will make the suggestion of board upgrading to our marketing team.  They are always looking for new things to do!

I'd recomment looking at the FRDM-K64F Freedom board.

It is very reasonable on price at $35.

Regards,

David

1,278 Views
surrealist14
Contributor III

Hi David,

Can you ask your marketing team if we can work out a deal where I send them back my TWR-K60N512 and they replace it with a functional TWR-K60D100M?  Unfortunately, the TWR-K60N512 is only good for a paperweight...

Thanks for your help,

Scott

0 Kudos
Reply