1. Error handling
An error was encountered in the previous section:
Print this:
It was found that none of the network parameters we wrote statically in jz2440.h were written.
dm9000 address not set. The address of dm9000 is not set.
There are two functions corresponding to this:
static int eth_pre_unbind(struct udevice *dev) 和 int eth_write_hwaddr(struct eth_device *dev, const char *base_name, int eth_number)
The two functions here correspond to the macro CONFIG_DM_ETH. Search in the file to see what this macro defines:
If there is no setting in config, the latter function should be run. The latter function is to set the hardware address.
The code for printing the address is as follows:
1 #ifdef CONFIG_NET_RANDOM_ETHADDR
2 net_random_ethaddr(dev->enetaddr);
3 printf("nWarning: %s (eth%d) using random MAC address - %pMn",
4 dev->name, eth_number, dev->enetaddr);
5 #else
6 printf("nError: %s address not set1.n",
7 dev->name);
8 return -EINVAL;
9 #endif
env_enetaddr is obtained from the eth_getenv_enetaddr_by_index function.
1 eth_getenv_enetaddr_by_index(base_name, eth_number, env_enetaddr);
2
3 int eth_getenv_enetaddr_by_index(const char *base_name, int index,
4 flying *enetaddr)
5 {
6 char enetvar[32];
7 sprintf(enetvar, index ? "%s%daddr" : "%saddr", base_name, index);
8 return eth_getenv_enetaddr(enetvar, enetaddr);
9 }
From several functions, we can know that if our dev->enetaddr is 0, the error message will be printed.
I tried several methods but failed to set it up successfully. I will put it here first and do other work.
2. Nand points
Enter the mtdparts command in u-boot:
Macros defined in jz2440.h:
Define the macro CONFIG_CMD_MTDPARTS to open the mtdparts command
Modify the run_main_loop function:
The function of the mtdparts_init() function is to construct partitions, which are represented by arrays.
Check the setting partitions in other places and write them as follows:
Compile and run, the results are as follows:
Here's a reminder: mtdparts variable not set, see 'help mtdparts' no partitions defined
This is because there are no parameters and the partitions have been printed below.
Execute two commands to create a partition, as follows:
Wipe partition:
Add code to automatically execute the two commands for the partition:
1 static int run_main_loop(void)
2 {
3 #ifdef CONFIG_SANDBOX
4 sandbox_main_loop_init();
5 #endif
6 // mtdparts_init(); /* Partition command initialization*/
7 run_command("mtdparts default",0); /* Automatically execute partition commands*/
8 /* main_loop() can return to retry autoboot, if so just run it again */
9 for (;;)
10 main_loop();
11 return 0;
12 }
Compile and run to see the effect.
3. Add the kernel startup command line
Just two commands:
Execute bootm to start the kernel
Previous article:u-boot transplantation (13)---Code modification---Support file system and patch production
Next article:u-boot transplantation (13)---Code modification---Cutting and environment variables 1
- 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
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- Do capacitors have a filtering effect on high-frequency DC signals?
- [OrCAD] How to display the name of the offpage connector after it is manually hidden?
- AD9 interface issues
- How to measure AC impedance?
- Studying Things to Gain Knowledge—by maychang
- It seems like I'm in trouble. I dropped a bunch of chips on the ground. I have to pick them up with my hands or tweezers. I'm waiting online. It's urgent.
- 【LuatOS-ESP32】Development environment construction
- 27 operators "abandon Huawei"! The United States released the list of "5G clean networks"
- A summary of the most downloaded electronic technical materials this week (2020-04-17)
- JTAG debug test access port TAP