1. Introduction to onboard resources
The development board uses Samsung's JZ2440V3 (an improved version based on S3C2440). There are abundant resources on the Internet, which is helpful for learning. The onboard resources are shown in the figure:
The following points require special attention:
Generally, the JTAG programming port is used to program the program, and eop can be used.
There are two USB interfaces, of which USB-SERIAL can connect the development board to the host computer and debug through the serial port
Another USB port can be used to download programs
Onboard 2M Nor FLASH, the program can be directly burned into it
The onboard 256M Nand FLASH is the main data storage center, where you can write programs.
The startup mode can be selected: Nor or Nand startup, Nand is generally used
2. Install the driver and host computer
To get started, you need to install the following:
1. Install the USB serial port driver and host computer
2. Install the eop driver to connect the board to the host computer
3. Install OFLASH software to burn the bin file into the board
1.USB driver and host computer
USB Driver Installation
Teacher Wei Dongshan's materials contain all the required software, and the USB driver used is as shown, just install it directly:
Check in the device manager, as shown in the figure, the installation is successful:
USB host computer installation
After the upper computer software in the compressed data is compressed successfully, you can open the upper computer by running it as an administrator.
The host computer software is as follows:
The upper computer software interface is as follows: (I like this interface very much)
After the USB driver is successfully installed, configure the serial port information in the Session interface:
(Note: Select the corresponding USB serial port, bps: 115200, Flow control: None)
Then you can enter the serial port interface.
2.eop driver installation
The premise is to plug in eop
First, compress the driver file and copy the file path:
Then, open the device manager, check, update the driver on the exclamation point device, install it in the computer, and then enter the copied eop driver file path to install it:
Generally, there will be a prompt in win10: Hash table not found. This is because of the forced signature problem, which Google solves by itself.
You need to perform this operation on all devices with three exclamation marks until all are normal:
Can identify eop's USB to serial port function (COM8), JTAG function, Serial Port function
(Only JTAG function is needed for burning program at the beginning)
In this way, the USB and eop drivers are installed.
3. Install the burning software oflash
Install the burning software and burn the bin file into the board through the JTAG interface of eop.
Find the software in the information and install it directly:
You can enter oflash in the win10 command line to check whether the installation is successful:
As shown in the picture, oflash has been installed successfully.
At this point, the drivers and host computer software required by beginners have been installed successfully. The next step is to burn the program.
3. Burn the development board
The next step is to burn the program into the development board.
1. Preliminary knowledge
In the development of STM32, you only need to cpoy a project template, then write the driver in MDK, click compile and burn to burn the program into the development board. MDK does not open the details of compilation and burning to users. In the development of Linux embedded, we need to operate each step to burn it ourselves. Let's take a brief look at the general process of program burning:
First, write the driver code, usually through an editor, the written driver code is a .c file
Then, compile the .c file through the compiler to generate assembly code
Then, the assembly code is converted into target code by an assembler
Then, the linker converts the target code into executable code, which is the binary file .bin
Finally, burn the .bin file into the development board connected to eop through the oflash host computer
Among them, the work of editing C code is generally carried out under Windows. After writing, it is transferred to Linux, which completes the compilation, assembly, and linking of the C file. The generated binary file .bin is then transferred back to Windows and burned into the development board by oflash. The flow chart is as follows:
2. Burn the bare board
There are ready-made .bin files in the materials of Professor Wei Dongshan. Here we use the software oflah in conjunction with the Windows command line to burn the bare board program, which is equivalent to not involving Linux.
When introducing the onboard resources above, it was mentioned that there are Nor FALSH and Nand FLASH. So when burning the program, which FLASH is it burned into?
This depends on the burned bin file:
u-boot.bin can be used in both Nor and Nand
General bare board drivers such as lcd.bin and led.bin are burned into Nand
Please note that once the location for burning is determined, you need to choose how to boot the computer. You can choose to boot from the Nor or Nand storage area. This must be consistent with the location where the program is burned, because different storage locations may store different programs.
Burn all bin files: uboot.bin, lcd.bin... (bare board program)
Where to burn the program: uboot can be Nor, Nand, bare board program can only be nanf (all 0 address)
But when starting the bare board program, both flash can
The steps for burning the bare board program are generally as follows:
1. Find the .bin file
2. Open the win command line window and use cd to switch to the directory where the bin file is located
3. Use: oflash lcd.bin to burn
4. Configure the burning options: mainly the burning location (Nor, Nand), and the burning interface
5. Unplug the ecp (including reset), then select the corresponding boot mode (Nor or Nand), and power on again
6. You can also use the serial port host computer to debug the control development board
Note: Every time after re-burning the program, you must unplug the JTAG pin of eop, because there is a reset interface in the pin header to put the board in reset state. Also remember to select the corresponding startup method!
The programming speed of Nor FLASH is faster than that of Nand FLASH.
3. Use u-boot to burn the program
There is only one word to describe the u-boot burning program: fast!
For bare board development, we generally use JTAG tools, such as OpenJTAG, EasyOpenJTAG to program bare boards.
JTAG tools are slow, but bare metal programs are generally small, so this method is very convenient.
When I started playing with Linux, a kernel was more than 2MB, and it took several hours to burn it using the JTAG tool.
So we developed UBOOT with USB download function. When running UBOOT on the board, we can
Transfer huge files such as kernel and file system to the development board via USB cable on the computer: it's very fast!
The prerequisite for using USB download is that UBOOT is currently running on JZ2440.
Other bare board programs, or if the board has already booted into Linux, USB download cannot be used.
The above also introduces the mainstream way of burning files: burning programs to Nor or Nand through eop (bare board drivers can only be written to Nor through eop)
In fact, you can also burn programs through USB-Device. Here we will briefly introduce how to use u-boot in Nor to burn programs to Nand through USB-Decive.
First, you need to install the USB-Decive driver. This USB driver is different from the above driver. The above one is the USB serial port driver, and this one is the USB-Decive driver, which is the USB burning program, which is the following driver:
After installation, the device manager displays the following figure (the prerequisite is that u-boot is installed in Nor and Nor is started):
The following is the general process:
First, follow the previous method to burn the u-boot.bin program in Nor and connect the two USB ports.
Open the USB serial port host computer, select Nor boot, and restart the power
In the USB serial port host computer, when there is a display, quickly press the space bar to directly enter the u-boot menu. This operation will not start the file system, kernel, etc. on the board.
Operate u-boot in the host computer, as shown in the figure, by sending n instructions, use u-boot to burn the program into Nand FLASH
Select the bin file to be burned in the dnw software, double-click it, and it will be burned quickly.
At this point, the bin file is burned from USB-Decive to Nand
Power off, select Nand to start, power on again, and you can execute the program in Nand
4. Restore factory settings
When you want to restore the board to factory settings, you can first understand the board's startup process.
Teacher Wei Dongshan uses the PC startup process as an example:
The PC boot process is as follows:
Execute BIOS first when booting
Start Windows operating system from BIOS
The operating system identifies and mounts the C drive (including various APPs)
This is the PC boot process. The BIOS and operating system are all stored in the hard disk, so once the hard disk is initialized, it is equivalent to deleting the system. Because of this, the system cannot start the BIOS and operating system, let alone other things.
In embedded Linux, the boot process is similar to that of a PC:
The boot process of embedded Linux is:
Execute the boot-loader first after power on (u-boot is a common boot-loader)
Start the Linux kernel from u-boot
Linux kernel mounts the file system (it can run)
However, in embedded Linux, these u-boot, Linux kernel, and file system are all stored in FLASH, so if you want to restore the factory settings, you only need to reinstall u-boot, Linux kernel, and file system.
It is said above that u-boot can be in Nor or Nand, but the size of Nand FLASH is 256M, and Nor FLASH is only 2M, so the Linux kernel and file system are stored in Nand FLASH, as shown in the figure:
So we can restore the factory by re-burning the Linux kernel and file system. The process can be:
Previous article:S3C2440—6. Implementation of printf for serial port
Next article:S3C2440—2. Bare metal development steps and tool usage
Recommended ReadingLatest update time:2024-11-15 07:46
- 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
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- Kalman filter, help
- The ESP32-C3 module of Anxinke failed to run after burning MicroPython 1.1.17
- How to choose MOSFET indicators? System design of ACDC and DCDC? PCB layout and heat dissipation? Have you watched these useful videos?
- C2000 F2810 The program does not run after encrypting the CSM function
- Usage of DSP C54X ioport
- McBSP Serial Interface Technology and Program Design of TMS320VC5410
- Is this the intention of the forum?
- 4G DTU
- 400 V DC-BUS solution for UPS based on TI C2000
- CST Antenna Simulation and Engineering Design