Using K64/K24 Driver Examples on Custom Boards

cancel
Showing results for 
Search instead for 
Did you mean: 

Using K64/K24 Driver Examples on Custom Boards

511 Views
alexbodurka
Contributor I

If I want to take one of the Driver examples for the k64 Tower board (UART/CAN) and run it on my MK24 custom board what files would I need to change? Bare minimum only. Here is an explanation of what I’ve done so far.

  • Created a new project “test” using the built in Wizard in KDS.
    • File>New Kinetis SDK 2 project >processors MK24FN1M0xxx12
    • Selected All Drivers and no RTOS
  • Created clock_config and pin_mux files using the MCUXpresso tool online
    • Copied those into my new “test” project
  • Copied the board and application code from the driver example to the “test” project
    • C:\SDK_2.1_MK24FN1M0xxx12\boards\twrk64f120m\driver_examples\uart\interrupt\board.c
    • C:\SDK_2.1_MK24FN1M0xxx12\boards\twrk64f120m\driver_examples\uart\interrupt\board.h
      • commented out non UART related #defines
    • C:\SDK_2.1_MK24FN1M0xxx12\boards\twrk64f120m\driver_examples\uart\interrupt\uart_interrupt.c
      • main() located here
Labels (1)
0 Kudos
6 Replies

257 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi alexbodurka,

   The picture you have mentioned is correct.

    After you create the K24 project. if you want to add the uart code.

   You need to add the code in board.c,  clock_config.c, pin_mux.c and main.c.

   Please don't forget to add the according driver head file include code in the main.c.

   After the code modification,  just build it.

   You can refer to the K64 uart and flexcan demo to write the according file.

If you meet the question, please let me know!

Have a great day,
Kerry

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

0 Kudos

257 Views
alexbodurka
Contributor I

Hey kerry, I still can't get the clock settings to work. I created another thread for this 

https://community.nxp.com/thread/445767 

0 Kudos

257 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi alexbodurka,

  Mark already reply your new post.

 You can try mark's code, if you still have question, just let me know.

Have a great day,
Kerry

 

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

0 Kudos

257 Views
ryanlush
Contributor IV

Kerry,

I'm having the same issue Alex had with the clocks. I get the impression Alex abandoned the code in clock_config.c and used Mark's code instead. I'm not yet ready to abandon the generated code and would like to get it to work. I posted a more detailed question on the second thread Alex created but I'm posting here as well to get another set of eyes on this. Any help would be much appreciated.

0 Kudos

257 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Ryan,

   That post is very old, I suggest you create a new question post by yourself, then we will reply you directly in your own post.

   You can give us your detail question information, then we will help you to check it.

   If you want I to reply, you can @kerry zhou in your new created post, then I will get the notification, then check you detail question, thank you!


Have a great day,
Kerry

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

0 Kudos

257 Views
alexbodurka
Contributor I

I did. That got me pass the while loops but I'm not sure if my bit checking was correct in the while loops. Tested the UART and I now see activity on it but baud rate is way off so that leads me to think there was an issue while setting up the clocks. I verified that my MCG registers are correctly set but what should the MCG->S Status register be at the end of it?

0 Kudos