When you use the project generator to make a MK22F12 project, I get the following compiler warnings (though serious):
array subscript is above array bounds [-Warray-bounds]
Which is pointing to fsl_dspi.c:
Lines 12 and 19 are the issue, because these are referencing elements 1 and 2 of the g_dspiHandle array, but it is only defined in that same file as static void *g_dspiHandle[FSL_FEATURE_SOC_DSPI_COUNT]; and FSL_FEATURE_SOC_DSPI_COUNT is defined elsewhere in the MK22F12_features.h file as 1!
In other words, there is only one SPI block (SPI0) on this chip, so the SPI1 and SPI2 features should not be defined, and this error will go away. I have confirmed that eliminating these variables (SPI1, SPI2, etc.) in MK22F12.h fixes the issue.
Please fix in future versions, thanks.