Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use uboot+tftp to debug rt-thread programs on raspberry pie 4

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article is about how to use uboot+tftp to debug rt-thread programs on raspberry pie 4. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Use uboot+tftp on raspberry pie 4 to debug rt-thread program 1. The article explains

Embedded development is often an efficient and reliable development environment, which is very important for developers.

Because embedded programs often need to be run on the board, and there are usually three ways to do rt-thread development and debugging on raspberries.

First: SD card transfer

This method is to replace the kernel file in the SD card image, which will unplug the SD card every time, and then transfer the system image to the SD card from the computer.

The second kind: use uboot+tftp

The point of this method is to download directly through the network, which requires a network cable to be plugged in, and the host to build a tftp server.

The third kind: use uboot+ serial port ymodem

This is to take advantage of the function of ymodem in uboot, just load the firmware into memory through the serial port, and then specify the starting address of the memory.

Now I will mainly introduce the second way to explain.

two。 Compile uboot program

You can see my previous article on compiling raspberry pie 3 and compiling uboot.

Next, you can pay attention to the configuration

ARCH=arm64 CROSS_COMPILE=aarch74-linux-gnu- make rpi_arm64_defconfig

When the configuration is complete, enter make menuconfig. Then you need uboot's command to open dcache.

The orders here.

Then add the dcache command

Choice

Once the configuration is complete, you can compile

ARCH=arm64 CROSS_COMPILE=aarch74-linux-gnu- make

When the compilation is complete, the u-boot.bin program is generated.

3. Start uboot

Because the uboot is to be placed in the SD card directory, modify the config.txt first.

Enable_uart=1

Arm_64bit=1

Kernel=u-boot.bin

Then put the compiled firmware into the SD card.

Start it up and you can see the effect.

Set the environment variable:

Setenv bootcmd "dhcp 0x00200000 192.168.12.191915 rtthread. Binchedcache flush;go 0x00200000"

Saveenv

Set the IP address of your own tftp server. Dcache flush will be fine.

Finally, restart the system.

Each time you update the RTT firmware, put the compiled firmware directly into the folder of the TFTP server, and then restart the raspberry pie. You don't have to operate the SD card every time.

4. Compile rtt firmware

One thing to note here is to offset the firmware address of RTT.

Https://github.com/RT-Thread/rt-thread/tree/master/bsp/raspberry-pi/raspi4

Then set up the link.lds file. Change the starting address to 0x200000.

Because the entrance address of uboot is 0x80000, not if this is also 0x80000.

So just change the entrance address here.

Thank you for reading! This is the end of this article on "how to use uboot+tftp to debug rt-thread programs on raspberry pie 4". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report