Migrating AN12103 to EVKB-MIMXRT1050 with MCUXpresso IDE v10.2.1 and MCUXpresso SDK v2.4.2.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Migrating AN12103 to EVKB-MIMXRT1050 with MCUXpresso IDE v10.2.1 and MCUXpresso SDK v2.4.2.

Migrating AN12103 to EVKB-MIMXRT1050 with MCUXpresso IDE v10.2.1 and MCUXpresso SDK v2.4.2.

  1. INTRODUCTION
  2. REQUIREMENTS
  3. INTEGRATION

 

 

1. INTRODUCTION

 

This document provides an step-by-step guide to migrate the webcam application explained on AN12103 "Developing a simple UVC device based on i.MX RT1050" to EVKB-MIMXRT1050. The goal is getting the application working on rev. B silicon, using the current SDK components (v2.4.2) and with MCUXpresso IDE (v10.2.1), because the original implementation from the application note is using rev. A silicon and is developed on IAR IDE.

 

2. REQUIREMENTS

 

A) Download and install MCUXpresso IDE v10.2.1.

B) Build an MCUXpresso SDK v2.4.2 for EVKB-MIMXRT1050 from the "SDK Builder web page", ensuring that CSI and USB components are included, and MCUXpresso IDE is selected, and install it.

For A) and B) steps, you could refer to the following Community document:

https://community.nxp.com/docs/DOC-341985 

C) Download the source code related to AN12103.

D) Having the EVKB-MIMXRT1050 board, with MT9M1114 camera module.

3. INTEGRATION

 

a) Open MCUXpresso IDE, and click on "Import SDK example" shortcut, select the "evkbimxrt1050" board and click on "Next" button.

pastedImage_7.png

b) Select the "driver_examples->csi->csi_rgb565" and "usb_examples->dev_video_virtual_camera_bm" examples, and click on "Finish" button.

pastedImage_6.png

c) Copy the "fsl_csi.h", "fsl_csi.c", "fsl_lpi2c.h" and "fsl_lpi2c.c" files from the "drivers" folder of CSI project, to the "drivers" folder of the Virtual_Camera project.

pastedImage_9.png

d) Copy the "pin_mux.h" and "pin_mux.c" files from the "board" folder of CSI project, to the "board->src" folder of the Virtual_Camera project, replacing the already included files.

pastedImage_10.png

e) Copy the "camera" folder from AN12103 software package from the path below, to the Virtual_Camera project:

<AN12103SW\boards\evkmimxrt1050\user_apps\uvc_demo\src\camera>

Also copy the "main.c" file from AN12103 software package to the "sources" folder of the Virtual_Camera project.

Ensure selecting the option "Copy files and folders" when copying folders/files.

pastedImage_3.png

f) Right click on the recently added "camera" folder, and select "Properties". Then, on the "C/C++ Build" menu, remove the checkbox "Exclude resource from build" option, and then click on "Apply and Close" button.

pastedImage_2.png

g) Right click on the Virtual_Camera project, and select "Properties". Then, select the "C/C++ Build -> Settings -> MCU C Compiler -> Preprocessor" menu, and click on the "+" button to add the following value: "SDK_I2C_BASED_COMPONENT_USED=1", and click on "OK" button.

pastedImage_5.png

h) Now, move to the "Includes" menu of the same window, and click on the "+" button to add the following value: "../camera". Repeat the same procedure on "MCU Assembler -> General" menu, and then, click on "Apply and Close" button.

pastedImage_1.png

i) Refer to "usb" folder from AN12103 software package from the path below, and copy "video_camera.h", "video_camera.c", "usb_device_descriptor.h" and "usb_device_descriptor.c" files to the "sources" folder of Virtual_Camera project, ensuring selecting the option "Copy files and folders" and overwriting the already included files:

<AN12103SW\boards\evkmimxrt1050\user_apps\uvc_demo\src\usb>

pastedImage_4.png

j) Select "video_data.h", "video_data.c", "virtual_camera.h" and "virtual_camera.c" files and "doc" folder, then right click and select "Delete". Click on "OK" button of the confirmation window to remove these resources from the Virtual_Camera project.

pastedImage_5.png

k) Refer to "fsl_mt9m114.c" file from "camera" folder of Virtual_Camera project, and delete the "static" definition from functions "MT9M114_Init", "MT9M114_Deinit", "MT9M114_Start", "MT9M114_Stop", "MT9M114_Control" and "MT9M114_InitExt".

pastedImage_6.png

l) Refer to "main.c" file from "sources" folder of Virtual_Camera project, and comment out the call to the function "BOARD_InitLPI2C1Pins". Also, refer to "board.c" file from "board->src" folder of Virtual_Camera project, and comment out the call to the function "SCB_EnableDCache".

pastedImage_8.png

m) Refer to "camera_device.c" file from "camera" folder of Virtual_Camera project, and comment out the line "AT_NONCACHEABLE_SECTION_ALIGN(static uint16_t s_cameraFrameBuffer[CAMERA_FRAME_BUFFER_COUNT][CAMERA_VERTICAL_POINTS * CAMERA_HORIZONTAL_POINTS + 32u], FRAME_BUFFER_ALIGN);" and add the following line:

static uint16_t __attribute__((section (".noinit.$BOARD_SDRAM"))) s_cameraFrameBuffer[CAMERA_FRAME_BUFFER_COUNT][CAMERA_VERTICAL_POINTS * CAMERA_HORIZONTAL_POINTS + 32u] __attribute__ ((aligned (FRAME_BUFFER_ALIGN)));

pastedImage_9.png

n) Compile and download the application into the EVKB-MIMXRT1050 board. The memory usage is shown below:

pastedImage_10.png

o) When running the application, if you also have the serial terminal connected, you should see the print message. Additionally, if connected to Windows OS, you could find it as "CSI Camera Device" under the "Imaging devices" category.

pastedImage_11.png

p) Optionally, you could rename the Virtual_Camera project to any other desired name, with rigth click on Project, and selecting "Rename" option, and finally, click on "OK" button.

pastedImage_13.png

It is also attached the migrated MCUXpresso IDE project including all the steps mentioned on the present document.

Hope this will be useful for you.

Best regards!

Some additional references:

https://community.nxp.com/thread/321587 

Defining Variables at Absolute Addresses with gcc | MCU on Eclipse 

 

Labels (1)
Attachments
Comments

Hi jamesbone‌, gusarambula‌, Bio_TICFSL‌, diegoadriancuevasescareño‌, could you please help me with your review to this document?

Is this migration same for IMXRT1060-EVKB,  IMXRT1160 EVK and  IMXRT1170 EVK? i can see the UVC example on these board's webpage but it redirects to RT1050 document. 

 

No ratings
Version history
Last update:
‎11-12-2018 02:52 PM
Updated by: