The latest NFC reader library supports lpc1769 which is a cortex M3 controller with LPCopen lib supports, so in theory , it should supports other controllers supported by LPCopen, but we have to test this, so we choose , for example, lpc11u37, a cortex M0 based controller for this porting. Platform for this porting: LPC11u37h-Xpresso Rev A: CLRC663 plus based CLEV663B Blueboard 3.0. Please refer to Prepare CLEV663B board for NFC reader library porting for details. They are connected via LPCXpresso ports. Now we may start the porting, the IDE we use in this porting is MCUXpresso 10.1.1 1. Download and import the latest NFC reader library for CLEV6630B, as it supports CLRC663 plus. For how to import the project, please refer to https://www.nxp.com/docs/en/application-note/AN11211.pdf . 2. Download LPCopen for LPC11u37h and import it as well. 3. Now we may choose some demo in the NFC reader library, for example, the NfcrdlibEx1_BasicDiscoveryLoop, and create new build configuration for lpc11u37h. 4.Select the correct MCU 5.Modify build settings Here we find LPC1769RC663 is defined, so we have to find what is related with this definition in the code and change it/them. Fortunately they are not too many. you may find they are just related with board header file including or something like that, so it is not difficult to modify them. 6. Add new header file for the new board definition 7. add the new board definition 8. As we now use LPCopen lib for LPC11u37h instead, so we have to change the including path. As LPC11u37h is cortex M3 based, so we have to setup FreeRTOS for M0 support: and add the source code for building: 9.Change the link libraries and including path 10.Set the correct ref projects to use LPCopen for LPC11u37h. 11. Some changes in LPCopen library: 1)enable semihosting debug 2) add startup source code for the demo, this C file can be reused/imported from the some lpcopen project. 12. After the above steps, we still have to change the source code in DAL: You know , due to different version of LPCopen library, some function definition might be changed, and different LPCXpresso boards has different pin connection to the LPCXpresso ports, so it is recommended checking the board schematics and the examples in lpcopen project , find the proper function calls to implement the source codes in the DAL folder. When you finished , the porting is done. 13. As the final image size is greater than 128K, we have enable optimization for size. 14.Demo test ok. Now , we know lpc11u37 can be supported by the latest NFC reader library, so the porting should also be applied for other Cortex M0 controllers, and it is recommended the controller with large internal flash size, better greater than 128K, but anyway, in this porting, I didn't enable the size optimization for LPCopen library, so there might be possibility to have a smaller size image at last...
記事全体を表示