MDK

This section describes the steps to create an M4 project with MDK, rearrange source and project files, adjust project settings, and delete function.

Create an M4 project

  1. Copy folder cm4 from <install_dir>boards\evkmimxrt1170\edgefast_bluetooth_examples\a2dp_source\cm4 into the folder in where the example must be enabled. In this case, copy folder cm4 into directory <install_dir>\boards\evkmimxrt1170\edgefast_bluetooth_examples\peripheral_ht.

  2. Open folder mdk from <install_dir>boards\evkmimxrt1170\edgefast_bluetooth_examples\peripheral_ht\cm4\mdk.

    |

|

  1. Change the filename a2dp_source_cm4 to peripheral_ht_cm4 respectively.

  2. Open the files *peripheral_ht_cm4.*uvmpw and peripheral_ht_cm4. uvoptx, peripheral_ht_cm4.uvprojxwith a text editor, such as Notepad, Notepad++, Sublime, or Visual Studio code.

  3. Search and replace a2dp_source_cm4 with peripheral_ht _cm4, and then save the files.

    |

|

Parent topic:MDK

Rearrange source files

  1. Open folder cm4 in *<install_dir>*boards\evkmimxrt1170\edgefast_bluetooth_examples\peripheral_ht\cm4, and delete all files with the .c and .h file name extension.

  2. Copy files with the .c and .h filename extension in folder cm7 with directory <install_dir> boards\evkmimxrt1170\edgefast_bluetooth_examples\peripheral_ht\cm7to folder cm4 with directory <install_dir> boards\evkmimxrt1170\edgefast_bluetooth_examples\peripheral_ht\cm4.

    |

|

.

Parent topic:MDK

Rearrange project files

  1. Open the peripheral_ht _cm7 and peripheral_ht _cm4 IAR projects. The two workspaces are located in *<install_dir>*boards\evkmimxrt1170\edgefast_bluetooth_examples\peripheral_ht \cm7\mdk and *<install_dir>*boards\evkmimxrt1170\edgefast_bluetooth_examples\peripheral_ht \cm4\mdk respectively.

    • Compare the whole project directory, find file groups that the cm7 project has but the cm4 project not and then add these groups 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 the cm7 project has but the cm4 project not and then add these files into the cm4 project.

  2. For the source group, in this case, the files in the source group in the cm4 project must be removed, and the files in the path <install_dir>\boards\evkmimxrt1170\ boards\evkmimxrt1170\edgefast_bluetooth_examples\peripheral_ht\cm4 with the same name as the files in the cm7 project must be added into the source group.

  3. Compare the service: group.

    Peripheral hts profile is located in “service” folder. Add the hts.c file to the services group of the cm4 folder.

    .

Parent topic:MDK

Adjust project settings

  1. Compare the macro in the project settings: preprocessor symbols.

  2. Compare the macro that does exist in the cm4 project but exists in the cm7 project.

  3. Delete the following macro. The rule is that m7 macro setting should be same as m4 .

    The macro could also be found in be eripheral_ht_cm4.uvprojx.

    |

|

|![](../images/adjust_mdk_settings2.png "Compare the macro")

|

Parent topic:MDK

Delete function

Remove function SCB_DisableDCache(); in main.c.

On successful completion of the above steps, the M7 project is changed to the M4 project. You can now download and debug the M4 example project.

Parent topic:MDK