OpenAVL Project III
Simulavr and GDB
Simulavr and GDB are parts of WinAVR project. Simulavr simulates AVR running, offers socket connection to the GNU debugger (GDB) over TCP port 1212. The software developer interacts with GNU debugger front end , which communicates with simulavr. Theoretically, AVRStudio from Atmel has a built-in simulator, and can load WinAVR code for simulation. However AVRStudio always prompts me a system fatal error and exits.
To invoke Simulavr, type following command in one DOS command session.
simulavr –d atmega128 –g
The command stands for simulation of ATMEGA128 and waiting for a GDB connection. You will see the ATMEGA128's registers are listed on screen. Some of the registers are not fully implemented in the simulator, which are marked as TODO. The simulavr will display invalid access to register in case the user code try to access the unimplemented registers.
To use GDB, goes _>> go to the source directory, open another DOS command session, and type
avr-gdb
However it requires many more instructions after invoking the GDB. Here I copied my script file (.gdbinit) for avr-gdb initialization.
Although command line GDB is enough for debug, I am still expecting the GUI front-end for GDB. Unfortunately GDB insight (GUI version) is not available in this version.
Limitation of Simulation
Simulation can help developer to remove most of the logical issues in the code. However it has limitation in simulation for the real-time events. As I mentioned, some of the registers are not yet implemented in Simulavr, because the registers have to reflect the real-time event, such as BOR, UART communication, and so on. Besides, all interrupt vectors have to be placed by the user via GDB. In my OpenAVL project, I have to face to the heavy traffic on UART communication.
I have used some other simulators for 80C51, which can simulate the UART communication. I do believe I can find a way to simulate the UART communication in Simulavr. Then I can focus on debugging the high level application modules.
I have ordered an AVR board and JTAG debugger via taobao.com. The code will be debugged in a real board.
Schematic
Here is the schematic for the OpenAVL project. It is very straightforward. I use an open source EDA tool set for the hardware development, from schematic to PCB layout. The EDA tool is Kicad for Windows. Kicad is introduced in another blog. It is a free and powerful EDA tool. The source code is open and follows GPL license, the developers can check the source code of Kicad to understand the graphic development.
GPRS Design
The GPRS design will be divided into two sub projects. One uses the internal TCP/IP stack in the M2M module. The other one implements TCP/IP stack (uIP port) in the AVR. The Siemens TC39 is the preferred module, which has no internal TCP/IP stack implementation.
Since embedded TCP/IP stack in external system controller requires more effort, I decided to find a wireless module with internal TCP/IP stack. I found GMT900B, a wireless module from Huawei. This module is pin to pin compatible with Siemens TC39 with internal TCP/IP stack. I got the module quotation from a dealer. It is about 28USD for one piece, which is cheaper than Siemens module. It seems that Chinese manufacturers like Huawei and PIML usually offer feature up versions of original suppliers. I have no quality figures about Chinese feature up versions. But I do believe Huawei can offer comparable quality, because its products have been deployed in many countries for years.
- allankliu's blog
- Login or register to post comments
- 123 reads


