custom board MQX install using same microcontroller as Kinetis dev kit

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

custom board MQX install using same microcontroller as Kinetis dev kit

Jump to solution
943 Views
khoanguyen
Contributor I

Hi,

Right now I'm using the Kinetis TWR-K60N512 development kit and MQX 3.1, I'm currently creating my custom board and I'm able to flash code successfully. My custom board has a microcontroller in the same family as the one on my development kit, so the processor expert files I used for the kit also work on my custom board.

However, right now I'm attempting to run a MQX program (using the hello world demo) on my custom board. Since I don't have serial, I was using the iodebug option to see the message in my console. The code flashes but no message is displayed in the console, I have already changed the configuration in the user config files to use iodebug mode instead of the default "ttyf." Flashing this code on the development kit, in iodebug mode, is successful and I'm able to see the message in the console.

In addition to this, when I press the debug icon, the play button is already greyed out. However I am able to pause the program, so I'm assuming its automatically running and unable to successfully compile the bsp file.

When I'm in debugging mode on the custom board, I've paused the debugger and it brings me to the bsp_cm.c file to wait for an external clock here:

     while((MCG_S & MCG_S_IREFST_MASK) != 0x00U) { /* Check that the source of the FLL reference clock is the external reference clock. */

       }

       while((MCG_S & 0x0CU) != 0x08U) {    /* Wait until external reference clock is selected as MCG output */

       }

       /* Switch to PBE Mode */


Is this external clock specific to the hardware on the Kinetis development kit? Or is this an issue with MQX? If so, how would i go about fixing this.

If it is a hardware issue, is there a document that outlines the hardware requirements for MQX to run on a custom board (using a similar microcontroller)?

Thanks,

Khoa Nguyen



0 Kudos
1 Solution
713 Views
JimDon
Senior Contributor III

No you don't but you will have to change up MQX the code to do the  same as the working PE code you have. Examine cpu.c  in the working PE code, and there you will find the MCG set up code that works (from what you have said). Put this code in to the MQX code and it should work.

View solution in original post

0 Kudos
3 Replies
713 Views
JimDon
Senior Contributor III

Is the crystal on your board the same as the TWR-K60N512?

0 Kudos
713 Views
khoanguyen
Contributor I

Thanks for the quick response!

As of right now, we do not have an external crystal available on our custom board, but we wanted to verify that this is a hardware issue that allows us to run MQX programs on our custom board.

Do we need the 50Mhz or 32Khz crystal for the MQX RTOS to run? Are there any other hardware changes required for MQX to work on our custom board as we're porting our software over to the custom board? The reason I ask is because we are able to run non-MQX code (using same processor expert and LED demo) on our custom board successfully by using the PTA18 signal as the clock in.

Thanks,

Khoa Nguyen

0 Kudos
714 Views
JimDon
Senior Contributor III

No you don't but you will have to change up MQX the code to do the  same as the working PE code you have. Examine cpu.c  in the working PE code, and there you will find the MCG set up code that works (from what you have said). Put this code in to the MQX code and it should work.

0 Kudos