How to Use jlink to indirectly burn the S3C2410, S3C2440 Development Board nor, and NAND Flash

Source: Internet
Author: User
Tags jlink

1. Brief Description
The debugging and flash burning functions of jlink are powerful, but it is difficult to perform flash operations on S3C2410 and S3C2440: You need to set SDRAM when burning or flash; otherwise, the speed is very slow; burning and writing NAND flash can only be achieved theoretically, but no one has implemented it directly.
In this article, an indirect method is used to burn or write non-NAND flash on the S3C2410 and S3C2440 development boards. Working principle: jlink can easily read and write memory and startProgramThen, you can download a special program to the sdram on the development board, run it, and then use this program for writing.

2. Run J-link commander.
J-link Commander startup interface 4 (if no CPU is detected, execute the USB command in it to connect to jlink, and then execute the R command to identify the processor ).

3 download and run the Special Program
for the S3C2410 and S3C2440 processors, they have 4 K internal SRAM. When the nor flash is started, the address is 0x40000000; when NAND Flash is enabled, the address is 0.
for the S3C2410 and S3C2440 development boards, 64 MB of SDRAM is usually added. Before the SDRAM can be used, it must be initialized.
therefore, first put an init. bin is downloaded to the internal SRAM to run. It executes the initialization of the SDRAM, and then downloads a large program, such as U-boot to the SDRAM, it implements the nor and NAND Flash operations.
here are the commands in J-link commander, assuming that init. Bin and u-boot.bin are under E: disk.
1. speed 12000 // set the TCK to 12 Mb, and the program will be downloaded soon
2. download and run init. bin, which is used to initialize the SDRAM
2.1 if it is a NAND boot:
loadbin E: \ init. bin 0
setpc 0
G
2.2 If nor is Enabled:
loadbin E: \ init. bin0 x 40000000
setpc 0x40000000
G
3. download specially crafted uboot:
H
loadbin E: \ u-boot.bin 0x33f80000
setpc 0x33f80000
G

of course, if there is no network and you do not want to accept the serial speed, you can also download it through jlink commander, for example:
H
loadbin your_file.bin 0x30000000
G
at this time, your file has been downloaded to SDRAM 0x30000000.
the subsequent operation is the U-boot command.
2.4 use U-boot to burn flash.
in this example, a name named LEDs is required. bin program to nor, NAND Flash, please refer to:
(1 ). download through jlink:
RUN
H
loadbin E: \ LEDs in J-link commander. bin 0x30000000
G
note LEDs. bin size
(2 ). write to nor flash through U-boot:
run the following command in U-boot:
protect off all // unlock
erase 0 2 FFFF // erase the nor flash sector whose size starts from 0 and ranges from 0 to (the size can be an integer multiple of the erased block, run the flash info command.)
CP. B 0x30000000 0 30000 // burn the program downloaded to 0x30000000 to no R to
(3 ). write to NAND flash through U-boot:
run the following command in U-boot:
NAND erase 0 30000 // erase the nnad flash sector whose size starts from 0 and ranges from 0 to
NAND write. jffs2 30000000 0 30000 // run the program previously downloaded to 0x30000000 and write it to NAND.
note that the 2 FFFF, 30000, and other numbers above are 192 KB, if your program is small, set it on your own.

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.