It depends in 'no small part' on whether you are coming from K22 or K22--A. The 'A' part is 'much closer' to the K20, BUT virtually ALL different members of Kinetis M4-devices still contain variations from such basic things as clock-setup and vector-table, to deeper issues of peripheral-instantiation-configuration such as the FIFO-depth on the SPI ports. To get one binary that runs 'either processor' will require code that checks WHICH it is actually on, and make at LEAST the appropriate initial setup differences.