We are attempting to bring up a board that has an MK22F CM4 processor.
I started with the MQX 4.1 BSP for the Freescale_MQX_4_1_FRDMK22F120M BSP available for the FRDM-K22F development board.
I used the BSP Cloning Wizard to export an BSP as a starting point.
My current issue is getting the clock configuration/initialization correct for the new hardware.
The Freedom development BSP is configured for a board with an 8 MHz clock and seems to setup 4 clock configurations.
Our hardware uses a 50 MHz external clock and as far as I know we will only need a single clock configuration.
Based several threads here and a couple of App Notes I have attempted to use the Processor Expert Software, Microcontroller Driver Stuite tool (V 10.4.0) to define our clock configuration and generate code.
I then intended to manually integrate the generated CM initialization code from Cpu.c/h to the bsp_cm.c/h files in the BSP. My problem is that the code flow and routine names seem to have migrated and it is not clear how to port the generated code into my BSP.
Questions:
Is this a valid approach - can anyone let me know if I should be able to use the code generated by PE in the MQX 4.1 BSP?
Is there a better way to accomplish this, different tool, different BSP to clone from .....
Thanks - any insights appreciated.
Solved! Go to Solution.
Hello David
Attached to this thread, you can find a document that explains how to change the default clock configurations using processor expert.
If you have a different configuration then you need to change the BSP, the file you need to change is bsp_cm.h.
In general yo need to follow the below steps:
1. Please check the bsp_cm.c file located at the path: C:\Freescale\Freescale_MQX_4_2\mqx\source\bsp\<board_name>
2. Localize the void _bsp_initialize_hardware(void) function
3. Modify this function according your needs.
Please let me know if this helps
Have a great day,
Sol
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello David
Attached to this thread, you can find a document that explains how to change the default clock configurations using processor expert.
If you have a different configuration then you need to change the BSP, the file you need to change is bsp_cm.h.
In general yo need to follow the below steps:
1. Please check the bsp_cm.c file located at the path: C:\Freescale\Freescale_MQX_4_2\mqx\source\bsp\<board_name>
2. Localize the void _bsp_initialize_hardware(void) function
3. Modify this function according your needs.
Please let me know if this helps
Have a great day,
Sol
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thanks for the help.
Some hunting around to figure out where the clock initialization is done.
For MQX 4.1 I replaced code in the __pe_initialize_hardware() in bsp_cm.c with the clock initialization code from __low_level_init() generated by the Processor Expert tool (Generated_Code\Cpu.c) as well as relevant defines from Cpu.h