New libraries, updated GDB monitor.

May 24th, 2010 · 12:34 pm @ admin  -  One Comment

We are very happy to anounce that most of our new libraries start to work: Led, DigitalIO, DigitalBUS, Serial (to Uart, USB, GDB). With great enhancements over previous versions. You can update your SDK libraries following the tutorial here.

We have also updated the gdb monitor with an small bugfix, and added console output support , now when you compile your code for use with GDB (make GDB=yes on new libraries), the libraries will detect that the Espardino gdbmonitor is running, and it will output all usb serial data to the GDB console, which is much more handy for debugging.

This is an small code example:

#include <micro214x.h>

int main(void)
{
   Led led1(LED1);                // declare led1, connected to led: LED1
   Serial output(USB_TX,USB_RX); // declare the serial connection, USB
   DigitalIO my_output(P0_0)  // declare my_output attached to P0_0
   DigitalIO my_input(P0_1);   // declare my_input, attached to P0_1

   // declare my_bus, in 8bits, connected to P1.24 .. 31
   DigitalBus my_bus(P1_24,P1_25,P1_26,P1_27,P1_28,P1_29,P1_30,P1_31);

   while(1)
   {
      wait(0.5);
      my_output.on();
      led1.on();

      wait(0.5);
      my_output.off();
      led1.off();

      output.printf("my_input=%d, my_bus=%04x\r\n",
                            my_input.read(),my_bus.read());
   }
}

This is the example printing out to GDB, when debugging (compiled with ‘make GDB=yes’)

C:\ESPARD~1\unpublished\cpp_test_gdbout>arm-elf-gdb main.elf
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i586-mingw32msvc --target=arm-elf"...
0x00002972 in ?? ()
(gdb) load
Loading section .startup, size 0x1b8 lma 0x8000
Loading section .text, size 0x5580 lma 0x81b8
Loading section .data, size 0x848 lma 0xd738
Start address 0x8000, load size 24448
Transfer rate: 23 KB/sec, 47 bytes/write.
(gdb) c
Continuing.
my_input=1, my_bus=00ff
my_input=1, my_bus=00ff
my_input=1, my_bus=00ff
my_input=1, my_bus=00ff
my_input=1, my_bus=00ff
my_input=1, my_bus=00ff
my_input=1, my_bus=00ff
my_input=1, my_bus=00ff
                                      <--- I hit CTRL+C
Program received signal SIGTRAP, Trace/breakpoint trap.
0x00008560 in delay_us ()
(gdb)
Continuing.
my_input=1, my_bus=00ff
my_input=1, my_bus=00ff
my_input=1, my_bus=00ff
                                      <--- I hit CTRL+C
Program received signal SIGTRAP, Trace/breakpoint trap.
0x00008564 in delay_us ()
(gdb) quit
The program is running.  Exit anyway? (y or n) y

One Comment → “New libraries, updated GDB monitor.”

  1. [...] So, now thanks to the excellent Espardino project and the help of its author, Ajo, who is a very good friend of mine, I decided to write my own stub for the ARM cortex-m3 architecture. You can check out more information about Espardino’s remote monitor here. [...]


Leave a Reply