Hello Gjorgji Petkovski:
The TWR-K40X256 uses an older version of the K40_100 MHz devices, while the TWR-K40D100M uses a new revision of silicon. All the differences between revisions 1.x and 2.x are explained in application note AN4445, together with the required software considerations.
When migrating to the new board the projects often fail during startup code, even before reaching main, so check the appnote and your code to see what is wrong. It might be easier and cleaner to start a fresh project for the correct target device and import the the required source/header files instead of patching the project.
I hope this helps. Let me know if you have issues.
Regards!,
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------