How to debug uboot using JLink+ADS1.2

Publisher:幸福自在Latest update time:2020-06-06 Source: eefocusKeywords:JLink Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

At first, I wanted to use the "Download & Run function" of supervivi+DNW in Nor Flash to download uboot.bin to SDRAM for debugging. However, since the laptop has been installed as ubuntu + Virtualbox (Windows XP), after allocating the USB download device in the supervivi stage to Virtualbox (Windows XP), it prompts "Cannot allocate USB device System MCU SEC S3C2410X Test B/D [0100] to the virtual computer Windows XP Workstation. Failed to create a proxy device for the USB device. (Error: VERR_READ_ERROR).", while other USB devices such as USB flash drives can be allocated to the virtual machine normally. Due to limited ability, I googled for a long time but still couldn't find a solution. According to experts on the Internet, it is because Virtualbox does not support USB devices very well. The problem also exists when allocating USB devices such as online banking U shields. I don't know if VMware has this problem. Therefore, I can only use other debugging methods. When I bought the development board, I also bought a copycat version of OpenJTAG and used it. During the uboot porting process, you can use JLink with the "code lighting method" to debug before the serial port initialization is completed and the log can be printed normally. You can also use the uboot write NAND FLASH function to write the adjusted firmware into NAND FLASH.


1. Use JLink+mini2440 to debug uboot


    1.1. Install the JLink driver. I installed JLinkARM_V402


    1.2. Connect the hardware


    1.3. Run Start->All Programs->SEGGER->J-Link Commander

    1.4. Set TCK to 12kHz to increase download speed


        J-Link>speed 12000


    1.5. Download and run init.bin to initialize mini2440SDRAM (this is the SDRAM of S3C2410 and S3C2440 that comes with the CD when you buy OpenJTAG. If you don’t have this init.bin, you can use the following JLink+AXD method to debug uboot). Here, put init.bin in the C drive and use NAND FLASH to start. If you use NOR FLASH to start, download it to 0x40000000 and run it.


        J-Link>loadbin C:init.bin 0


        J-Link>setpc 0


        J-Link>g


    1.6. After stopping init.bin, you can download uboot.bin to SDRAM for debugging (Note: uboot that runs directly on SDRAM for debugging needs to define CONFIG_SKIP_LOWLEVEL_INIT in the corresponding board-level configuration file to skip some of the underlying initialization codes. Here I set the loading and running address of uboot to 0x30000000)


        J-Link>h


        J-Link>loadbin F:ubootuboot-git-denxu-boot.bin 0x30000000


        J-Link>setpc 0x30000000


        J-Link>g


2. Use JLink+ADS1.2+mini2440 to debug uboot


    2.1. Install ADS1.2 and JLink drivers


    2.3. Open ADS1.2 and add Jlink.


        Select Options->Configure Target

ei

        Click “Add”

        Select the JLINK installation directory and select JLinkRDI.dll

    2.4.Configure Jlink


        Select the JLinkRDI.dll added in the previous step, select Configure on the right, and configure JLink

        Jump to JTAG options and set the frequency to 12000kHz

        Jump to Flash option and uncheck it as shown below.

        Jump to Breakpoints, as configured below

        Jump to CPU options and set as shown below

        The configuration is now complete. Select "OK" to return to the AXD interface. If the PC and target board have been connected via JTAG, the following connection information will be displayed.

    2.5. Set the MINI2440 SDRAM memory registers.


        Select MINI2440, nand boot mode, you need to set the SDRAM controller first. The setting method under AXD is to select systems views->command lines interface and enter the following command to set the registers


            setmem 0x53000000 0x00000000 32 

            setmem 0x4A000008 0xFFFFFFFF 32 

            setmem 0x4A00001C 0x000007FF 32 

            setmem 0x53000000 0x00000000 32

            setmem 0x56000050 0x000055AA 32 

            setmem 0x4C000014 0x00000007 32 

            setmem 0x4C000000 0x00FFFFFF 32 

            setmem 0x4C000004 0x00061012 32 

            setmem 0x4C000008 0x00040042 32 

            setmem 0x48000000 0x22111120 32 

            setmem 0x48000004 0x00002F50 32 

            setmem 0x48000008 0x00000700 32 

            setmem 0x4800000C 0x00000700 32 

            setmem 0x48000010 0x00000700 32 

            setmem 0x48000014 0x00000700 32 

            setmem 0x48000018 0x0007FFFC 32 

            setmem 0x4800001C 0x00018005 32 

            setmem 0x48000020 0x00018005 32 

            setmem 0x48000024 0x008E0459 32 

            setmem 0x48000028 0x00000032 32 

            setmem 0x4800002C 0x00000030 32 

            setmem 0x48000030 0x00000030 32


    To avoid entering the above long string of commands every time, you can write the register commands to be set above into a file (config_mini2440.txt), and use ob config_mini2440.txt in the command line to batch execute the settings, or make the following settings in AXD's options->Configure Interface, so that when you start AXD, you can automatically run the above script to complete the register initialization.

    2.6. Load uboot.bin and run


        Input in ConfigureInterface


        Debug>loadbinary F:ubootuboot-git-denxu-boot.bin 0x30000000


        Debug>setpc 0x30000000


        Debug>run

Keywords:JLink Reference address:How to debug uboot using JLink+ADS1.2

Previous article:SmartARM3250 user file system burning method
Next article:Mini2440 is used to migrate the ADS project to Keil MDK step by step

Latest Microcontroller Articles
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号