Hi @DeepakK ,
BTW a big fan of your MCU on eclipse web pages. Thanks for curating all your knowledge and experience into these webpages that are of good help.
Thank you :-).
What is a good way to migrate that from one project to another?
There is no easy way to migrate the SDK configuration and settings (pins tool, etc) to a new project.
That's why by now I basically only use these tools to explore the settings, but later on do it directly in my code, with the exception of the clock configurations.
One important concept to realize with the SDK configuration tools is that it stores the settings in the .mex file (check the root of your project). But the same time the settings are stored in the source files as YAML code. For example check files like clock_config. which has something link this:
/* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
!!Configuration
name: BOARD_BootClockRUN
called_from_default_init: true
outputs:
- {id: Bus_clock.outFreq, value: 60 MHz}
- {id: Core_clock.outFreq, value: 120 MHz}
- {id: ERCLK32K.outFreq, value: 32.768 kHz}
- {id: Flash_clock.outFreq, value: 24 MHz}
- {id: FlexBus_clock.outFreq, value: 40 MHz}
- {id: LPO_clock.outFreq, value: 1 kHz}
- {id: MCGFFCLK.outFreq, value: 250 kHz}
- {id: OSCERCLK.outFreq, value: 8 MHz}
- {id: PLLFLLCLK.outFreq, value: 120 MHz}
- {id: System_clock.outFreq, value: 120 MHz}
- {id: USB48MCLK.outFreq, value: 48 MHz}
settings:
- {id: MCGMode, value: PEE}
- {id: MCG.FRDIV.scale, value: '32'}
- {id: MCG.IREFS.sel, value: MCG.FRDIV}
- {id: MCG.PLLS.sel, value: MCG.PLL}
- {id: MCG.PRDIV.scale, value: '2'}
- {id: MCG.VDIV.scale, value: '30'}
- {id: MCG_C2_OSC_MODE_CFG, value: ModeOscLowPower}
- {id: MCG_C2_RANGE0_CFG, value: Very_high}
- {id: MCG_C2_RANGE0_FRDIV_CFG, value: Very_high}
- {id: OSC_CR_ERCLKEN_CFG, value: Enabled}
- {id: OSC_CR_EREFSTEN_CFG, value: Enabled}
- {id: RTC_CR_OSCE_CFG, value: Enabled}
- {id: SIM.OSC32KSEL.sel, value: RTC.RTC32KCLK}
- {id: SIM.OUTDIV2.scale, value: '2'}
- {id: SIM.OUTDIV3.scale, value: '3'}
- {id: SIM.OUTDIV4.scale, value: '5'}
- {id: SIM.PLLFLLSEL.sel, value: MCG.MCGPLLCLK}
- {id: SIM.USBDIV.scale, value: '5'}
- {id: SIM.USBFRAC.scale, value: '2'}
- {id: SIM.USBSRCSEL.sel, value: SIM.USBDIV}
- {id: USBClkConfig, value: 'yes'}
sources:
- {id: OSC.OSC.outFreq, value: 8 MHz, enabled: true}
- {id: RTC.RTC32kHz.outFreq, value: 32.768 kHz, enabled: true}
* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS **********/
/* clang-format on */
This all contains the settings in 'human readable format': you won't be able to use that in the other project directly, but gives you the information of the settings and changes.
As for the SDK drivers loaded for a project: check the .cproject file of your project, there is something like this below which tells you the list of components:
<storageModule moduleId="com.nxp.mcuxpresso.core.datamodels">
<sdkName>SDK_2.x_MK22FX512xxx12</sdkName>
<sdkVersion>2.3.1</sdkVersion>
<sdkComponents>middleware.baremetal.MK22F12;platform.devices.MK22F12_startup.MK22F12;platform.devices.MK22F12_CMSIS.MK22F12;platform.Include_common.MK22F12;platform.Include_core_cm4.MK22F12;platform.drivers.gpio.MK22F12;platform.drivers.clock.MK22F12;platform.drivers.common.MK22F12;platform.drivers.i2c.MK22F12;platform.drivers.uart.MK22F12;platform.drivers.adc16.MK22F12;platform.drivers.dspi.MK22F12;platform.drivers.flash.MK22F12;platform.drivers.ftm.MK22F12;platform.drivers.port.MK22F12;platform.drivers.sim.MK22F12;platform.drivers.pit.MK22F12;platform.utilities.debug_console.MK22F12;platform.drivers.sysmpu.MK22F12;platform.drivers.rtc.MK22F12;</sdkComponents>
<package>MK22FX512VLK12</package>
<core>cm4</core>
<coreId>core0_MK22FX512xxx12</coreId>
</storageModule>
Erich