Laird WB45NBT
Reference Guide
Embedded Wireless Solutions Support Center:
http://ews-support.lairdtech.com
www.lairdtech.com/wi-fi
25
© Copyright 2016 Laird. All Rights Reserved
Americas: +1-800-492-2320
Europe: +44-1628-858-940
Hong Kong: +852 2923 0600
16.
Flash rootfs by doing the following:
a.
Use Send File Name and select the
rootfs.bin
file.
b.
Set the address to
0x5e0000
.
c.
Click Send.
17.
Exit SAM-BA.
File:
Quit
18.
Disconnect the USB device-cable.
19.
Power the device off.
Notes:
Sometimes, operations in the main-window-gui appear to hang after a while.
A RAM initialize error message usually because at power-on, need to wait a bit.
The rootfs uses 'trimffs'.
D
EBUGGING
Application Debugging
The GNU Debugger (gdb) is loaded onto the WB45NBT file system by default. It can be used to debug userspace
applications.
gdb <application_name>
Type r and then press Enter.
To stop execution at any time, press CTRL-C.
To single step, type s and press Enter.
To get a backtrace of the stack, type bt and press Enter.
To exit the debugger, type quit.
The System Trace utility (strace) is also loaded onto the file system. This utility traces an application's system calls
into the Linux operating system.
strace
Another utility worth mentioning is
devmem. This allows physical memory locations to be accessible to userspace. It
works by mmap()ing regions of memory into user space so that they may be accessed directly. It is similar to a
peek/poke utility.
Connecting a Device or File to a Socket
In many instances, it may be desirable to directly connect a device or file to a socket. This may be done with a tool
called Socat. Socat allows the creation of bidirectional byte streams that may be connected to sockets and/or devices
within Linux.
Below is a simple application (using Socat) to connect a TCP socket to an external UART. The following example
command demonstrates how to establish the Socat link between the device so that Linux forwards all incoming
UART data (on ttyS1) over the socket connection and vice versa.