JZ2440 Learning Notes

Source: Internet
Author: User
Tags jlink
JZ2440 Learning Notes

Chili

2015.5







Objective
I started JZ2440 half a month, not previously contacted Linux, but in school contact with many do not run Linux system CPU, with Lpc1114,lpc1343,stm32,blackfin and other processor programming experience, The principle of the microprocessor and the operating mode have a certain understanding. With this little experience, as well as new learning knowledge, hands-on transplant the latest uboot, absolutely original, thanks to teacher Wei's Books and Development Board, can let us this small white can enter the world of Linux, but I am in Linux is just a similar white students, many of the wrong place, I hope everyone feel free.




Description: Read this article need a little arm and s3c2440 basic knowledge, suggest reading "Embedded Linux application Development Complete manual", this book on arm and JZ2440 have a very good introduction and explanation, in reading there is not understand can also go to look at this book, check leakage fill.

JZ2440 Transplant Latest U-boot-2015.04-rc4.tar
1, configure Uboot
Go to the website to download the latest Uboot source code U-boot-2015.04-rc4.tar, the development environment using the JZ2440 CD on the VMware virtual machine ubuntu9.10.
This time using the default configuration of smdk2410 to configure Uboot, and then start a similar Linux-like Menuconfig menu for configuration, and then make, and burn write into the JZ2440 to see the effect, and then according to the phenomenon Step-by-step changes.
The basic principle of our transplant uboot is: because we have just started, may not know anything, even more do not know what to change, this time we try to do nothing, directly burned to see the phenomenon, and then according to the phenomenon or prompted information step-by-step changes, so that the transplant completed.
The configuration commands are as follows:
book@book-desktop:~/uboot/u-boot-2015.04-rc4$ Tar jxvf u-boot-2015.04-rc4.tar.bz2
book@book-desktop:~/uboot/u-boot-2015.04-rc4$ CD u-boot-2015.04-rc4/
book@book-desktop:~/uboot/u-boot-2015.04-rc4$ make Smdk2410_defconfig
book@book-desktop:~/uboot/u-boot-2015.04-rc4$ make Menuconfig
3, executing in the Uboot root directory
book@book-desktop:~/uboot/u-boot-2015.04-rc4$ make
Error:
Cc1:error:bad value (ARMV4) for-march= switch
Cc1:error:bad value (ARMV4) for-mtune= switch
MAKE[2]: * * * [include/autoconf.mk] Error 1
MAKE[1]: * * * [silentoldconfig] Error 1
Make: * * * No rule to make target ' include/config/auto.conf ' and needed by ' include/config/uboot.release '. Stop.
Mistakes are not scary, learn to look at the error prompts, according to the prompts to carry out the next step. The error message seems to be that the machine platform is not right, so let's specify, open the top-level makefile, specify the cross compiler and the schema platform:
book@book-desktop:~/uboot/u-boot-2015.04-rc4$ Vim Makefile
Add the following two lines as shown in the figure:
Arch=arm
cross_compile=arm-linux-

When you are done, execute again: Make starts compiling
book@book-desktop:~/uboot/u-boot-2015.04-rc4$ make
Error:
As ARCH/ARM/LIB/VECTORS.O
As ARCH/ARM/LIB/CRT0.O
As ARCH/ARM/LIB/RELOCATE.O
Arch/arm/lib/relocate. S:assembler messages:
Arch/arm/lib/relocate. S:50:error:selected processor does not support ' bx LR '
MAKE[1]: * * * [ARCH/ARM/LIB/RELOCATE.O] Error 1
Make: * * * [arch/arm/lib] Error 2
Patience seriously look at the wrong message, said not support BX LR directive, this is arm a jump instruction, no reason arm cross compiler does not support Ah, is not the version is too low.
View version:
Arm-linux-gcc-v

Version 3.4.5, seemingly JZ2440 CD on the Ubuntu on the cross-compilation environment is relatively old, then we search the Internet a new, loaded on try.
In the "http://dl.dbank.com/c01p81pb9i" site has arm-linux-gcc 4.4.3 download, and have a detailed installation method, the reader can download and install. After the installation is complete, review the version below to indicate successful installation.

2, compile
Uboot compilation on the basis of ARM-LINUX-GCC 4.4.3:
book@book-desktop:~/uboot/u-boot-2015.04-rc4$ make
The next step is to compile successfully and produce image files such as Uboot.bin.


3, burn write default configuration of Uboot
Because JZ2440 with Jlink,jlink generally does not support the burning write NAND falsh, of course, can buy hundred ask net Gflash, it can be burned by Jlink write NAND flash. We generally buy JZ2440 standard configuration Development Board, that I use nor flash start, and through the Jlink J-flash will uboot.bin burned into the nor flash, restart, observe the serial output.
Ps: Installation of preschool \j-link\usb-ice, after installation, open the J-flash, open the Development Board data \ How to burn write s3c2440 Bare Board program \s3c2440.jflash Project, open just compile the successful file Uboot.bin, press the F5 start programming.
Restart the Development Board, the serial port without any phenomenon, indicating that the default smdk2410.h configuration is still not applicable to the board with our JZ2440 now. Okay, let's start with a little bit of modification uboot.
4, modify Uboot support JZ2440 serial port
4.1 Modify Uboot Clock configuration
Serial port does not output words, the first thought must be the clock is not configured Well, good, have the idea to try immediately.
I believe that I have seen Mr. Wei's "Embedded Linux application Development complete manual," You should know that s3c2440 and s3c2410 clock calculation is not the same, so we open the SMDK2410.C, modify the initialization function in the clock configuration. The order is as follows:
book@book-desktop:~/uboot/u-boot-2015.04-rc4$ Vim board/samsung/smdk2410/smdk2410.c
Modified as follows:
1, change the clock macro as shown
#define M_MDIV 0x5c
#define M_PDIV 0x1
#define M_SDIV 0x1


2, modify the int board_early_init_f (void) function to add CLKDIVN register configuration
As follows:
Writel (0x5, &CLK_POWER->CLKDIVN);


Save, and compile, burn, and restart the Development Board to view the phenomenon:


Analysis: There are print garbled data, indicating that the board at least at work, but the baud rate set is not correct, below see the serial port baud rate where set, and to modify it.

4.2 Modified serial Port driver

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.