IAR
This section describes the steps to create an M4 project with IAR, rearrange source and project files, adjust project settings, and delete function.
Create an M4 project
To create an M4 project, perform the following steps:
Copy the folder cm4 in the directory <install_dir>boards\evkmimxrt1170\edgefast_bluetooth_examples\a2dp_source\cm4 into the folder in which the example should be enabled. In this case, copy the folder cm4 into the directory <install_dir>\boards\evkmimxrt1170\edgefast_bluetooth_examples\peripheral_ht.
Open the folder iar in the directory <install_dir>boards\evkmimxrt1170\edgefast_bluetooth_examples\peripheral_ht\cm4\iar.
Rename the files. Change the file name name a2dp_source_cm4 to peripheral_ht_cm4 in all the respective files.
|
|
Open the files peripheral_ht_cm4.eww and peripheral_ht_cm4.ewp with a text editor, such as Notepad, Notepad++, Sublime, or Visual Studio Code.
Search and replace all a2dp_source_cm4 with peripheral_ht _cm4, and then save the files.
|
|
Parent topic:IAR
Rearrange source files
To rearrange source files, perform the following steps:
Open the folder cm4 in the directory <install_dir> boards\evkmimxrt1170\edgefast_bluetooth_examples\peripheral_ht\cm4 and delete all files with the extensions *.c and *.h.
Copy the files with the extensions *.c and *.h from the folder boards\evkmimxrt1170\edgefast_bluetooth_examples\peripheral_ht\cm7\ to the folder <install_dir> boards\evkmimxrt1170\edgefast_bluetooth_examples\peripheral_ht\cm4.
|
|
Parent topic:IAR
Rearrange project files
To rearrange project files, perform the following steps:
Open the peripheral_ht _cm7and peripheral_ht _cm4 IAR projects in the directories <install_dir> boards\evkmimxrt1170\edgefast_bluetooth_examples\peripheral_ht \cm7\iar and <install_dir> boards\evkmimxrt1170\edgefast_bluetooth_examples\peripheral_ht \cm4\iar.
Compare the whole project directory, find file groups that the cm7 project has but are missing in the cm4 project. Add the missing file groups from the cm7 project into the cm4 project.
Compare the difference between the two groups with the same name. Remove files that do not exist in the cm7 project but exist in the cm4 project. Find files that are available in the cm7 project but are missing in the cm4 project. Add the missing files from the cm7 project into the cm4 project.
For example, in the following figure, the files in the source group in the cm4 project must be removed, and the files in the path: <install_dir>\boards\evkmimxrt1170\edgefast_bluetooth_examples\peripheral_ht with the same name as the files in the cm7 project must be added into the source group.
Compare the services group.
The peripheral hts profile is in the services folder. Add the hts.c file to the services group of the cm4 folder.
Parent topic:IAR
Adjust project settings
To adjust the project settings, perform the following steps:
Compare the macro in the project settings: Option > C/C++ compiler > Preprocessor.
Find the macros that do not exist in the cm4 project but are available in the cm7 project. Delete these macro. The rule is that m7 macro setting should be same with m4.
|
|
The macros are in the**peripheral\_ht\_cm4.ewp** file.
|
|
Parent topic:IAR
Delete function
As a final step, remove the function “SCB_DisableDCache(); in main.c.
On the completion of the above steps, the M7 project successfully migrates to an M4 project. You can now download and debug the M4 example project.
Parent topic:IAR