Chuanglong Ruixin Micro RK3568 parameter modification (debugging port baud rate and rootfs file)

Foreword

I have written the basic file compilation, system compilation and system programming earlier, and the preliminary work is almost ready. The current stuff can solve most entry-level needs. Of course, if development is required, other things need to be modified. The following will introduce step by step how to modify the key parameters.

Given baud rate

When I got the development board, I followed the documentation step by step. It was not difficult to program the system, but I encountered problems during debugging. The first one is when connecting to the debugging serial port, which is quite troublesome.

Serial port baud rate: 1500000.

Connected software: SecureCRT 7.3. You must use this one. I have tried other ones but they can’t seem to come out. I have no choice but to use this one. It is included in the provided software and can be installed directly.

After entering, just follow the steps to change it. As for how to set it up, I won’t introduce it in detail. You can search it on many web pages. The only thing that needs to be told is how to set 1500000. I was very confused at first. The serial port baud rate was selected. Why is it 1,500,000?

There is no way to select this baud rate, it is not available in the drop-down menu. Double-click 115200 and write directly.

Note: I have been searching for this method for a long time, maybe everyone thinks it is easier to do. Or there are relatively few people using this baud rate and no one has introduced it. Anyway, I have been doing it for a long time, but I have no choice. If you know it, it will be very simple. If you don’t know, it will be very troublesome.

Digression

Many things are easy once you know them, but difficult when you don’t know them. Some friends after reading the article feel that what you wrote is too simple. Will you revise it soon? But if you don’t know where to modify, it’s very difficult. Just like a password, if you know the rules, it will be very simple and you can just decipher them. But what if you don’t know the rules? For example, I wrote 3031, can you guess what it is? If you don’t say it, it will definitely be difficult. If I tell you that it is an ASCII code, the corresponding code is 01. Isn’t it simple? In fact, there are specialties in the art industry, and it’s very simple once you learn them.

Modify baud rate

Let me talk about it first: there are a total of 3 places that need to be modified.

According to my understanding, let me first talk about the order in which the system is started. It may not be correct. It is based on the observed phenomenon.

miniloaderall file, uboot file, boot file (device tree and system file), rootfs file.

In fact, the development board starts printing as soon as it is powered on. According to the system user manual, the miniloaderall file contains the DDR initialization image and uboot spl image. That is to say, the debugging serial port baud rate when powered on is 1500000, so this 1500000 How did it come about? There must be a place in the system for transmission.

Then uboot starts, and things will be printed at this time. Of course, the baud rate is also 1,500,000. This place also involves the transmission of baud rate parameters.

Then comes boot startup, which means device tree and kernel startup. Things will also be printed at this time, and the baud rate is still 1,500,000. As for the subsequent top-level file system, the specific debugging serial port baud rate is no longer involved. What can be printed has been printed.

(1) ddr file

The baud rate here is the corresponding print before uboot starts. Specific modification steps:

Step 1: Check the DDR usage type

Location:/home/wang/RK3568/rk356x_linux_release_v1.3.1_20221120/rkbin/RKBOOT/

File name: RK3568MINIALL.ini

After opening, look for the parameters and path content, and find the file used inside: rk3568_ddr_1560MHz_v1.16.bin

Step 2: Modify parameters

Location:/home/wang/RK3568/rk356x_linux_release_v1.3.1_20221120/rkbin/tools/

File name: ddrbin_param.txt

After opening it, I added 115200. Of course, I was confused after opening it. There were = signs inside. In fact, slowly find the = number behind uart baudrate, and add 115200 after it.

Step 3: Compile

In the tools folder, open a terminal and execute the command:

./ddrbin_tool ddrbin_param.txt ../bin/rk35/rk3568_ddr_1560MHz_v1.16.bin

The specific bin file is stored in /home/wang/RK3568/rk356x_linux_release_v1.3.1_20221120/rkbin/bin/rk35/. This should correspond to the ini file and should not be ignored.

After compilation, there are two important parameters output: version and baud rate. If the output is correct, you should see:

By then, the parameters in the startup file have been modified correctly.

(2)uboot file

Location:/home/wang/RK3568/rk356x_linux_release_v1.3.1_20221120/u-boot/configs/

File name: rk3568_defconfig

After opening, find CONFIG_BAUDRATE and change 1500000 to 115200.

(3) Device tree file

Location:

/home/wang/RK3568/rk356x_linux_release_v1.3.1_20221120/kernel/arch/arm64/boot/dts/rockchip/

File name: rk3568-linux.dtsi

After opening it, find: rockchip, baudrate = <1500000>; change the 1500000 inside to 115200.

At this point, the baud rate modification parameters have been modified. Just compile everything as described in the previous article, and then program it. How to do it specifically, just follow the previous steps.

Phenomena

When I modified it myself, I did not modify it all, but modified it step by step. Many problems appeared in the middle. Interested friends can modify it one file at a time and try to see what will happen. Anyway, it will not be broken. If If it really doesn’t work, re-write the original update file and restore it to the original state.

(Test 1) Modify the uboot file and kernel file. These two are modified at the same time. These two modifications are easy to understand. uboot must print and the kernel must print. If these two files are modified, but ddr is not modified, burn these two files step by step, and other changes will not be burned, and the program will still run at 1,500,000.

(Test 2) The uboot file and kernel file are modified, but the ddr is not modified. Other compiled files will be burned together step by step depending on which ones have been modified. I found that the program was stuck in one place and stopped moving. The front ones can still be printed, but the latter ones are not. Stopped at:

cryptd: max_cpu_qlen set to 1000

In fact, the baud rate of my debugging serial port software is still 1,500,000 at this point, and it will not go down when printing. At that time, I felt that the settings must not be correct, so I had no choice but to restore the system.

Note: In fact, the baud rate has changed at this point, but the software does not display it because the baud rate has changed to 115200. This was discovered later. I discovered this problem later after I created the ddr file again. When the baud rate is 1500000, when the upper-layer software uses the baud rate of 115200 for communication, it will not print at first if it is not 115200. If you adjust the upper-layer software to 115200 at the beginning, garbled characters will appear. But if the development board starts with 1500000 and later changes to 115200, the upper-layer software cannot print it out. This is rather strange, I don’t understand why. Maybe it’s because all the files need to be burned in, but I only burned part of them and didn’t change all the files that needed to be changed.

(Test 3) DDR is not modified, uboot is modified, and boot is modified. After the overall burning, that is, the update file is burned as a whole. It is found that if the upper software is set to 1500000, then the first half of the printing will be normal, and the latter will become garbled. If the upper software is set to 115200, then the first half will print garbled characters, and then it will become normal. Only here did I discover the problem that occurred in test 2. It turns out that it has been printed, but the set baud rate has not changed, so it cannot be printed.

(Test 4) ddr is modified, uboot is not modified, and boot is not modified. Overall burning, the phenomenon is the same as test 3. Garbled characters will appear at a certain point.

All the test content was tested by myself. After I got it right, I went back and sorted out my ideas, hoping to know where to modify what would happen, and then explain why it was wrong. Finally, I found that everything was correct.

rootfs file

I want to have my own folder on the development board, but I have tried many places but can’t find it. I thought I could only use their best rootfs file, or I had to use other software to make it myself.

Location:

/home/wang/RK3568/rk356x_linux_release_v1.3.1_20221120/buildroot/output/rockchip_rk3568/target/

Just add what you need in this. Then change the step-by-step burning of the rootfs file. Instead of burning the entire file, just compile the rootfs. Then after programming, you will find the folder you need on the development board.

Conclusion

The above are the steps on how to modify the baud rate and file system. Friends who need it can try it. You can also add a public account. In previous articles, because csdn has no way to upload the QR code of the public account, you can only read the QR code in the previous article. The latest articles are updated simultaneously.

The knowledge points of the article match the official knowledge files, and you can further learn relevant knowledge. CS entry skill treeLinux introductionFirst introduction to Linux 37630 people are learning the system