Recently I found some customers have a bit of problem when porting project from one MCU to another, so this article using simple steps demonstrates how to change MCU with MCUXpresso. There is also a video demonstrated the detail steps in attachment.
Pay attention, as MCUXpresso User Guide says: All projects are associated with a particular MCU at creation time. The target MCU determines the project memory layout, startup code, LinkServer flash driver, libraries, supporting sources,launch configuration options etc. etc. so changing a project’s associated MCU should not be undertaken unless you have a total grasp of the consequence of this change. Therefore rather than changing a project’s associated MCU, it is strongly recommended that instead a new project is generated for the desired MCU and this new project is edited as required.
However, on occasion it may be expedient to reset a project’s MCU (and associated SDK) and this can be achieved as follows. For example, changing lpc55s69 to lpc55s06, we need install SDKs for lpc55s69 and lpc55s06 before all the below steps.
1 - Change MCU & Package
1.1 – Change MCU
Right click “MCU” under Project tree, choose “Edit MCU”
Alice_Yang_0-1627442238840.png
Uncheck ”Preserve memory configuration”(it is checked by default)->choose LPC55S06->there is a warning, choose Yes.
Alice_Yang_1-1627442319505.png
We can see the Memory details changed to lpc55s06, then click ”Apply and close”.
1.2 – Change Package
Alice_Yang_2-1627442363050.png
2 - Change Compiler Definitions
In Properties view->Settings->MCU Compiler ->Preprocessor, change the definition for CPU from LPC55S69JBD100 to LPC55S06JBD64 as below:
Alice_Yang_3-1627442471807.png
3 – Change/add SDK driver for LPC55s06
Selected project, then click ”Manage SDK components”, choose the drivers our application used, for example, clock, power, usart.
Alice_Yang_4-1627442521094.png
Alice_Yang_6-1627442556603.png
Click “OK”, then click “Yes” to update.
Alice_Yang_7-1627442569628.png
Delete LPC55S69 device related files:
Alice_Yang_0-1636704852972.png
Add “system_LPC55S06.c” and “system_LPC55S06.h” files:
Alice_Yang_9-1627442604431.png
4 - Change startup file.
Delete LPC55s69 startup files, add “startup_lpc55s06.c”, we can find the startup file in any SDK demo.
Alice_Yang_10-1627442631217.png
5 - Change board related files.
Refer to our own new board, change files under “board” folder, for example pins, uart number, here directly copy from SDK demo for LPCxpresso55s06 board.
Alice_Yang_12-1627442675241.png
6 - Test the project function with new board
Build project until no compile error, download and run it, result as below.
Alice_Yang_11-1627442661014.png