Hello Members.. I want to port some applications running on M4 from STM to M4 from NXP. So how can I achieve it.
The basic feature set should be compatible as they both implement the Armv7M architecture. However, there may be additional features that distinguish the two processor implementations: e.g. FPU implementation. If you've got a toolchain like Arm MDK then I'd run the code on the two different config setups to makes sure they work.
I'd assumed that you'd already done this but the datasheets would be a good place to compare the configurations of both the processor and the two boards.
Understand what is defined by ARM - ie, what will be common - and what is vendor-specific.
See: https://community.arm.com/developer/tools-software/tools/f/keil-forum/43684/lpc2148-timer0-not-working-as-expected/158950#158950
As Mahesh says, you will have to study the datasheets for the two chips for details.
If your STM32 application is well-structured, the vendor-specific parts should be well isolated in their own modules, with a "neutral" interface to the rest of the application. That makes it easy to replace the vendor-specific parts without affecting the rest of the app.
This is standard good practice for portable software.
If your STM32 application is not well-structured, now is probably the time to make it so ...