I am trying to configure a project for the MKL16Z256VLH4 with FreeRTOS. When I build the SDK and try to use the project generator I am forced to create a project for a FRDM-KL46Z board. Is this implying that the project is simply the same?
Yes and no!
Since we do not have hardware board for each and every Kinetis MCU, the KSDK_v2 that you generate for your specific MCU (KL16Z256 in your case) is a proper subset of the KL46Z256. And there is hardware support for it.
The KSDK_v2 boards folder simple has examples that run on the frdmkl46z Freedom platform.
But if you look at the following path: ~SDK_2.0_MKL16Z256xxx4_KDS\devices
It contains both the MKL16Z4 and MKL46Z4 folders.
When you use Project Generator it wants to create a project that is supported on real hardware.
Once you have that project you can port it to support your KL16 by changing the Properties of the project to have paths to the KL16.
The Cross ARM C Compiler->Preprocessor define needs to change from "CPU_MKL46Z256VLL4" to "CPU_MKL16Z256VLH4 ".
That change allows the correct device headers to be used from the file fsl_device_registers.h.
So you need to comb through the generated project and replace the files that are contained in C:\NXP\KSDK_v2\SDK_2.0_MKL16Z256xxx4_KDS\devices\MKL16Z4 .
Lastly update the linker file used to one in the following path:
Looks like I've got it going. The project generator did set this up correctly. It is using the MKL16Z4 paths. Thanks!
Retrieving data ...