Trouble running demos for TWR-K64F120M

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

Trouble running demos for TWR-K64F120M

1,248 Views
drew_k
Contributor III

Hi,

I'm trying to get some of the demos for the TWR-K64F120M up and running to familiarize myself with the environment before I get started on actual projects and I'm running into trouble actually programming the board. Well, running the program once I've flashed it.

Using Kinetis Design Studio 2.0.0 and KSDK 1.1.0, I followed the steps to build the KSDK libraries and I've imported the Hello World demo from KSDK_PATH/Demos/hello_world/kds/twrk64f120m. I then cleaned and built the project which finished successfully. I plugged in my TWR board to the OpenSDA/Power usb port and selected the pre-configured debug profile "hello_world_twrk64f120m debug pne" to debug. No errors occur during the programming but I do get a "Warning 17927. Target MCU mismatch. Download performance limited" message in my console:

Capture.PNG.png

Execution breaks upon entering the main function as expected, but as soon as I hit continue I immediately break in the Reset_Handler section of startup_MK64F12.s (line 328). Trying to continue just loops me back to the start of the Reset Handler. Additionally, I'm not seeing the "Hello World" output in my serial terminal (set to 115200 baud rate on COM 5. Verified COM5 is the port associated with the board and is using the "OpenSDA - CDC Serial Port" driver according to Device Manager) - I've also verified that the jumpers on J10 and J15 are set to route UART1 through the OpenSDA chip.

I've tried updating the OpenSDA firmware from P&E Micro but that didn't help.

I'm having this reset handler loop problem with all of the demos so it's not restricted to just the Hello World setup.

Is there something I'm missing here? I would have expected the demos to work out of the box without any issue.

Any and all suggestions/help appreciated!

-Drew

0 Kudos
8 Replies

696 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Drew Kelley:

I just tried the Hello World example with TWR-K64 and it worked out of the box, so I am guessing the problem is in your board.

Have you tried to debug step-by-step to see where the MCU resets?

For quick reference I place below a picture of my board, so you can try again replicating my jumper configuration.

TWRK64.jpg


Regards!,
Jorge Gonzalez

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

696 Views
drew_k
Contributor III

Jorge,

So the only difference on my board was the power selector on J29. I was set to the default pins 1&2 which pulls power from the USB reg. I switched over the 5-6 like you have just to make sure and there was no change.

As for the step by step debug - it's not consistent at where it resets. Sometimes it resets in the CLOCK_SYS_EnablePortClock function of fsl_clock_MK64F12.c, and sometimes not. So I'm guessing you're right, there's something a little wrong with the hardware here.

Thanks!

Drew

0 Kudos

696 Views
drew_k
Contributor III

Also I stumbled across this thread "No source available for "0x530" error, and found a solution to the "Target MCU Mismatch" by updating the OpenSDA firmware to the DEBUG-FRDM-K64F_Pemicro_v108b_for_OpenSDA_v2.1.bin (which I hadn't tried originally because I'm on a TWR board not a Freedom board, but oh well).


However I'm still getting the reset issues.

-Drew

0 Kudos

696 Views
drew_k
Contributor III

Ok, so I'm also having trouble programming/running the TWR-K60D100M that I have with the hello_world demo application so I think the issue is something with my P&E Micro driver/KSDK/KDS installation. I'm going to wipe all of that from my machine and reinstall everything. Hopefully that will clear things up.

-Drew

0 Kudos

696 Views
drew_k
Contributor III

Ok, well that didn't work at all. Same problem with seemingly random resets. I did discover that it doesn't seem to happen at all if I strip the main function down to nothing but the while loop (no receive or putchar inside). So there's something weird with the hardware_init() function that's causing this issue. I just don't know why I cant get either the TWR-k64f120m or TWR-k60D100M working.

Can you send me a zip of the project you ran successfully? Just to make sure?

Thanks,

Drew

0 Kudos

696 Views
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Drew:

I am attaching the zip (unzip in the same place: C:\Freescale\KSDK_1.1.0\demos\hello_world\kds). However I don't think it will make any difference.

Since you have problems with TWR-K60D100 too, sounds like the problem is with the USB drivers. Some things I would recommend you to do:

1- Create a new empty project in KDS for either of the boards and check if you can debug without losing connection.

2- If you placed any breakpoints, delete those. There were some issues with GDB: Failed to Debug with GDB: Breakpoints or Expressions on non-existing Locations | MCU on Eclipse

3- Try reinstalling P&E Micro drivers: Fixing the USB Drivers | MCU on Eclipse

And last, that binary you used is for OpenSDA v2.1, I am not sure if your TWR-K64 has OpenSDA v2.0 or v2.1. Just in case try with the attached P&E SDA file.


Regards!,
Jorge Gonzalez

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

0 Kudos

696 Views
drew_k
Contributor III

Just got another one of the TWR-K64 boards in today and it worked perfectly out of the box. Definitely a defective board.

0 Kudos

695 Views
drew_k
Contributor III

Well unfortunately neither of those helped me any. I reflashed the OpenSDA firmware with the one you sent and tried debugging your project, both to no avail.

As far as the TWR-k60d100m is concerned. I fixed that issue. Someone had messed with the clock source jumper prior to my getting the board so I was sticking in the init code on the source check.

I've resigned myself to accepting my TWR-K64f120m is defective.

Thanks for trying to help though!

-Drew

0 Kudos