Switch the JZ2440 debug serial port to COM2

Source: Internet
Author: User

It is well known that JZ2440 V3 is very small and exquisite. Today, we will discuss some problems with the JZ2440 serial port alone. When debugging with the serial port, we need to use a USB cable from JZ2440 to connect the computer USB port and the USB-COM1 port of the Development Board. Let's take a look at JZ2440 's serial connection diagram:

From s3c2440 chip to lead TXD0 and RXD0 to Chip PL2303, we all know PL2303 is what to use. In the monolithic Development Board generally use this chip, its function is the USB to RS232 level, after the conversion of PL2303, the computer and Development Board can communicate, set the parameters will be able to display the Development Board printing information. JZ2440 at this point there is another place to say, is that it does not use other brand development boards commonly used RS232 DB9 interface, which greatly reduces the size of the development Board, while also reducing the cost of USB to serial cable, can be described as double benefit. What kind of interface is used in other development boards? As shown in the following:

Its serial work principle is the same, but the interface is different, there is also a diagram:

Understand the serial port work when the connection diagram can be modified on this basis, in order to solve the actual use of problems encountered. The problem immediately came, when using JZ2440 development, the serial port is on the SECURECRT output information. When outputting information, it occasionally causes a blue screen on the computer. This situation occurs when there is a large amount of data to display, such as after booting, executing the command ls-l/dev may cause a blue screen on the computer. So I put the system for XP, with a period of time, there is no blue screen, so should be the cause of the driver. Due to the use of habits, then my system upgraded from XP to Win7, Win8, Win8.1. When using JZ2440, there are frequent blue screen problems, and this PL2303 drive is like a DNW driver, especially difficult to install. The drive date is 2010/10/7 and cannot be used after the PL2303 is installed after this point in time.

However, the final driver or installed, the problem of a long time, often blue screen, seriously affect the development efficiency, and the blue screen after the computer after a long time to start, very uncomfortable. Think carefully, this problem is not because JZ2440 board problem, just because of system reason, to PL2303 chip support is not very in place. In order to solve this problem, I would like to discard the board's own debug serial port. After all, the board also extended three TTL serial port can be used. Theoretically there is no reason not to, so I intend to try. I took a closer look at the schematic of the JZ2440, and found the following wiring diagram:

There are three TTL serial ports to choose from, but the COM1 interface is the same as the usb-com1, so avoid unnecessary hassles, I intend to use COM2 to act as a debug serial port. If a line is connected directly between the computer and the Development Board, it is certainly not possible. The reason is very simple, the level is not the same, the two are unable to communicate. Modeled on the original circuit, I found several devices:



With all 3 of these devices? Another debugging serial port to be. But this is only a hardware connection, the following is the software part of the modification (need to recompile uboot and kernel):
1. First Modify the Uboot section , modify the file u-boot/include/configs/100ask24xx.h, according to the specific board to find the corresponding file.

#define CONFIG_SERIAL1 1
Switch
#define Config_serial2 1

Modify this place, the purpose is to tell bootloader, the system starts to the Bootloader debugging information output to the serial port COM2. So what exactly is the debug information for bootloader? In the following:

U-boot 1.1.6 (Sep 19 2014-22:44:53)

Dram:64 MB

Flash:2 MB

nand:256 MiB

In:serial

Out:serial

Err:serial

Upllval [M:38H,P:2H,S:2H]

Mpllval [m:5ch,p:1h,s:1h]

clkdivn:5h

+---------------------------------------------+

| s3c2440a USB Downloader ver R0.03 2004 Jan |

+---------------------------------------------+

Usb:in_endpoint:1 Out_endpoint:3

FORMAT: <addr (DATA): 4>+<size (n+10):4>+<data:n>+<cs:2>

Note:power off/on or press the reset button for 1 sec

In order to get a valid USB device address.

Hit any key to stop autoboot:0

Booting Linux ...

NAND read:device 0 Offset 0x60000, size 0x400000

Reading data from 0x45f800 – 100% complete.

4194304 bytes Read:ok

# # Booting image at 30007FC0 ...

Image name:linux-3.4.2

created:2014-09-19 15:10:15 UTC

Image Type:arm Linux Kernel image (uncompressed)

Data size:2439664 Bytes = 2.3 MB

Load address:30008000

Entry point:30008000

Verifying Checksum ... Ok

XIP Kernel Image ... Ok

Starting kernel ...

Here, uboot debugging information to print the end, the following will be all the task to the kernel. Some students compile a good kernel, start, card dead here, can only show that your uboot is normal, the kernel is not known as normal. To determine whether the kernel is normal, you can check the kernel print out debugging information.

Ii

#define Config_bootargs "NOINITRD root=/dev/mtdblock3 init=/linuxrc console=ttysac0"
Switch
#define Config_bootargs "NOINITRD root=/dev/mtdblock3 init=/linuxrc Console=ttysac1"

We all know that this parameter is to pass to the kernel, so modify this place, is to tell the kernel to the kernel debug information output to the serial port COM2.

2. Modify the kernel section , modify the file Linux/.config, yes, this is the configuration file generated after the make Menuconfig is executed, we can modify it directly

① for simplicity, I changed the file directly and no longer demonstrated the graphical interface.
Config_s3c_lowlevel_uart_port=0
Switch
Config_s3c_lowlevel_uart_port=1

The modification here is to let the kernel output low-level debugging information. To illustrate, the low-level debugging information is this sentence:

Uncompressing Linux ... what ... done, booting the kernel, ... ..... ... done, and ..., ... done?.. ".". ".". ".". ".". ".". ".". ".

②config_debug_s3c_uart=0
Switch
Config_debug_s3c_uart=1
This is to tell the Linux system, to the debug information output to the serial 2 above. With this sentence, you will see a lot of debugging information, when the system starts, most of the output information comes from this configuration.

After the 4-point modification is complete, recompile the uboot and kernel, re-burn the Write, start. OK, the serial port has been modified successfully. If the above 4 points are not fully modified, the following situation may occur:
The information on the uboot is shown on the COM1, and the kernel information is displayed on the COM2, which I have encountered.

Turn from teacher Wei's whole away

Two-dimensional code attached

Switch the JZ2440 debug serial port to COM2

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.