MCUXpresso SDK Documentation

h264_freertos#

Overview#

This project read the h264 files from SD card, decode them and show the frames in LCD panel.

Prepare the H264 files#

Name the H264 files like 000.264, 001.264, 002.264, …, and save them to the root path of the SD card. Please starts from 000.264, if there is only one file, name it as 000.264. This project reads the files one by one and decode. The recommend file is: https://github.com/cisco/openh264/tree/v2.1.1/res/test_cif_P_CABAC_slice.264

Running the demo#

This demo could run without debug console. The debug console shows the frame size, decode frame rate, and some error information.

NOTE: For better performance, this project places the decode buffer to DTCM. So the decode buffer size is limited by the DTCM size. See the file h264_dec.cpp for more details. When the H264 file frame size is larger than decode buffer size, then the decode fails and error log is output in debug console. If frame size is more important than performance, please increase the decode buffer size (macro DEMO_DECODE_BUF_SIZE in h264_dec.cpp) and place decode buffer in other larger RAM region.

Supported Boards#

EVKB-IMXRT1050
Hardware requirements
  • Micro USB cable

  • EVKB-IMXRT1050 board

  • JLink Plus

  • 5V power supply

  • Personal Computer

  • RK043FN02H-CT or RK043FN66HS-CT6 LCD board (RK043FN02H-CT and RK043FN66HS-CT6 are compatible)

  • SD card

Board settings
  1. Connect the RK043FN02H-CT or RK043FN66HS-CT6 to board.

  2. Prepare the H264 files and save in SD card.

  3. Insert the SDCARD into card slot.

Prepare the Demo

The demo use RK043FN66HS-CT6 panel by default, to use other panel, set the coresponding panel DEMO_PANEL_xxx(without ‘_SUPPORT’) to y in prj.conf under board example folder before project generation. The supported panels can be found in examples_boards<board>\project_segments\display_support\Kconfig.prjseg. Or change the macro DEMO_PANEL in mcux_config.h of the project, which number represents which panel can be found in display_support.h and mcux_config.h

  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Launch the debugger in your IDE to begin running the demo.

Running the demo

If this example runs correctly, pictures are shown in the lcd panel.

MIMXRT1060-EVKB
Hardware requirements
  • Micro USB cable

  • MIMXRT1060-EVKB board

  • JLink Plus

  • 5V power supply

  • Personal Computer

  • RK043FN02H-CT or RK043FN66HS-CT6 LCD board (RK043FN02H-CT and RK043FN66HS-CT6 are compatible)

  • SD card

Board settings
  1. Connect the RK043FN02H-CT or RK043FN66HS-CT6 to board.

  2. Prepare the H264 files and save in SD card.

  3. Make sure resistors R368/R347/R349/R365/R363 are removed.

  4. Insert the SDCARD into card slot.

Prepare the Demo

The demo use RK043FN66HS-CT6 panel by default, to use other panel, set the coresponding panel DEMO_PANEL_xxx(without ‘_SUPPORT’) to y in prj.conf under board example folder before project generation. The supported panels can be found in examples_boards<board>\project_segments\display_support\Kconfig.prjseg. Or change the macro DEMO_PANEL in mcux_config.h of the project, which number represents which panel can be found in display_support.h and mcux_config.h

  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Launch the debugger in your IDE to begin running the demo.

Running the demo

If this example runs correctly, pictures are shown in the lcd panel.

MIMXRT1170-EVKB
Hardware requirements
  • Micro USB cable

  • MIMXRT1170-EVKB board

  • JLink Plus

  • 5V power supply

  • Personal Computer

  • RK055MHD091 panel or RK055AHD091 panel or RK055IQH091 panel or RaspberryPi panel

  • SD card

Board settings
  1. Connect the panel to J48. For RaspberryPi panel, connect the panel to J84, then connect the panel’s 5V pin to J85-1, GND pin to J85-2.

  2. Prepare the H264 files and save in SD card.

  3. Please make sure R136 is weld for GPIO card detect.

  4. Insert the SDCARD into card slot(J15).

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Build the project, the project uses RK055MHD091 by default, to use other panels, set the coresponding panel DEMO_PANEL_xxx(without ‘_SUPPORT’) to y in prj.conf under board example folder before project generation. The supported panels can be found in examples_boards<board>\project_segments\display_support\Kconfig.prjseg. Or change the macro DEMO_PANEL in mcux_config.h of the project, which number represents which panel can be found in display_support.h and mcux_config.h

  4. Download the program to the target board.

  5. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

If this example runs correctly, pictures are shown in the lcd panel.

MIMXRT1060-EVKC
Hardware requirements
  • Micro USB cable

  • MIMXRT1060-EVKC board

  • JLink Plus

  • 5V power supply

  • Personal Computer

  • RK043FN02H-CT or RK043FN66HS-CT6 LCD board (RK043FN02H-CT and RK043FN66HS-CT6 are compatible)

  • SD card

Board settings
  1. Connect the RK043FN02H-CT or RK043FN66HS-CT6 to board.

  2. Prepare the H264 files and save in SD card.

  3. Insert the SDCARD into card slot.

Prepare the Demo

The demo use RK043FN66HS-CT6 panel by default, to use other panel, set the coresponding panel DEMO_PANEL_xxx(without ‘_SUPPORT’) to y in prj.conf under board example folder before project generation. The supported panels can be found in examples_boards<board>\project_segments\display_support\Kconfig.prjseg. Or change the macro DEMO_PANEL in mcux_config.h of the project, which number represents which panel can be found in display_support.h and mcux_config.h

  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Launch the debugger in your IDE to begin running the demo.

Running the demo

If this example runs correctly, pictures are shown in the lcd panel.

FRDM-IMXRT1152
Hardware requirements
  • Micro USB cable

  • FRDM-IMXRT1152 board

  • JLink Plus

  • 5V power supply

  • Personal Computer

  • RK055MHD091 panel or RK055AHD091 panel or RK055IQH091 panel or RaspberryPi panel

  • SD card

Board settings
  1. Connect the panel to J62. For RaspberryPi panel, connect the panel to J58, then connect the panel’s 5V pin to J56-1, GND pin to J56-2.

  2. Prepare the H264 files and save in SD card.

  3. Please make sure R23 is weld for GPIO card detect.

  4. Insert the SDCARD into card slot(J14).

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Build the project, the project uses RaspberryPi by default, to use other panels, set the coresponding panel DEMO_PANEL_xxx(without ‘_SUPPORT’) to y in prj.conf under board example folder before project generation. The supported panels can be found in examples_boards<board>\project_segments\display_support\Kconfig.prjseg. Or change the macro DEMO_PANEL in mcux_config.h of the project, which number represents which panel can be found in display_support.h and mcux_config.h

  4. Download the program to the target board.

  5. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

If this example runs correctly, pictures are shown in the lcd panel.

MIMXRT1040-EVK
Hardware requirements
  • Micro USB cable

  • MIMXRT1040-EVK board

  • JLink Plus

  • 5V power supply

  • Personal Computer

  • RK043FN02H-CT or RK043FN66HS-CT6 LCD board (RK043FN02H-CT and RK043FN66HS-CT6 are compatible)

  • SD card

Board settings
  1. Connect the RK043FN02H-CT or RK043FN66HS-CT6 to board.

  2. Prepare the H264 files and save in SD card.

  3. Insert the SDCARD into card slot.

Prepare the Demo

The demo use RK043FN66HS-CT6 panel by default, to use other panel, set the coresponding panel DEMO_PANEL_xxx(without ‘_SUPPORT’) to y in prj.conf under board example folder before project generation. The supported panels can be found in examples_boards<board>\project_segments\display_support\Kconfig.prjseg. Or change the macro DEMO_PANEL in mcux_config.h of the project, which number represents which panel can be found in display_support.h and mcux_config.h

  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Launch the debugger in your IDE to begin running the demo.

Running the demo

If this example runs correctly, pictures are shown in the lcd panel.

EVK-MIMXRT1064
Hardware requirements
  • Micro USB cable

  • EVK-MIMXRT1064 board

  • JLink Plus

  • 5V power supply

  • Personal Computer

  • RK043FN02H-CT or RK043FN66HS-CT6 LCD board (RK043FN02H-CT and RK043FN66HS-CT6 are compatible)

  • SD card

Board settings
  1. Connect the RK043FN02H-CT or RK043FN66HS-CT6 to board.

  2. Prepare the H264 files and save in SD card.

  3. Insert the SDCARD into card slot.

Prepare the Demo

The demo use RK043FN66HS-CT6 panel by default, to use other panel, set the coresponding panel DEMO_PANEL_xxx(without ‘_SUPPORT’) to y in prj.conf under board example folder before project generation. The supported panels can be found in examples_boards<board>\project_segments\display_support\Kconfig.prjseg. Or change the macro DEMO_PANEL in mcux_config.h of the project, which number represents which panel can be found in display_support.h and mcux_config.h

  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Download the program to the target board.

  4. Launch the debugger in your IDE to begin running the demo.

Running the demo

If this example runs correctly, pictures are shown in the lcd panel.

MIMXRT1160-EVK
Hardware requirements
  • Micro USB cable

  • MIMXRT1160-EVK board

  • JLink Plus

  • 5V power supply

  • Personal Computer

  • RK055MHD091 panel or RK055AHD091 panel or RK055IQH091 panel

  • SD card

Board settings
  1. Connect the RK055MHD091-CTG LCD board to J48.

  2. Prepare the H264 files and save in SD card.

  3. Please make sure R136 is weld for GPIO card detect.

  4. Insert the SDCARD into card slot(J15).

Prepare the Demo
  1. Connect a USB cable between the host PC and the OpenSDA USB port on the target board.

  2. Open a serial terminal with the following settings:

    • 115200 baud rate

    • 8 data bits

    • No parity

    • One stop bit

    • No flow control

  3. Build the project, the project uses RK055MHD091 by default, to use other panels, set the coresponding panel DEMO_PANEL_xxx(without ‘_SUPPORT’) to y in prj.conf under board example folder before project generation. The supported panels can be found in examples_boards<board>\project_segments\display_support\Kconfig.prjseg. Or change the macro DEMO_PANEL in mcux_config.h of the project, which number represents which panel can be found in display_support.h and mcux_config.h

  4. Download the program to the target board.

  5. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

Running the demo

If this example runs correctly, pictures are shown in the lcd panel.