Detailed explanation of porting u-boot-2011.03 to Mini2440 under Windows (1)

Publisher:茶叶侠Latest update time:2022-05-20 Source: eefocusKeywords:Windows  u-boot  Mini2440 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

ARM development environment construction under WinXP


XP version: 2002 Service Pack 3


Tools used:


Eclipse as a compile/debug IDE;


Mingw as Linux compilation environment;


ARM-EABI as a cross-compilation environment;


Jlink as debugger;


Main reference articles:


《Build andDebug U-Boot in Eclipse Helios On Window XP.pdf》


"Using Sourcery CodeBench to compile u-boot.doc based on am3359 in Windows environment"


To modify the package version in Mingw, please refer to the website http://sourceforge.net/projects/mingw/files/Installer/mingw-get/ (I haven't tried it)


Note: If there is anything unclear about the environment setup, you can refer to the two articles above to see how it is done.


Software used:


MinGW:mingw-get-setup.exe


ARM-EABI:arm-2011.03-42-arm-none-eabi-i686-mingw32.tar.bz2


JRE:jre-7u51-windows-i586.4008071178.exe


Eclipse:eclipse-cpp-kepler-SR1-win32.zip zylincdt4.18.1


Mini2440 Development Board Resources


ARM:S3C2440A


Nor Flash:SST39VF1601 ---2MB


Network chip: DM9000EP


SDRAM: HY57V561620FTP-H 133MHZ 2 * 32MB SDRAM


NandFlash: K9F1208U0B:64MB


Uboot version: 2011.03


Download the required version from the uboot official website http://ftp.denx.de/pub/u-boot/: u-boot-2011.03.tar.bz2.


This article provides two methods for setting up the environment. Method A is to download and install from the Internet, and Method B is to use the downloaded tools directly, but it is also a complicated step. If there is anything that is not explained in place, you can refer to Method A and B. The reference of the above article is also indispensable.


Method A:


First compile it in the Mingw command line window.


1. Install Mingw.


Download mingw-get-setup.exe from the official website http://sourceforge.net/projects/mingw/files/.

mingw-get-setup.exe is an installation management software. You can choose the installation path yourself. The name of the management software after installation is "MinGW Installation Manager". Select all Packages in Basic Setup (currently only BasicSetup has been installed and no problems have been found), and then Apply Changes. The corresponding path of MinGWInstallation Manager is: MinGWlibexecmingw-get guimain.exe


Create an msys.bat file according to the 5th and 6th pages of Build and Debug U-Boot in Eclipse Helios On Window XP.pdf. Then double-click to open it and enter the Mingw command line window. Enter gcc –v, as shown below. If you cannot check the gcc version, you can refer to the "Installation Environment" section in Method B.

2.ARM-EABI


Download the ARM cross-compilation tool from https://sourcery.mentor.com/sgpp/lite/arm/portal/subscription?@template=lite.

Select either .exe or .bz2

The current version is: 2013.11-24-V4.8.1


3. uboot


Download the required version from the uboot official website http://ftp.denx.de/pub/u-boot/ u-boot-2011.03.tar.bz2, and then unzip the bz2 file through the Mingw command window.


4. Compile on the Mingw command window.


Before compiling, the junction mentioned in the reference article and the strip mentioned in the other article were not used, but the compilation was successful.


Refer to the "Setting up the MinGW environment" and "Compiling mini2440" sections in Method B.


The following errors have occurred. Three changes were made to the URL, but only two were found here.

image.png

The arm version above is still the previous 4.5.2, which has been changed to 4.8.1 later, but this just explains an error.


If the Mingw command line window above compiles successfully, you can compile it in the Eclipse environment. Before installing Eclipse, you must first install jre.


5. Install jre.


Type Java Runtime Environment on Baidu, the first one is, download and install.

6. Install Eclipse.


Download from Eclipse official website http://www.eclipse.org/downloads/.

The 32-bit version is downloaded here, you can just unzip it and no installation is required.


7. Install zylincdt.


Download zylincdt, you can also install it online. Here is the direct download and installation.


At first, I downloaded 4.16.1 from http://repo.or.cz/w/zylincdt.git, and always got errors when installing it through Eclipse->help->Install Newsoftware.

Then I checked the Automatically checkbox in Eclipse->window->Preferences->Install/Update (it should have nothing to do with this).

And by downloading zylincdt4.18.1 from http://opensource.zylin.com/zylincdt/, the first installation also failed, and I installed it again, and there was no error message during the installation.


Note: Downloading 4.18.1 from http://repo.or.cz/w/zylincdt.git should be able to install successfully.


8. Compile settings


Create a uboot project and modify the environment variables. Then compile it and it will work. The contents of Junction and strip have not been modified, but it has been compiled. I don't know if there are any problems. I can only wait until the next step of debugging and verification.


Regarding how to open the uboot project in Eclipse, please refer to "Using Sourcery CodeBench to compile u-boot.doc based on am3359 in the window environment", and there are also shortcuts for make distclean and config. As shown in the figure below:

In the following step, make sure that the Value in PATH contains only the three newly added paths. Otherwise, an error will be reported.

image.png

Among them, T:bin;T:msys1.0bin;D:ProgramARM_CROSSarm-2013.11-24-V4-8-1bin is the path of MinGW and ARM EABI, which depends on the installation path of the local PC.

Build command:


Make CROSS_COMPILE=${CROSS_COMPILE}



Notice:


When using arm-linux-gdb to debug and arm-linux-gcc to compile uboot, it is found that the program execution order is chaotic, not sequential, and some variables cannot be printed out. The reason for this problem is that -Os is used by default to optimize the compilation when uboot is compiled, so this optimization needs to be turned off.


Clear optimization options:


In the top-level directory's config.mk, change OPTFLAGS= -Os#-fomit-frame-pointer to OPTFLAGS= -O0#-fomit-frame-pointer, and run make clean -> make xxxx_config->make all again. You can change it back when you don't need to debug and generate bin files.


9. Debug Settings


Change RunàDebug Configuration to the following figure:



The initialization code used above is as follows:


# connect to the J-Link gdb server


target remote localhost:2331


# Set JTAG speed to 30 kHz


monitor endian little


monitor speed 30


# Reset the target


monitor reset


monitor sleep 10


#


# CPU core initialization (to be done byuser)


#


# Set the processor mode


monitor reg cpsr = 0xd3


#config MMU Configure MMU


#flush v3/v4 cache


monitor cp15 7, 7, 0, 0 = 0x0


#/* flush v4 TLB coprocessor*/


monitor cp15 8, 7, 0, 0 = 0x0


#disable MMU stuff and caches


monitor cp15 1, 0, 0, 0 =0x1002


#Peri port setup


monitor cp15 15, 2, 0, 4 = 0x70000013


#disable watchdog kangear Disable watchdog


monitor MemU32 0x53000000 = 0x00000000


monitor sleep 10


#disable interrupt kangear disable interrupt


monitor MemU32 0x4A000008 = 0xffffffff


monitor MemU32 0x4A00001C = 0x7fff


#set clock


#initialize system clocks --- locktimeregister


monitor MemU32 0x4C000000 = 0xFF000000


#initialize system clocks --- clock-divnregister


monitor MemU32 0x4C000014 = 0x5#CLKDVIN_400_148


#initialize system clocks --- mpll register


monitor MemU32 0x4C000004 = 0x7f021#default clock


#config sdram


monitor MemU32 0x53000000 0x00000000


monitor MemU32 0x4A000008 0xFFFFFFFF


monitor MemU32 0x4A00001C 0x000007FF


monitor MemU32 0x53000000 0x00000000


monitor MemU32 0x56000050 0x000055AA


monitor MemU32 0x4C000014 0x00000007


monitor MemU32 0x4C000000 0x00FFFFFF


monitor MemU32 0x4C000004 0x00061012


monitor MemU32 0x4C000008 0x00040042


monitor MemU32 0x48000000 0x22111120


monitor MemU32 0x48000004 0x00002F50


monitor MemU32 0x48000008 0x00000700


monitor MemU32 0x4800000C 0x00000700


monitor MemU32 0x48000010 0x00000700


monitor MemU32 0x48000014 0x00000700


monitor MemU32 0x48000018 0x0007FFFC


monitor MemU32 0x4800001C 0x00018005


monitor MemU32 0x48000020 0x00018005


monitor MemU32 0x48000024 0x008E0459


monitor MemU32 0x48000028 0x00000031


monitor MemU32 0x4800002C 0x00000030


monitor MemU32 0x48000030 0x00000030


# Setup GDB for faster downloads


#set remote memory-write-packet-size 1024


monitor speed auto


break _start


load



Clear the contents of Source. If you start debugging without clearing the contents at the beginning, the start.S file found during debugging will be incorrect.

Method B:


The reference materials and software used in method B can be found at the 360 ​​cloud disk address http://yunpan.360.cn/, in the "ARM Environment Software" directory, please do not delete it.


1. Installation environment


Unzip MinGW and install arm-2013.11-24-arm-none-eabi.exe.


Add F:ARM-ENVMinGWbin;F:ARM-ENVMinGWmsys1.0bin to the system environment variables, as shown below. Replace F:ARM-ENVMinGWbin;F:ARM-ENVMinGWmsys1.0bin with your own directory. Then log out of the machine.


 

Double-click msys.bat in the MinGW directory. If it cannot be opened, modify it according to the figure below.

Enter gcc –v in the command line, as shown below.


2. Set up the MinGW environment


Enter the directory where the uboot source code is located, enter tar jxvf u-boot-2011.03.tar.bz2 to decompress the uboot source code to the current directory. Enter the decompressed uboot source code directory.


Then enter in the command line:


PATH=/bin:$PATH


PATH=/F/ARM-ENV/Sourcery_CodeBench_Lite_for_ARM_EABI/bin:$PATH


Then enter arm-none-eabi-gcc –v to see the version information. /F/ARM-ENV/Sourcery_CodeBench_Lite_for_ARM_EABI/bin is the installation path of the arm cross tool.


enter:


exportPATH


CROSS_COMPILE=arm-none-eabi-


exportCROSS_COMPILE


Then type make distclean

Test smdk2410, enter make smdk2410_config

You can also configure it correctly. Then you can make it, but there will be errors when making it. It is better to make 2440 directly, so you need to add the configuration of mini2440.


3. Compile mini2440


Add mini2440 related information to the boards.cfg file in the root directory of uboot.


Reference: http://www.linuxidc.com/Linux/2011-08/40553.htm

 

Copy the smdk2410 folder under boardsamung to the mini2440 folder, and change the smdk2410.c in the mini2440 folder to mini2440.c, and change the smdk2410.o in the makefile in this directory to mini2440.o.

[1] [2]
Keywords:Windows  u-boot  Mini2440 Reference address:Detailed explanation of porting u-boot-2011.03 to Mini2440 under Windows (1)

Previous article:Detailed explanation of porting u-boot-2011.03 to Mini2440 under Windows (2)
Next article:Ucos porting related to 2440 (ARM9)

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号