GOAL
Learn how to import CMSIS packs into existing projects. In this particular project, CMSIS packs from EmSA will be used alongside the lpcxpresso55s16_mcan_interrupt_transfer example obtained from the LPCXpresso55s16 SDK.
ENVIRONMENT
This guide requires MCUXpresso IDE v11.9.1 or latest.
PROCEDURE
1. Import the lpcxpresso55s16_mcan_interrupt_transfer example workspace. In this example, SDK drivers, startup and board interface files are readily available. CAN pins are already routed and enabled.
2. Launch Config Tools to configure the clock for the CAN peripheral
3. Configure the clock for the CAN peripheral.
I. Set up the main clock so that it is generated from crystal or oscillator, and it is evenly dividable by 40 MHz.
II. Change the PLL configuration an even multiple of 40 MHz
III. Set the CAN divider to get a 40 MHz clock.
4. Update the code.
5. Add Open-CMSIS Packs to the project.
6. Project set-up
I. Add the watchdog driver.
II. Exclude the fsl_mcan.c module from the build. A dedicated version is included in the EmSA packs.
III. Add the main.c module from CMSIS template
IV. Exclude or remove the original main source code mcan_interrupt_transfer.c file.
7. Save and build the project.
查看全文