Використовуйте інструмент зборки root для створення прошивки RV1126 IMG

Використовуйте інструмент зборки root для створення прошивки RV1126 IMG

Use the build root tool to package the executable file you compiled into the firmware (img file)

Introduce two common methods

Method 1:

Place the compiled executable file in the buildroot/board/rockchip/rv1126_rv1109/fs-overlay-sysv/etc/init.d directory of the sdk, and compile and package it all.

133a7e994d72869d3e26b28bef94066

Наприклад, here I have put the compiled executable file test-app in the directory

  1. наступного, just need to re-compile the entire firmware

The command to compile firmware is

Use the build root tool to make RV1126 IMG firmware 1
  1. After compiling. You will see test-app, this executable file, in the /etc/init.d directory on the board end.
97070806817f267e200fd98ad4315a6

Then you can run it, or copy it to another directory and run it.

This method is the simplest and most recommended

Method 2:

Follow the SDK compilation rules and add your own program to buildroot.

1) Add test.c file

In the source code directory, create your own APP folder with the following command:

$mkdir app/mytest

The running results are shown in the figure below:

Use the build root tool to make RV1126 IMG firmware 2

You can create your own APP program in the mytest directory. Here I will create a test code of test.c, приклад

The code is as follows

Use the build root tool to make RV1126 IMG firmware 3

Still, in the mytest directory, create a Makefile that compiles the test.c program. The sample code is as follows:

Use the build root tool to make RV1126 IMG firmware 4

The creation result is completed as shown in the figure below:

Use the build root tool to make RV1126 IMG firmware 5

2) Add to menu config

When configuring the buildroot package, everyone needs to enable it on the graphical configuration interface, so our

The APP also needs to generate an option. Under the source code of the SDK package, open thebuildroot/package/Config.in” файл.

Jump to the lastendmenuand add the following sample code (Примітка: it must be before the last endmenu of this file

Add to). The code looks like this:

Use the build root tool to make RV1126 IMG firmware 6

The result of the addition is shown below:

Use the build root tool to make RV1126 IMG firmware 7

No.2061 OK, it’s used in itsource Citedpackage/mytest/Config.in” file, so we need to create

To create this file, the command is as follows:

$mkdir buildroot/package/mytest/

After creating the directory (mytest is the name of the package package under buildroot), we need to create the mytest directory

Config.in” файл, the content is as follows:

Use the build root tool to make RV1126 IMG firmware 8

The result of the addition is shown below:

Use the build root tool to make RV1126 IMG firmware 9
  1. APP version and compilation rules

In the previous section, we have added APP to the configuration options. У цей час, buildroot still does not know how to

скачати, extract, compile, і т.д., we need to add a configuration file to tell buildroot how to operate, and we need to createbuildroot/

package/mytest/mytest.mk”, the name must be mytest.mk. Copy the following sample code to mytest.mk

Sample code mytest.mk code

Use the build root tool to make RV1126 IMG firmware 10

This file tells buildroot how to compile, download, копія, і т.д.. All capitalized macros start withMYTEST

The header is determined based on the name of our package.

In line 1, the variable at the end of _VERSION is the source code version.

In line 2, the variable at the end of _SITE is the address of the source code download.

In line 3, the variable at the end of _SITE_METHOD is the source code download method, and local means local download.

Lines 4 and 10~12 automatically execute the installation and copy the files that our mytest can run into the bin directory.

лінія 6, the variables at the end of _BUILD_CMDS will be executed when the buildroot framework is compiled, and are used to add M to the source code.

akefile passes compilation options and linkage options and calls the source code’s Makefile.

Lines 14~16 give permissions to the file.

лінія 18, this function will build the entire .mk file into a script.

Введіть

buildroot/output/rockchip_rv1126_rv1109_spi_nand

Execute make menuconfig

turn onmytest

Use the build root tool to make RV1126 IMG firmware 11

After the configuration is completed, we can test whether our mytest can be compiled, in buildroot/output/rockchip_rv1126_rv1109_spi_nand

To test in the directory, the command is as follows:

$make mytest

The running results are shown in the figure below:

Use the build root tool to make RV1126 IMG firmware 12

Download PDF file

залишити коментар

Ваша електронна адреса не буде опублікований. Обов'язкові поля позначені * *

Дізнайтеся більше з iVcan.com

Підпишіться зараз, щоб продовжувати читати та отримати доступ до повного архіву.

Продовжити читання →

Потрібна допомога в WhatsApp?