~$ . /opt/ecos/ecosenv.sh ~$ echo $ECOS_REPOSITORY /opt/ecos/ecos-3.0b1/packages ~$ cd /tmp /tmp$ rm -r -f t /tmp$ mkdir t /tmp$ cd t /tmp/t$ ecosconfig new olpce2294 U CYGHWR_HAL_ARM_LPC2XXX, new inferred value LPC2294 /tmp/t$ cp ecos.ecc{,.0} /tmp/t$ vi ecos.ecc /tmp/t$ diff -U 5 ecos.ecc.0 ecos.ecc --- ecos.ecc.0 2009-03-20 19:08:48.000000000 +0200 +++ ecos.ecc 2009-03-20 19:09:01.000000000 +0200 @@ -2373,11 +2373,11 @@ # CYGINT_HAL_ARM_THUMB_ARCH == 1 # --> 1 # Flavor: bool # No user value, uncomment the following line to provide one. - # user_value 0 + user_value 1 # value_source default # Default value: 0 # The following properties are affected by this value # option CYGBLD_ARM_ENABLE_THUMB_INTERWORK /tmp/t$ cp ecos.ecc{,.1} /tmp/t$ vi ecos.ecc /tmp/t$ diff -U 5 ecos.ecc.1 ecos.ecc --- ecos.ecc.1 2009-03-20 19:11:02.000000000 +0200 +++ ecos.ecc 2009-03-20 19:11:15.000000000 +0200 @@ -202,11 +202,11 @@ # flags. # cdl_option CYGBLD_GLOBAL_CFLAGS { # Flavor: data # No user value, uncomment the following line to provide one. - # user_value "-Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Woverloaded-virtual -Wno-write-strings -mthumb -mthumb-interwork -mcpu=arm7tdmi -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions" + user_value "-Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Woverloaded-virtual -Wno-write-strings -mthumb -mthumb-interwork -mcpu=arm7tdmi -g -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions" # value_source default # Default value: CYGBLD_GLOBAL_WARNFLAGS . CYGBLD_ARCH_CFLAGS . # "-mcpu=arm7tdmi -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions" # CYGBLD_GLOBAL_WARNFLAGS == "-Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Woverloaded-virtual -Wno-write-strings " # CYGBLD_ARCH_CFLAGS == "-mthumb -mthumb-interwork " /tmp/t$ ecosconfig resolve /tmp/t$ ecosconfig tree&&make -s headers finished /opt/ecos/ecos-3.0b1/packages/hal/arm/lpc2xxx/var/v3_0b1/src/hal_diag.c: In function 'cyg_hal_plf_serial_isr': /opt/ecos/ecos-3.0b1/packages/hal/arm/lpc2xxx/var/v3_0b1/src/hal_diag.c:260: warning: pointer targets in passing argument 1 of 'cyg_hal_is_break' differ in signedness build finished /tmp/t$ cp -a $ECOS_REPOSITORY/../examples . /tmp/t$ make -C examples clean INSTALL_DIR=`pwd`/installmake: Entering directory `/tmp/t/examples' rm -f hello hello.o twothreads twothreads.o rm -f simple-alarm simple-alarm.o serial serial.o rm -f instrument-test instrument-test.o make: Leaving directory `/tmp/t/examples' /tmp/t$ make -C examples twothreads INSTALL_DIR=`pwd`/install make: Entering directory `/tmp/t/examples' arm-eabi-gcc -c -o twothreads.o -I/tmp/t/install/include -Wall -Wpointer-arith -Wstrict-prototypes -Wundef -Woverloaded-virtual -Wno-write-strings -mthumb -mthumb-interwork -mcpu=arm7tdmi -g -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions twothreads.c cc1: warning: command line option "-Woverloaded-virtual" is valid for C++/ObjC++ but not for C cc1: warning: command line option "-fno-rtti" is valid for C++/ObjC++ but not for C arm-eabi-gcc -nostartfiles -L/tmp/t/install/lib -Ttarget.ld -mthumb -mthumb-interwork -mcpu=arm7tdmi -Wl,--gc-sections -Wl,-static -g -nostdlib -o twothreads twothreads.o make: Leaving directory `/tmp/t/examples' /tmp/t$ arm-eabi-gdb examples/twothreads GNU gdb (eCosCentric GNU tools 4.3.2-sw) 6.8.50.20080706 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=i686-pc-linux-gnu --target=arm-eabi". For bug reporting instructions, please see: ... (gdb) set remotebaud 230400 (gdb) target remote /dev/ttyUSB0 Remote debugging using /dev/ttyUSB0 0x00008028 in ?? () (gdb) load Loading section .rom_vectors, size 0x40 lma 0x81010000 Loading section .text, size 0xd6b4 lma 0x81010040 Loading section .rodata, size 0x9c0 lma 0x8101d6f4 Loading section .data, size 0x324 lma 0x8101e0b4 Start address 0x81010040, load size 58328 Transfer rate: 18 KB/sec, 299 bytes/write. (gdb) b main Breakpoint 1 at 0x8101af1a: file /opt/ecos/ecos-3.0b1/packages/language/c/libc/startup/v3_0b1/src/main.cxx, line 114. (gdb) c Continuing. Entering twothreads' cyg_user_start() function Beginning execution; thread data is 0 Beginning execution; thread data is 1 [Switching to Thread 2] Breakpoint 1, main (argc=1, argv=0x8102213c) at /opt/ecos/ecos-3.0b1/packages/language/c/libc/startup/v3_0b1/src/main.cxx:114 114 Cyg_Thread::self()->suspend(); (gdb) info threads [New Thread 1] [New Thread 3] [New Thread 4] 4 Thread 4 ( Name: Thread B, State: sleeping, Priority: 4 ) 0x8101fff0 in Cyg_Scheduler::scheduler () 3 Thread 3 ( Name: Thread A, State: sleeping, Priority: 4 ) 0x8101fff0 in Cyg_Scheduler::scheduler () 2 Thread 1 ( Name: Idle Thread, State: ready, Priority: 31 ) Cyg_HardwareThread::thread_entry (thread=0x0) at /opt/ecos/ecos-3.0b1/packages/kernel/v3_0b1/src/common/thread.cxx:84 * 1 Thread 2 ( Name: main, State: running, Priority: 10 ) main (argc=1, argv=0x8102213c) at /opt/ecos/ecos-3.0b1/packages/language/c/libc/startup/v3_0b1/src/main.cxx:114 (gdb) b twothreads.c:51 Breakpoint 3 at 0x810106c4: file twothreads.c, line 51. (gdb) c Continuing. [Switching to Thread 4] Breakpoint 3, simple_program (data=1) at twothreads.c:51 51 delay = 200 + (rand() % 50); Current language: auto; currently c (gdb) bt #0 simple_program (data=1) at twothreads.c:51 #1 0x81014052 in Cyg_HardwareThread::thread_entry (thread=0x81024810) at /opt/ecos/ecos-3.0b1/packages/kernel/v3_0b1/src/common/thread.cxx:94 (gdb) info threads * 4 Thread 4 ( Name: Thread B, State: running, Priority: 4 ) simple_program ( data=1) at twothreads.c:51 3 Thread 3 ( Name: Thread A, State: sleeping, Priority: 4 ) 0x8101fff0 in Cyg_Scheduler::scheduler () 2 Thread 1 ( Name: Idle Thread, State: ready, Priority: 31 ) idle_thread_main (data=0) at /opt/ecos/ecos-3.0b1/packages/kernel/v3_0b1/src/common/thread.cxx:1228 1 Thread 2 ( Name: main, State: suspended, Priority: 10 ) 0x8101fff0 in Cyg_Scheduler::scheduler () (gdb) n [Switching to Thread 3] Breakpoint 3, simple_program (data=0) at twothreads.c:51 51 delay = 200 + (rand() % 50); (gdb) [Switching to Thread 4] 55 cyg_mutex_lock(&cliblock); { (gdb) [Switching to Thread 3] 56 printf("Thread %d: and now a delay of %d clock ticks\n", (gdb) Thread 0: and now a delay of 243 clock ticks 59 cyg_mutex_unlock(&cliblock); (gdb) 60 cyg_thread_delay(delay); (gdb) Thread 1: and now a delay of 224 clock ticks [Switching to Thread 4] Breakpoint 3, simple_program (data=1) at twothreads.c:51 51 delay = 200 + (rand() % 50); (gdb) bt #0 simple_program (data=1) at twothreads.c:51 #1 0x81014052 in Cyg_HardwareThread::thread_entry (thread=0x81024810) at /opt/ecos/ecos-3.0b1/packages/kernel/v3_0b1/src/common/thread.cxx:94 (gdb) info threads * 4 Thread 4 ( Name: Thread B, State: running, Priority: 4 ) simple_program ( data=1) at twothreads.c:51 3 Thread 3 ( Name: Thread A, State: sleeping, Priority: 4 ) 0x8101fff0 in Cyg_Scheduler::scheduler () 2 Thread 1 ( Name: Idle Thread, State: ready, Priority: 31 ) idle_thread_main (data=0) at /opt/ecos/ecos-3.0b1/packages/kernel/v3_0b1/src/common/thread.cxx:1228 1 Thread 2 ( Name: main, State: suspended, Priority: 10 ) 0x8101fff0 in Cyg_Scheduler::scheduler () (gdb) d Delete all breakpoints? (y or n) y (gdb) c Continuing. Thread 1: and now a delay of 210 clock ticks Thread 0: and now a delay of 224 clock ticks Thread 1: and now a delay of 207 clock ticks Thread 0: and now a delay of 244 clock ticks Thread 1: and now a delay of 229 clock ticks Thread 0: and now a delay of 243 clock ticks Thread 1: and now a delay of 212 clock ticks Thread 0: and now a delay of 243 clock ticks Thread 1: and now a delay of 247 clock ticks Thread 0: and now a delay of 226 clock ticks Thread 1: and now a delay of 231 clock ticks Thread 0: and now a delay of 226 clock ticks Thread 1: and now a delay of 224 clock ticks Thread 0: and now a delay of 215 clock ticks Thread 1: and now a delay of 200 clock ticks Thread 0: and now a delay of 234 clock ticks Program received signal SIGINT, Interrupt. [Switching to Thread 1] idle_thread_main (data=0) at /opt/ecos/ecos-3.0b1/packages/kernel/v3_0b1/src/common/thread.cxx:1228 1228 idle_thread_loops[CYG_KERNEL_CPU_THIS()]++; Current language: auto; currently c++ (gdb) bt #0 idle_thread_main (data=0) at /opt/ecos/ecos-3.0b1/packages/kernel/v3_0b1/src/common/thread.cxx:1228 #1 0x81014052 in Cyg_HardwareThread::thread_entry (thread=0x8101f728) at /opt/ecos/ecos-3.0b1/packages/kernel/v3_0b1/src/common/thread.cxx:94 (gdb) info threads 4 Thread 4 ( Name: Thread B, State: sleeping, Priority: 4 ) 0x8101fff0 in Cyg_Scheduler::scheduler () 3 Thread 3 ( Name: Thread A, State: sleeping, Priority: 4 ) 0x8101fff0 in Cyg_Scheduler::scheduler () * 2 Thread 1 ( Name: Idle Thread, State: running, Priority: 31 ) idle_thread_main (data=0) at /opt/ecos/ecos-3.0b1/packages/kernel/v3_0b1/src/common/thread.cxx:1228 1 Thread 2 ( Name: main, State: suspended, Priority: 10 ) 0x8101fff0 in Cyg_Scheduler::scheduler () (gdb) deta Ending remote debugging. (gdb) q tmp/t$