ARMGCC
Create an RT1170 M4/RT1180 M7 project
For RT1170, copy the cm4 folder under <install_dir>
/boards/evkmimxrt1170/usb_examples/usb_device_hid_mouse/bm/cm4 to the folder where the example must be enabled.
In this case, copy <install_dir>/boards/evkmimxrt1170/usb_examples/usb_device_hid_mouse/bm/cm4 to <install_dir>/boards/evkmimxrt1170/usb_examples/usb_device_msc_disk/bm.
For RT1180, copy the cm7 folder under <install_dir>/boards/evkmimxrt1180/usb_examples/usb_device_hid_mouse/bm/cm7 to the folder where the example must be enabled.
In this case, copy <install_dir>/boards/evkmimxrt1180/usb_examples/usb_device_hid_mouse/bm/cm7 to <install_dir>/boards/evkmimxrt1180/usb_examples/usb_device_msc_disk/bm.
For RT1170, open the CMakeLists.txt of the example. The file is located under <install_dir>/boards/evkmimxrt1170/usb_examples/usb_device_msc_disk/bm/cm4/ armgcc.
For RT1180, open the CMakeLists.txt of the example. The file is located under <install_dir>/boards/evkmimxrt1180/usb_examples/usb_device_msc_disk/bm/cm7/ armgcc.
For RT1170, search and replace all
dev_hid_mouse_bm_cm4
withdev_msc_disk_bm_cm4
, and then save the files.For RT1180, search and replace all
dev_hid_mouse_bm_cm7
withdev_msc_disk_bm_cm7
, and then save the files.
Rearrange source files
For RT1170, open the cm4 folder under <install_dir>/boards/evkmimxrt1170/usb_examples/usb_device_msc_disk/bm/cm4 folder and delete all files with the
.c
and.h
extension.For RT1180, open the cm7 folder under <install_dir>/boards/evkmimxrt1180/usb_examples/usb_device_msc_disk/bm/cm7 folder and delete all files with the
.c
and.h
extension.For RT1170, copy files with the
.c
and.h
extension in the cm7 folder under <install_dir>/boards/evkmimxrt1170/usb_examples/usb_device_msc_disk/bm/cm7 to the cm4 folder under <install_dir>/boards/evkmimxrt1170/usb_examples/usb_device_msc_disk/bm/cm4.For RT1180, copy files with the
.c
and.h
extension in the cm33 folder under <install_dir>/boards/evkmimxrt1180/usb_examples/usb_device_msc_disk/bm/cm33 to the cm7 folder under <install_dir>/boards/evkmimxrt1180/usb_examples/usb_device_msc_disk/bm/cm7.|
|
Rearrange project files
Note: The following steps are described for RT1170. However, these steps are also applicable for RT1180.
Open the CMakeLists.txt of the two examples respectively. The two files are respectively located under <install_dir>/boards/evkmimxrt1170/usb_examples/usb_device_msc_disk/bm/cm7/armgcc and <install_dir>/boards/evkmimxrt1170/usb_examples/usb_device_msc_disk/bm/cm4/ armgcc.
Search the add_executable section in the cm7 and cm4 projects. Delete files that are in the
cm4
project but notcm7
. Add files that are in thecm7
project but notcm4
to thecm4
project.In this case, delete the files in red box and add the directories in the green box to the
cm4
project.|
|
Adjust project settings
Note: The following steps are described for RT1170. However, these steps are also applicable for RT1180.
Search the target_include_directories, CMAKE_MODULE_PATH, and # include modules section one by one. Add macros that are in the
cm7
project but notcm4
to thecm4
project.In this case, remove the paths framed in the red box from the
cm4
project and add the directories framed in the green box.Note: Modify the include modules with the
cm7
suffix tocm4
. For example, modifydriver_usdhc_MIMXRT1176_cm7
todriver_usdhc_MIMXRT1176_cm4
.|
|
|
|
2. Open the `flags.cmake` of the two examples respectively. The two files are respectively located in *<install\_dir\>/boards/evkmimxrt1170/usb\_examples/usb\_device\_msc\_disk/bm/cm7/armgcc* and *<install\_dir\>/boards/evkmimxrt1170/usb\_examples/usb\_device\_msc\_disk/bm/cm4/ armgcc*.
3. Search the **CMAKE\_C\_FLAGS\_DEBUG** section in the `cm4` and `cm7` projects. Compare the macros and add the macro that is in the `cm7` project but not `cm4` to the `cm4` project.
In this case, add the *SD\_ENABLED* macro to the `cm4` project.
|
|
With all above steps done, the RT1170 M7 project successfully changes to an M4 project and the M4 example USB project is available for downloading and debugging. The RT1180 M33 project successfully changes to an M7 project and the M7 example USB project is downloading and debugging.