All Boards Compiling RedBoot

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

All Boards Compiling RedBoot

All Boards Compiling RedBoot

In every i.MX BSP you will find a pre-compiled binary to flash on your board, but if you need to recompile, this tutorial will be useful. Redboot source code and pre-built images for many platforms are available on Linux Board Support Package (BSP). As an example, let's compile redboot version 2009_10 that comes with Freescale Linux BSP.

  For detailed information about Redboot, check <redboot_folder>/doc

Locate the file ecostools.tar.gz and decompress it on /opt directory. (Create this folder if it is not there)

$ cd /opt

$ sudo tar zxvf <redboot_folder>/tools/ecos_config_tools.tar.gz

$ sudo tar zxvf <redboot_folder>/tools/arm-2008q1.tar.gz

This creates /opt/ecostools directory with two subdirectories:

  • arm-2008q1 -- GNU tools for compiling, linking, etc.
  • tools -- mainly to have ecosconfig utility program


Add /opt/arm-2008q1/bin and /opt/tools/bin to your environment PATH variable.

$ export PATH=$PATH:/opt/arm-2008q1/bin:/opt/tools/bin 

Generating RedBoot Image


Decompress the ecos-trunk-080727.tar.bz2 base line source code into <redboot_folder>/src. There should be a 'packages' directory under <redboot_folder>/src/ecos if it is done correctly.

$ tar xjvf ecos-trunk-080727.tar.bz2 

Go to ecos subdirectory and apply the patches;

$ cd ecos

$ bunzip2 -c patch-redboot-200910-base.bz2 | patch -p1

The above command assumes the patch file is under the same directory as the <redboot_folder>/src/ecos. Specify the path name for the patch file if necessary.

Apply the patch for specific platform. In this case, the used patch is: patch-redboot-200834-mx3.bz2

$ patch-redboot-200910-mx3.bz2 | patch -p1 

Define the ECOS_REPOSITORY. On <redboot_folder>, put the entire (absolute) path to redboot folder. I.e. ~/<redboot_folder>/src/ecos/packages

$ export ECOS_REPOSITORY=<redboot_folder>/src/ecos/packages 

To build redboot (for i.MX31 in this example), create a new folder in order to have a clean build:

$ mkdir new_redboot

$ cd new_redboot

$ ecosconfig new mx31_3stack redboot

$ ecosconfig import $ECOS_REPOSITORY/hal/arm/mx31/3stack/current/misc/redboot_ROMRAM.ecm

$ ecosconfig tree

$ make

This creates the Redboot image (redboot.bin) under install/bin directory. This image can run from either SDRAM or flash.

Note:

You can change the board MACH-TYPE at this file: src/ecos/packages/hal/arm/mx27/ads/current/cdl/hal_arm_board.cdl

Tags (1)
%3CLINGO-SUB%20id%3D%22lingo-sub-1104857%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EAll%20Boards%20Compiling%20RedBoot%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1104857%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CDIV%3E%3CP%3EIn%20every%20i.MX%20BSP%20you%20will%20find%20a%20pre-compiled%20binary%20to%20flash%20on%20your%20board%2C%20but%20if%20you%20need%20to%20recompile%2C%20this%20tutorial%20will%20be%20useful.%20Redboot%20source%20code%20and%20pre-built%20images%20for%20many%20platforms%20are%20available%20on%20Linux%20Board%20Support%20Package%20(BSP).%20As%20an%20example%2C%20let's%20compile%20redboot%20version%202009_10%20that%20comes%20with%20Freescale%20Linux%20BSP.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CDIV%20style%3D%22background-color%3A%20%23eeeeff%3B%20padding-left%3A%2030px%3B%20width%3A%2060%25%3B%20margin-left%3A%2020%25%3B%22%3E%3CP%20class%3D%22note%22%3E%26nbsp%3B%20For%20detailed%20information%20about%20Redboot%2C%20check%20%3CREDBOOT_FOLDER%3E%2Fdoc%3C%2FREDBOOT_FOLDER%3E%3C%2FP%3E%3C%2FDIV%3E%3CP%3E%3C%2FP%3E%3CP%3ELocate%20the%20file%20ecostools.tar.gz%20and%20decompress%20it%20on%20%2Fopt%20directory.%20(Create%20this%20folder%20if%20it%20is%20not%20there)%3C%2FP%3E%3CBLOCKQUOTE%20class%3D%22jive-quote%22%3E%3CP%3E%24%20cd%20%2Fopt%3C%2FP%3E%3CP%3E%24%20sudo%20tar%20zxvf%20%3CREDBOOT_FOLDER%3E%2Ftools%2Fecos_config_tools.tar.gz%3C%2FREDBOOT_FOLDER%3E%3C%2FP%3E%3CP%3E%24%20sudo%20tar%20zxvf%20%3CREDBOOT_FOLDER%3E%2Ftools%2Farm-2008q1.tar.gz%3C%2FREDBOOT_FOLDER%3E%3C%2FP%3E%3C%2FBLOCKQUOTE%3E%3CP%3EThis%20creates%20%2Fopt%2Fecostools%20directory%20with%20two%20subdirectories%3A%3C%2FP%3E%3CUL%3E%3CLI%3Earm-2008q1%20--%20GNU%20tools%20for%20compiling%2C%20linking%2C%20etc.%3C%2FLI%3E%3CLI%3Etools%20--%20mainly%20to%20have%20ecosconfig%20utility%20program%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%3CBR%20%2F%3E%20Add%20%2Fopt%2Farm-2008q1%2Fbin%20and%20%2Fopt%2Ftools%2Fbin%20to%20your%20environment%20PATH%20variable.%3C%2FP%3E%3CPRE%20class%3D%22jive-pre%22%3E%24%20export%20PATH%3D%24PATH%3A%2Fopt%2Farm-2008q1%2Fbin%3A%2Fopt%2Ftools%2Fbin%20%3C%2FPRE%3E%3CP%3E%3C%2FP%3E%3CH2%20id%3D%22toc-hId--1416339370%22%20id%3D%22toc-hId--1416339370%22%20id%3D%22toc-hId--499258006%22%3E%3CSPAN%20class%3D%22mw-headline%22%3EGenerating%20RedBoot%20Image%3C%2FSPAN%3E%3C%2FH2%3E%3CP%3E%3CSPAN%20class%3D%22mw-headline%22%3E%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EDecompress%20the%20ecos-trunk-080727.tar.bz2%20base%20line%20source%20code%20into%20%3CREDBOOT_FOLDER%3E%2Fsrc.%20There%20should%20be%20a%20'packages'%20directory%20under%20%3CREDBOOT_FOLDER%3E%2Fsrc%2Fecos%20if%20it%20is%20done%20correctly.%3C%2FREDBOOT_FOLDER%3E%3C%2FREDBOOT_FOLDER%3E%3C%2FP%3E%3CPRE%20class%3D%22jive-pre%22%3E%24%20tar%20xjvf%20ecos-trunk-080727.tar.bz2%20%3C%2FPRE%3E%3CP%3EGo%20to%20ecos%20subdirectory%20and%20apply%20the%20patches%3B%3C%2FP%3E%3CBLOCKQUOTE%20class%3D%22jive-quote%22%3E%3CP%3E%24%20cd%20ecos%3C%2FP%3E%3CP%3E%24%20bunzip2%20-c%20patch-redboot-200910-base.bz2%20%7C%20patch%20-p1%3C%2FP%3E%3C%2FBLOCKQUOTE%3E%3CP%3EThe%20above%20command%20assumes%20the%20patch%20file%20is%20under%20the%20same%20directory%20as%20the%20%3CREDBOOT_FOLDER%3E%2Fsrc%2Fecos.%20Specify%20the%20path%20name%20for%20the%20patch%20file%20if%20necessary.%3C%2FREDBOOT_FOLDER%3E%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3EApply%20the%20patch%20for%20specific%20platform.%20In%20this%20case%2C%20the%20used%20patch%20is%3A%20patch-redboot-200834-mx3.bz2%3C%2FP%3E%3CPRE%20class%3D%22jive-pre%22%3E%24%20patch-redboot-200910-mx3.bz2%20%7C%20patch%20-p1%20%3C%2FPRE%3E%3CP%3EDefine%20the%20ECOS_REPOSITORY.%20On%20%3CREDBOOT_FOLDER%3E%2C%20put%20the%20entire%20(absolute)%20path%20to%20redboot%20folder.%20I.e.%20~%2F%3CREDBOOT_FOLDER%3E%2Fsrc%2Fecos%2Fpackages%3C%2FREDBOOT_FOLDER%3E%3C%2FREDBOOT_FOLDER%3E%3C%2FP%3E%3CPRE%20class%3D%22jive-pre%22%3E%24%20export%20ECOS_REPOSITORY%3D%3CREDBOOT_FOLDER%3E%2Fsrc%2Fecos%2Fpackages%20%3C%2FREDBOOT_FOLDER%3E%3C%2FPRE%3E%3CP%3ETo%20build%20redboot%20(for%20i.MX31%20in%20this%20example)%2C%20create%20a%20new%20folder%20in%20order%20to%20have%20a%20clean%20build%3A%3C%2FP%3E%3CBLOCKQUOTE%20class%3D%22jive-quote%22%3E%3CP%3E%24%20mkdir%20new_redboot%3C%2FP%3E%3CP%3E%24%20cd%20new_redboot%3C%2FP%3E%3CP%3E%24%20ecosconfig%20new%20mx31_3stack%20redboot%3C%2FP%3E%3CP%3E%24%20ecosconfig%20import%20%24ECOS_REPOSITORY%2Fhal%2Farm%2Fmx31%2F3stack%2Fcurrent%2Fmisc%2Fredboot_ROMRAM.ecm%3C%2FP%3E%3CP%3E%24%20ecosconfig%20tree%3C%2FP%3E%3CP%3E%24%20make%3C%2FP%3E%3C%2FBLOCKQUOTE%3E%3CP%3EThis%20creates%20the%20Redboot%20image%20(redboot.bin)%20under%20install%2Fbin%20directory.%20This%20image%20can%20run%20from%20either%20SDRAM%20or%20flash.%3C%2FP%3E%3CP%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3ENote%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EYou%20can%20change%20the%20board%20MACH-TYPE%20at%20this%20file%3A%20src%2Fecos%2Fpackages%2Fhal%2Farm%2Fmx27%2Fads%2Fcurrent%2Fcdl%2Fhal_arm_board.cdl%3C%2FP%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E
No ratings
Version history
Last update:
‎09-10-2020 01:53 AM
Updated by: