Create the first VxWorks bootable image Project--socket communication experiment

Source: Internet
Author: User
Tags bind socket jlink

Create the first VxWorks bootable image Project--socket communication Experiment

Daniellee_ustb 2013.6.25

qq:382899443

Sleep late yesterday, a bit sleepy in the morning, but the creation of the first VxWorks Bootableimage in today finally run successfully. The morning's sleepy mind swept away, small excited to talk about the process. Many problems have been encountered and collated for reference.

Click Create a new bootable VxWorks system image in the Tronado2.2 compiler.


By entering the project name, you can see that the project created by default is stored in the Target\proj\ folder, which provides a project template based on many different CPU architectures, and because there are sample programs that can be run on s3c2410, you can create your own project based on this BSP.


For the sake of convenience, the problem of porting is not discussed now, so you can build your project on the available projects, such as:


To tell the truth, this can save a lot of things. Click Next to find the following prompt:


It seems that the lack of some files and libraries, it is strange, why the original project can run normally, why now based on it is a problem. Then look down.

The following works are built:


Just compile it and look at it.


The discovery has not compiled several files to have the error, stops compiles, how to return the matter. Take a closer look at why the compiled directory is still the original project directory. That's right. Must be makefile inside the problem of compiling rules, open makefile, see the definition of the BSP directory and the path of the compiled file, the original needs to be modified.


Note In the makefile file that the compiled file is stored in the targt/config/## #文件夹中, open this file to see, originally about all the user program source files are in this folder, proj folder only stored some project configuration files, not the BSP file, Then create your own BSP file, and replace all the original address with our own BSP path should be OK.


I can't wait to compile, BSP compile OK.


The next step is to add the source file of the socket server communication to your BSP, the source file is also found on the internet, a little modification can be used.


When I add the task of creating the socket server to the Usrappinit () function, the task that I created is not ready to run. Compile, the error is still. It seems that you really need to will hurdles hurdles.


Error message said Usrappinit (), unable to find vxSer.h This file, the file is declared about the Socketserver test program, clearly has been included in the Usrappinit (). c, I can't. The first reaction or makefile has a problem, open a look makefile has automatically generated the various functions of the compilation rules, but obviously not vxSer.h this library add in, add yourself, as follows:


Re-compile, success, haha.


Download the VxWorks system image to the target board via Jlink:



Unplug Jlink, run to see, VxWorks run fast. In less than 2 seconds the system got up, much faster than the QNX that started with U-boot. See under the Serial assistant:

VxWorks

Copyright 1984-2002 Wind River Systems, Inc.

Cpu:arm integrator-arm920t (ARM)

Runtime Name:vxworks

Runtime version:5.5

BSP VERSION:1.2/5

Created:jun 24 2013, 01:31:02

Wdbcomm Type:wdb_comm_end

Wdb:ready.

sst39vf160 serialno=0

Initisizing .....

CMD0 chk_cmdend:1.

In Idle.

In SD ready.

End ID.

In stand-by

Sd/mmc_card_init OK.

RK2410 USB DEVICE Download filetest-usbrxaddr=0x31839c34

Wait for the USB line ...

Create Task socketsertask 0x31fffe68 (troottask): netinit:unable Tobind to Port 23

More depressing is, socketserver task actually tied the machine address and port when the failure. Set Local_server_port to 23, is that if successful can be directly with Telnet to the target table communication, this is why.

if (Bind (Listenskt, (struct sockaddr*) &serveraddr,sockaddrsize) ==error) {

Logmsg ("Netinit:unableto bind to Port%d\n", local_server_port,0,0,0,0,0);

Close (Listenskt);

return (ERROR);

}

Check what's going on, look at the IP address of the VxWorks target board.

Ifshow

tsfs= (Unit number 0):

Flags: (0x8063) up broadcast multicast ARP RUNNING

Type:ethernet_csmacd

Internet address:192.168.253.123

Broadcast address:192.168.253.255

Netmask 0xffffff00 SubnetMask 0xffffff00

Ethernet address is 00:02:03:04:05:06

Ensure that the host and target board in the same network segment under the conditions of the discovery can be ping, which means that network connectivity is not a problem.


That is not vxworks this port is occupied, looking for a half day also did not find how to see how the VxWorks has occupied the port is how to check, in fact, this port is fixed for telnet use, then switch to Port 3000 to try.

Initisizing .....

CMD0 chk_cmdend:1.

In Idle.

In SD ready.

End ID.

In stand-by

Sd/mmc_card_init OK.

RK2410 USB DEVICE Download filetest-usbrxaddr=0x31839c34

Wait for the USB line ...

0x31fffe68 (troottask): netinit:successfully bind to prot3000

Haha, incredibly successful! In the host login telnet to see if Port 3000 can communicate properly:


No problem at all. The implemented socket server can communicate gracefully with the host's telnet. It seems that port 23 is actually occupied, and it's going to take a while to implement a particular feature.

This experiment can summarize how to create a bootable image project:

① The beginner stage should be guaranteed to have a BSP that can be run on the target board.

② based on this BSP to create a project, under the Config folder to copy the original BSP file into its own BSP, based on this modification.

③ Modify the BSP path in the makefile file and the file compilation path.

④ add your own application and invoke the task you created in Usrappinit ().

⑤ compiles a new source file compilation rule for makefile production, notice that the dependency condition is modified.

⑥ after compiling successfully, download to target board debugging.

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.