Utilizzare lo strumento build root per creare il firmware RV1126 IMG

Utilizzare lo strumento build root per creare il firmware RV1126 IMG

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

Introduce two common methods

Metodo 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

Per esempio, here I have put the compiled executable file test-app in the directory

  1. Prossimo, just need to re-compile the entire firmware

The command to compile firmware is

Eks1hy9wngmut51DvMMUEKKIGSe2z6gT2ljw618sgo1Mzll4gshiIyjC4 JL195K5hOBi6NCfd rnfPCH1p50UejdnrE6JI hZnX7MjMAC3vNuW53h6Yxwmk jyOb8PmiUA0jTRy4
  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

Metodo 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:

oeZCC8WfnuKK8ovBq8 xkJRPWmoYDcpPUBra6fQd0DEa1MVfVd82BSmzr5W70 M6I8NeK2ym Qy2SNnlJS1hSqYsCry9LOEG4rsiv7J3sv9N FELuDM5mdyEH2B chzhet80VGvwwNiBAeJOo bjDoQ

You can create your own APP program in the mytest directory. Here I will create a test code of test.c, example

The code is as follows

zkysH8wUFkysQLb6 xbZ6F72yEZXyyFDLdVgK UtU7B8KxgGwT8ZK96As6vYh0nopoprbQ44atFZH4afg ifqP8C1Zpw GXKgjCfi wzfdD3mCA6g5 p MUFOUuDHSO951tuFPJE1oCHAlKesTgGNk

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

eulpC3mGHjRl2iYbIez8FtNY9zg2 SkT0pNEqHmFs9stFEDMDSIyiASgZrM6VwTrw

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

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 the “buildroot/package/Config.in” file.

Jump to the last “endmenu” and add the following sample code (nota: it must be before the last endmenu of this file

Add to). The code looks like this:

2zbLm7k3Hz95 KBTk1fKM HcmJaix2pk0m6ZHdG6kpUg kmEEkinROcM5VyNx4wF

The result of the addition is shown below:

w5 Y4PeeAcHI3a1JLvmG50mla5F48xLl4vmKeXeVkm Qt16kzYvY2 ckuTod MMXx6zNvncASCmT2gvoRUnn

No.2061 OK, it’s used in itsource Cited”package/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” file, the content is as follows:

pOE4ZBSeJMvR zPb4BYzZysykQhEmLPEEzslN UQbRCmRnO0JWK2Hbl08FysJ95h75wEZ2JPYvX51zmZShZ8PgRMpRZs 6ZO7u0yNPyZEhpF O ctduyZ6ioiySIk6tAM 73TD 7N4Une6TqP2oks0E

The result of the addition is shown below:

eQxpLhHTHoPbQm3vK3SC8UU9Tu36Zt0 JTpS7jUIzICwE
  1. APP version and compilation rules

In the previous section, we have added APP to the configuration options. In questo momento, buildroot still does not know how to

Scaricamento, extract, compile, ecc., we need to add a configuration file to tell buildroot how to operate, and we need to create “buildroot/

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

Sample code mytest.mk code

7K91CMpdAcnIuMIFD Tjz6o6bXGXnDlB9MD9zRpVkvTyU1zwblNmUtcn

This file tells buildroot how to compile, download, copy, eccetera. All capitalized macros start with “MYTEST”

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.

Linea 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.

Linea 18, this function will build the entire .mk file into a script.

Entra

buildroot/output/rockchip_rv1126_rv1109_spi_nand

Execute make menuconfig

turn onmytest

dDUP6OEOCT3yAoGnvvK vJBU J7WzJ RDpDruSk7NijEqiRP5NNhYiOOYHcfLZH2JwtnFLBk2hMjFZVUyoLOHyPxMhaPc OXvX1UMWLEXOz3gn mgdML g cKifUNWlBi7tqtpu4rIH oHLLX0oY0SA

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:

pLmQBu3MDm9KKAY2DutjOvJZZZQnbW80K9RMud NCkjrh003W13yYbIPHachP c5S8UfsOXwsbA1bm2AfzKluDFeuCiTVBFp9llxWsFVKjX8C6OcWRzz2uNLVfQGtxHQ7IjM hhUG hWYXBPcZlf oA

Download PDF file

https://ivcan.com/wp-content/uploads/Use-the-build-root-tool-to-make-RV1126-IMG-firmware.pdf

Fai una domanda

← Precedente

Grazie per la risposta. ✨

Lascia una risposta

Il tuo indirizzo email non verrà pubblicato. I campi obbligatori sono contrassegnati *