4. When I used ftp , I failed to log in because I did not have the username and password of the uClinux on the target board. If you do not encounter such a problem, it is best not to follow the following method!
Here is the solution I summarized: There are two servers, tftp and ftp , in the user directory of
uClinux , which can realize the remote file transfer function. Tftp is relatively simple and does not require a username and password, while ftp is relatively complete and can detect usernames and passwords. When compiling uClinux , select ftpd when selecting the application in make menuconfig , and select chroot in busybox and password in tinylogin . Then make user_only , make romfs , make image , and make can generate an image that automatically runs the ftpd program when uClinux starts . However, when using ftp to log in, you need to detect the user's password file, and the password file is generated by tinylogin . The passwd file used in Tinylogin is in the /etc directory, while the passwd file detected by the library function getpwnam used by ftpd in uc-libc is in /etc/config , so I directly modified the lib/libc/getent/getpwnam.c file and defined the full path of the passwd file in it as /etc/passwd . In this way, recompile make lib_only , make user_only , make romfs , make image , and the image generated after make can realize ftp login. I modified the source code of auth.c under uClinuxuClinux44b0uClinu x-distuserftpd : in auth_user (const char *name,struct credentials *pcred) { return 0; in auth_pass (const char *passwd, struct credentials *pcred) { return 0; In this way, when logging in to ftp , you can enter any username and password. As for telnet , you don't need a username and password. You can log in to the uClinux of the target board by entering telnet 192.168.0.100 in the run. However, the keyboard input of telnet is not very good, and the backspace is not normal, so it is not recommended to use it. What is strange is that after doing the above, the directory display of the serial terminal is also normal (there are more symbols that should not be displayed)! Enter ftp 192.168.0.100 in the run to log in to the ftp of the target board uClinux : Enter any username and password. The following is the interface after successful login: Enter the bye command to exit , and other commands can be displayed by entering the help command. 5. XP system host accesses the uClinux of the target board through FTP Open FlashFXP , click Quick Connect, and enter the IP address of the target board in the dialog box that appears . Here is 192.168.0.100 , the port number is 21 , and the username does not need to be filled in. Remember to check the front of Anonymous. Others do not need to be filled in, and then click Connect. OK , it's connected! You can see the directory of the target board uClinux! Then set the host's viewing folder to the shared folder of Red Hat Linux and Windows XP in the VM5.0 virtual machine to facilitate future file transfers! In FlashFXP , double-click the var or tmp directory of the target board uClinux to enter the var or tmp directory (because the vart and tmp directories are built in RAM and are writable. Of course, the data will disappear after power failure. This method is often used for debugging). Then you can drag the executable file to the var or tmp directory to complete the file transfer. At this point, the executable file has been transferred to the directory /var or /tmp , but the executable attribute of the file has not been set. To add the executable attribute of the file, type the command: chmod 755 armtest (armtest is the file name of the executable file) chmod
It is a command for modifying file permissions. When a file is created, access permissions are automatically set. If these default permissions do not meet the needs of the enterprise environment, the chmod command can be used to modify access permissions. Usually, there are two ways to represent permission types when modifying permissions, digital representation and text representation.
Here we use digital representation, that is, read (r) , write (w) and execute (x) are represented by 4 , 2 , and 1 respectively . The part without granted permissions is represented by the value of 0 , and then the granted permissions are added first. Table 7.4 lists several examples for readers.
Each three characters form a group, so the permissions can be divided into three groups. The first group represents the access permissions of the file owner, the second group represents the access permissions of the group members to which the file owner belongs, and the last group represents the access permissions of users outside the group to which the file owner belongs. I hope readers can study the allocation of permissions clearly.
The command typed here means that the file owner is granted the permissions of reading, writing, and executing, while the members of the group to which the file owner belongs and users outside the group to which the file owner belongs only have the permissions of reading and executing.
Execute the program armtest , type the command:
./ armtest (haha, the LED on the target board finally flashes)
6. Linux system host accesses the target board's uClinux through FTP. Run the gtfp software
in the RedHat Linux 9.0 system . For network configuration issues, please refer to "Vmware virtual machine + RedHat 9.0 Linux network configuration": Enter the target board system's IP address and set the port number to 21, and log in: 7. Set up an FTP server on the XP system host. After setting up the FTP server on the XP system host , the target board's uClinuxXP can access the XP system host through FTP and download files by itself, but the method is not as easy to use as FlashFXP. First, go online and download the wftpd.exe file, start the software, select the menu "Security"->"users and rights" , click "New User" in the pop-up dialog box , then enter the user name you want to create in the pop-up dialog box, and finally enter the login password you want to set in the pop-up dialog box. For the convenience of future input, you can leave it blank^_^ Click OK and return to the first dialog box: select the newly created user in "User Name ", click the "Right<< " button, set the user's permissions and accessible directories, and it is best to click the "Done " button to complete the configuration and exit. At least the FTP server on the XP system host is finally set up! 8. The target board's uClinux accesses the XP system host through FTP When the target board and the XP system host have been correctly connected and the FTP server has been set up on the XP system host , first enter the writable directory var or tmp of the target board's uClinux system (don't forget this), and log in to the XP system host: cd var ftp 192.168.0.80 At this time, enter the username and password on the XP system host, and an FTP connection is established with the XP system host . To transfer binary files, type the command: Binary The hyperterminal will display: 200 Type set to I Please note here: When using FTP for file transfer, you must select the file transfer mode. The default mode of FTP is binary mode, but for the sake of safety, it is still necessary to manually rewrite the transfer mode to binary mode. Usually txt , html and most PS files are in text format, while other executable files and compressed files are in binary format. Use the ascii and binary commands to switch between the two formats , both of which can be appropriately abbreviated. Transfer the compiled executable file (such as armtest ) to the target board and type the following command: get armtest. Exit the FTP service and type the following command: bye. Please refer to Section 5 for setting file permissions and executing programs. IX. Access the Internet on the target board! First, use a network cable to connect your target board to the external network; use the SecureCRT software as the serial port display terminal of the target board; SecureCRT can display colors and is smarter than ordinary serial ports. Enter the following command to set the routing IP : route add default gw 192.168.0.1. Finally, use the telnet command to log in to the host you want to log in to. Here, you are logging in to the South China Kapok BBS and enter the following command: telnet 202.112.17.137 . X. Written at the end
This method is quite useful in the development of application programs. It allows users to compile code in the development environment of the host machine, but the compiled flat format file is not placed in the FLASH memory of the target system, but runs in the SDRAM of the system , which greatly saves debugging time. The kernel compilation only needs to be performed once, so that developers can devote more energy to the development of applications.
However, since the uClinux operating system kernel currently used uses ROMFS as its root file system, when the uClinux of the target system starts running, most of its directories are built in the FLASH memory, so they are not writable. Only a few directories such as var and tmp are built in SDRAM , which are readable and writable, but if the target system loses power, the content is lost. Therefore, it can only be used for application debugging. When the application debugging is completed, it should also be written to the FLASH memory. Of course, if JFFS/JFFS2 can be used in the target system to replace ROMFS as its root file system, the entire target system will be as convenient as having a disk, and the loading of user applications will no longer need to be carried out in the way described above. Regarding the establishment of the JFFS/JFFS2 file system, please refer to relevant technical information.
Keywords:Network
Reference address:How to add applications to the 44B0 system via the network Part 2
Here is the solution I summarized: There are two servers, tftp and ftp , in the user directory of
uClinux , which can realize the remote file transfer function. Tftp is relatively simple and does not require a username and password, while ftp is relatively complete and can detect usernames and passwords. When compiling uClinux , select ftpd when selecting the application in make menuconfig , and select chroot in busybox and password in tinylogin . Then make user_only , make romfs , make image , and make can generate an image that automatically runs the ftpd program when uClinux starts . However, when using ftp to log in, you need to detect the user's password file, and the password file is generated by tinylogin . The passwd file used in Tinylogin is in the /etc directory, while the passwd file detected by the library function getpwnam used by ftpd in uc-libc is in /etc/config , so I directly modified the lib/libc/getent/getpwnam.c file and defined the full path of the passwd file in it as /etc/passwd . In this way, recompile make lib_only , make user_only , make romfs , make image , and the image generated after make can realize ftp login. I modified the source code of auth.c under uClinuxuClinux44b0uClinu x-distuserftpd : in auth_user (const char *name,struct credentials *pcred) { return 0; in auth_pass (const char *passwd, struct credentials *pcred) { return 0; In this way, when logging in to ftp , you can enter any username and password. As for telnet , you don't need a username and password. You can log in to the uClinux of the target board by entering telnet 192.168.0.100 in the run. However, the keyboard input of telnet is not very good, and the backspace is not normal, so it is not recommended to use it. What is strange is that after doing the above, the directory display of the serial terminal is also normal (there are more symbols that should not be displayed)! Enter ftp 192.168.0.100 in the run to log in to the ftp of the target board uClinux : Enter any username and password. The following is the interface after successful login: Enter the bye command to exit , and other commands can be displayed by entering the help command. 5. XP system host accesses the uClinux of the target board through FTP Open FlashFXP , click Quick Connect, and enter the IP address of the target board in the dialog box that appears . Here is 192.168.0.100 , the port number is 21 , and the username does not need to be filled in. Remember to check the front of Anonymous. Others do not need to be filled in, and then click Connect. OK , it's connected! You can see the directory of the target board uClinux! Then set the host's viewing folder to the shared folder of Red Hat Linux and Windows XP in the VM5.0 virtual machine to facilitate future file transfers! In FlashFXP , double-click the var or tmp directory of the target board uClinux to enter the var or tmp directory (because the vart and tmp directories are built in RAM and are writable. Of course, the data will disappear after power failure. This method is often used for debugging). Then you can drag the executable file to the var or tmp directory to complete the file transfer. At this point, the executable file has been transferred to the directory /var or /tmp , but the executable attribute of the file has not been set. To add the executable attribute of the file, type the command: chmod 755 armtest (armtest is the file name of the executable file) chmod
Here we use digital representation, that is, read (r)
Each three characters form a group, so the permissions can be divided into three groups. The first group represents the access permissions of the file owner, the second group represents the access permissions of the group members to which the file owner belongs, and the last group represents the access permissions of users outside the group to which the file owner belongs. I hope readers can study the allocation of permissions clearly.
The command typed here means that the file owner is granted the permissions of reading, writing, and executing, while the members of the group to which the file owner belongs and users outside the group to which the file owner belongs only have the permissions of reading and executing.
Execute the program armtest
./ armtest
6. Linux
in the RedHat Linux 9.0 system . For network configuration issues, please refer to "Vmware virtual machine + RedHat 9.0 Linux network configuration": Enter the target board system's IP address and set the port number to 21, and log in: 7. Set up an FTP server on the XP system host. After setting up the FTP server on the XP system host , the target board's uClinuxXP can access the XP system host through FTP and download files by itself, but the method is not as easy to use as FlashFXP. First, go online and download the wftpd.exe file, start the software, select the menu "Security"->"users and rights" , click "New User" in the pop-up dialog box , then enter the user name you want to create in the pop-up dialog box, and finally enter the login password you want to set in the pop-up dialog box. For the convenience of future input, you can leave it blank^_^ Click OK and return to the first dialog box: select the newly created user in "User Name ", click the "Right<< " button, set the user's permissions and accessible directories, and it is best to click the "Done " button to complete the configuration and exit. At least the FTP server on the XP system host is finally set up! 8. The target board's uClinux accesses the XP system host through FTP When the target board and the XP system host have been correctly connected and the FTP server has been set up on the XP system host , first enter the writable directory var or tmp of the target board's uClinux system (don't forget this), and log in to the XP system host: cd var ftp 192.168.0.80 At this time, enter the username and password on the XP system host, and an FTP connection is established with the XP system host . To transfer binary files, type the command: Binary The hyperterminal will display: 200 Type set to I Please note here: When using FTP for file transfer, you must select the file transfer mode. The default mode of FTP is binary mode, but for the sake of safety, it is still necessary to manually rewrite the transfer mode to binary mode. Usually txt , html and most PS files are in text format, while other executable files and compressed files are in binary format. Use the ascii and binary commands to switch between the two formats , both of which can be appropriately abbreviated. Transfer the compiled executable file (such as armtest ) to the target board and type the following command: get armtest. Exit the FTP service and type the following command: bye. Please refer to Section 5 for setting file permissions and executing programs. IX. Access the Internet on the target board! First, use a network cable to connect your target board to the external network; use the SecureCRT software as the serial port display terminal of the target board; SecureCRT can display colors and is smarter than ordinary serial ports. Enter the following command to set the routing IP : route add default gw 192.168.0.1. Finally, use the telnet command to log in to the host you want to log in to. Here, you are logging in to the South China Kapok BBS and enter the following command: telnet 202.112.17.137 . X. Written at the end
However, since the uClinux operating system kernel currently used
Previous article:In yaffs2, after mounting the mtd block device, insmod died
Next article:How to add applications to the 44B0 system via the network Part 2
- Popular Resources
- Popular amplifiers
Recommended Content
Latest Microcontroller Articles
He Limin Column
Microcontroller and Embedded Systems Bible
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
MoreSelected Circuit Diagrams
MorePopular Articles
- 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
MoreDaily News
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- 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
Guess you like
- Preliminary analysis of DSP functions 101103
- "Hello, DSP world" project example for DSP primary programming
- Boot Sector (Boot Block) in Nor Flash
- 【RPi PICO】MicroPython driving ws2812
- A Simple Comparison of LoRa Technology and NB-IoT
- Boa application-web page configuration domestic A40i development board
- How to use the instruction MOV C, P1.1? There is no instruction MOV C, XX in the 51 assembly instruction table.
- Working hours of heart rate bracelet
- A great popular science article on electromagnetic compatibility principles, methods and design!
- [GD32L233C] + 1. Unboxing & Development Environment Setup