Posts

How to print your log in Vxworks6.x

For embedded software developer using printf  is the most used debug method on target. But in vxworks6.x, it start to change because the default stdout/stderr is redirected. If you connect to device by shell/telnet, printf in the code will not put to the stdout/stderr in the current shell. Solution: You can put a the following code in the debug version. Once you have connect to target by shell/telnet, call the function to redirect some task /all task io to the current shell. void ioRedirect ( void ) { int shellTid = 0 ; int shellOpFd = 0 ; int globalStdFd = 0 ; shellTid = taskIdSelf (); shellOpFd = ioTaskStdGet (shellTid, 1 ); globalStdFd = ioGlobalStdGet ( 1 ); ( void ) logMsg ( "LM:Initial task output.shellFd %d, GlobalFd %d. \n " , shellOpFd, globalStdFd, 0 , 0 , 0 , 0 ); printf ( "p:Initial task output.shellFd %d, GlobalFd %d. \n " , shellOpFd, globalStdFd); /*you can specify the task who need pr...

Capture VLAN tag with wireshark

Image
Wireshark is widely used for Ethernet communication development. (My industry is power system and substation automation) I have some projects clearly require supporting the Ethernet packets with & without VLAN tag.  In this case, we need consider the following conditions for validation. 1. The publisher send the packets with/without VLAN tag 2. The Ethernet Switch can be setup to keep/remove the VLAN tag 3. The subscriber may see / not see the VLAN tag depend on the OS and driver configuration. Typically wireshark is used as an validation tool. Here is the link from wireshark https://wiki.wireshark.org/CaptureSetup/VLAN My environment is windows + USB3 Ethernet Adapter (ASIX AX88179), there is an solution from the vendor: Please set the "Packet Priority & VLAN" parameter of ASIX USB to LAN Windows drivers to "Packet Priority & VLAN Disable" to capture the VLAN tagged packets on WireShark.

QT or HTML for Embedded Device?

I used in a project to develop an touch screen HMI for embedded device. It has a tight cost target and ambitious UI friendliness requirement. (Not surprising, product manager always wants the best with the lest cost, 😀) The choice of the architecture is either thin client or rich client. We eliminate the Flash solution at the beginning because it is resource hungry. Then it is the difficult time to consider the either QT solution or it is a thin client like HTML. HTML looks attractive. Now you can see almost everything can be deployed on cloud and accessed by HTML.  We were diverted to investigate the possibility of HTML solution and try to build an demo of customized Web Browser. With the progress, it becomes more clear that neither by processor nor FPGA can deliver the expected performance within our cost target. The final solution pointed to QT. Then I found this white paper.  http://www.embedded-computing.com/industrial/qt-or-html5 I hope it could be released ea...

How to install the Guest Addition in Ubuntu OS by Oracle Virtual Box

I have a lot of development in Linux Application but my PC must in Windows because of the outlook & skype (company version). So I create a Ubuntu Guest on Win7/Win10. To make the clipboard and share folder work I need install the guest addition. At the beginning it troubled me until I found the solution here: https://askubuntu.com/questions/573596/unable-to-install-guest-additions-cd-image-on-virtual-box It is simple, isn't it? sudo apt-get install virtualbox-guest-utils