1. Brief description
JLink's debugging and Flash burning functions are very powerful, but the Flash operations of S3C2410 and S3C2440 are a bit troublesome: SDRAM needs to be set when burning Nor Flash, otherwise the speed is very slow; burning Nand Flash is only theoretically possible, but no one has directly implemented this yet.
This article uses an indirect method to implement the programming of the Nor and Nand Flash of the S3C2410 and S3C2440 development boards. The principle is: JLink can easily read and write memory and start programs, so a special program can be downloaded to the SDRAM on the development board, run it, and then use this program to program.
2. Operation steps
2.1 Connecting the Hardware
For most S3C2410 and S3C2440 development boards, there are generally three types of JTAG interfaces they use (as shown in Figure 1), of which the first two are more commonly used.
However, most JLinks on the market only support the third JTAG interface, so an adapter board is needed. Or you can directly use a variant of JLink, such as the two improved versions of JLink shown in Figure 2:
Take mini2440 as an example, connect the JTAG line as shown in Figure 3.
2.2 Run J-Link commander
The J-Link commander startup interface is shown in Figure 4. (If no CPU is detected, execute the usb command to connect to JLink, and then execute the r command to identify the processor).
2.3 Download and run a specially crafted program
For S3C2410 and S3C2440 processors, they have 4K SRAM inside. When booting with Nor Flash, the address is 0x40000000; when booting with Nand Flash, the address is 0.
For S3C2410 and S3C2440 development boards, 64M SDRAM is usually connected externally. Before SDRAM can be used, it needs to be initialized.
Therefore, first download an init.bin to the internal SRAM to run, which performs the initialization of SDRAM; then download a larger program, such as u-boot to SDRAM to run, which will implement the operation of Nor and Nand Flash.
The following are the commands in J-Link commander, assuming that init.bin and u-boot.bin are in the e: drive.
1. speed 12000 //Set TCK to 12M, the download speed will be very fast
2. Download and run init.bin, which is used to initialize SDRAM
2.1 If it is NAND boot:
loadbin e:init.bin 0
setpc 0
g
2.2 If it is Nor startup:
loadbin e:init.bin 0x40000000
setpc 0x40000000
g
3. Download the special uboot:
h
loadbin e:u-boot.bin 0x33f80000
setpc 0x33f80000
g
The above operation commands can refer to Figure 5.
Now, u-boot has been started, and you can see the interface shown in Figure 6 on the serial port tool. You can then download files through the network or serial port, and then use the commands in u-boot to burn them.
Of course, if there is no network and you don't want to endure the serial port rate, you can also download it through jlink commander, for example:
h
loadbin your_file.bin 0x30000000
g
At this point, your file has been downloaded to SDRAM 0x30000000.
The subsequent operations are u-boot commands.
2.4 Use u-boot to burn Flash
For example, suppose you need to burn a program named leds.bin to Nor and Nand Flash, then please refer to:
(1) Download via Jlink:
Execute in J-Link commander:
h
loadbin e:leds.bin 0x30000000
g
Note the size of leds.bin
(2) Burn to Nor Flash via u-boot:
Execute in u-boot:
protect off all // unlock
erase 0 2ffff // Erase the NOR Flash sector with a size of 0x30000 starting from address 0 (the size is an integer multiple of the erasable block, which can be viewed by running the flash info command)
cp.b 0x30000000 0 30000 // Burn the program downloaded to 0x30000000 to NOR
(3) Burn to Nand Flash via u-boot:
Execute in u-boot:
nand erase 0 30000 // Erase the Nnad Flash sector with size 0x30000 starting from address 0
nand write.jffs2 30000000 0 30000 // Burn the program downloaded to 0x30000000 to Nand
Note that the numbers 2ffff, 30000, etc. used above are 192K. If your program is smaller, please set it yourself.
Previous article:S3C2440 startup process and assembly code knowledge
Next article:Detailed analysis of the s3c2440 startup process
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Three steps to govern hybrid multicloud environments
- Three steps to govern hybrid multicloud environments
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- How is the storage period of components calculated?
- The Definitive Guide to FPGA Rapid System Prototyping (Chinese)
- Temperature problems solved for you (IV) Ambient temperature monitoring
- LGA-12 package soldering issues
- [NXP Rapid IoT Review] +3.rapid-iot-studio example bin summary
- GD32E231 Learning 4: External Interrupt EXTI
- The smallest Bluetooth module in the industry? Now available
- Questions about I2C communication
- Bullshit, playing with a 4.2-inch e-ink screen price tag
- ZigBee (CC2530, ZSTACK) transparent transmission example