From Christof.Frey at varian.com Tue May 17 10:17:30 2011 From: Christof.Frey at varian.com (Christof Frey) Date: Tue, 17 May 2011 03:17:30 -0700 Subject: __cs3_isr_other_interrupt Message-ID: <5EBEE880D6FDE847BE3AB802275511CC9D9C6C0504@PA-EX-MBXVS03.vms.ad.varian.com> Get __cs3_isr_other_interrupt When debugging MCF5235 based app. Where does this interrupt come from? Thanks, Christof -------------- next part -------------- An HTML attachment was scrubbed... URL: From carlos at codesourcery.com Tue May 17 15:50:06 2011 From: carlos at codesourcery.com (Carlos O'Donell) Date: Tue, 17 May 2011 11:50:06 -0400 Subject: [coldfire-gnu-discuss] __cs3_isr_other_interrupt In-Reply-To: <5EBEE880D6FDE847BE3AB802275511CC9D9C6C0504@PA-EX-MBXVS03.vms.ad.varian.com> References: <5EBEE880D6FDE847BE3AB802275511CC9D9C6C0504@PA-EX-MBXVS03.vms.ad.varian.com> Message-ID: <4DD2992E.4070204@codesourcery.com> On 5/17/2011 6:17 AM, Christof Frey wrote: > Get > > __cs3_isr_other_interrupt > > When debugging MCF5235 based app. > > Where does this interrupt come from? > It is the default interrupt handler for all interrupts. It likely means you triggered an interrupt and you don't have a custom handler installed. Cheers, Carlos. -- Carlos O'Donell Mentor Graphics / CodeSourcery carlos at codesourcery.com +1 (650) 331-3385 x716 From stephane.franck.rey at cern.ch Fri May 20 16:12:46 2011 From: stephane.franck.rey at cern.ch (Stephane Franck Rey) Date: Fri, 20 May 2011 16:12:46 +0000 Subject: GDB freeze when steping into a loop with P&E BDM Message-ID: <9C97D7A81BFEA849807B13E9160B5DEF0EAA63BF@CERNXCHG21.cern.ch> Hi there, I'm trying to set a toolchain using Eclipse + GCC + Hiwave for flashing the CPU + GDB for debugging. The current hardware is a MCF51AC128C connected to a 4.9152 MHz crystal and I'm using P&E USB-ML-12E interface (USB Multilink) In my test code I've the following line for (i=1; i<40000; i++){asm ("nop");}; When setting a BreakPoint on that line, GDB stops. I can resume and stop again on that line any time. Now when stopped on that line, if I Step Into or Step over this line, GDB freeze in 'Stepping' and nothing happens anymore. If I suspend the program crashed (comm. Failure), and I've to kill the gdb task to start again the communication with my BDM. GDB SETTINGS *********** GDB Debugger : m68k-elf-gdb Initialize commands : target remote | m68k-elf-sprite pe: m51ac128Cevb-4 'Run' Commands : set $pc=_start br main continue the file m51ac128Cevb-4.xml is a modified version of the m51ac128Cevb.xml, by changing the system clock frequency to 4915 KHz. But whatever is this parameter the GDB behavior is always the same. Note that everything works with Codewarrior 6.3 and codewarrior 10.1 (Eclipse based), I can debug the same project and do what I want with BP in these toolchains without the same behavior observed with GDB. So any idea on what could be wrong in my configuration ? Cheers Stephane -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephane.franck.rey at cern.ch Fri May 20 15:59:24 2011 From: stephane.franck.rey at cern.ch (Stephane Franck Rey) Date: Fri, 20 May 2011 15:59:24 +0000 Subject: problem with P&E BDM when stepping a loop Message-ID: <9C97D7A81BFEA849807B13E9160B5DEF0EAA6398@CERNXCHG21.cern.ch> Hi, I'm trying to debug my code with GDB and P&E USB-ML-12 interface. I've the test project with the following code : for (i=1; i<40000; i++){asm ("nop");}; When adding a breakpoint on the line, the debugger goes to the line. Resuming will stop to the next BP occurrence and so on. Now when stopped to this BP if I click Step Into or Step Over, GDB remains in 'stepping mode' and no action works anymore. I've to kill the task GDB to recover the communication with BDM Note that this same project works perfeclty with Codewarrior 10.1. Any idea ? Stephane -------------- next part -------------- An HTML attachment was scrubbed... URL: From carlos at codesourcery.com Fri May 20 17:56:04 2011 From: carlos at codesourcery.com (Carlos O'Donell) Date: Fri, 20 May 2011 13:56:04 -0400 Subject: [coldfire-gnu-discuss] GDB freeze when steping into a loop with P&E BDM In-Reply-To: <9C97D7A81BFEA849807B13E9160B5DEF0EAA63BF@CERNXCHG21.cern.ch> References: <9C97D7A81BFEA849807B13E9160B5DEF0EAA63BF@CERNXCHG21.cern.ch> Message-ID: <4DD6AB34.6080004@codesourcery.com> On 5/20/2011 12:12 PM, Stephane Franck Rey wrote: > Hi there, > > I?m trying to set a toolchain using Eclipse + GCC + Hiwave for flashing > the CPU + GDB for debugging. What version of the CodeSourcery tools are you using? We fixed a similar sounding "step over loop" bug, but that was almost a year ago. Are you having these problems with new tools? Can you provide a full test case? * Board used. * Code. * Compiler options used to compile example. Cheers, Carlos. -- Carlos O'Donell Mentor Graphics / CodeSourcery carlos at codesourcery.com +1 (650) 331-3385 x716 From carlos at codesourcery.com Fri May 20 20:21:50 2011 From: carlos at codesourcery.com (Carlos O'Donell) Date: Fri, 20 May 2011 16:21:50 -0400 Subject: [coldfire-gnu-discuss] GDB freeze when steping into a loop with P&E BDM In-Reply-To: <9C97D7A81BFEA849807B13E9160B5DEF0EAA63DA@CERNXCHG21.cern.ch> References: <9C97D7A81BFEA849807B13E9160B5DEF0EAA63BF@CERNXCHG21.cern.ch>,<4DD6AB34.6080004@codesourcery.com> <9C97D7A81BFEA849807B13E9160B5DEF0EAA63DA@CERNXCHG21.cern.ch> Message-ID: <4DD6CD5E.5020108@codesourcery.com> On 5/20/2011 4:16 PM, Stephane Franck Rey wrote: Please keep the list in the CC so others can learn about the problem. > #define SOPT (*( unsigned char *)0xFFFF9802) > #define SOPT_COPE_MASK 128 > > #define PTFD (*( unsigned char *)0xFFFF800A) > #define NVFTRIM (*(unsigned char *)0x000003FE) > #define PTFDD (*( unsigned char *)0xFFFF800B) Should be volatile otherwise the compiler will optimize them away as constants when -ON for N > 0. > // Turn ON/OFF PTE6/7 LEDs > PTFDD |= 0 | PTFDD_PTFDD0_MASK | PTFDD_PTFDD1_MASK; > PTFD =0xff ; > PTFD =0x00 ; > > for (;;) { > PTFD |= PTFD_PTFD0_MASK ; > PTFD&= ~PTFD_PTFD1_MASK; > for (i=1; i<50000; i++){asm ("nop");}; > > PTFD&= ~PTFD_PTFD0_MASK;; > PTFD |= PTFD_PTFD1_MASK ;; > for (i=1; i<40000; i++){asm ("nop");}; > } Have you debugged this from the command line gdb to show it's not an IDE problem? Cheers, Carlos. -- Carlos O'Donell Mentor Graphics / CodeSourcery carlos at codesourcery.com +1 (650) 331-3385 x716 From stephane.franck.rey at cern.ch Fri May 20 20:23:29 2011 From: stephane.franck.rey at cern.ch (Stephane Franck Rey) Date: Fri, 20 May 2011 20:23:29 +0000 Subject: [coldfire-gnu-discuss] GDB freeze when steping into a loop with P&E BDM Message-ID: <9C97D7A81BFEA849807B13E9160B5DEF0EAA93EF@CERNXCHG21.cern.ch> Hi Carlos, Thanks for your prompt answer. All the tools have been installed this week from latest revisions available. Below the details of my settings Cheers St?phane Rey >What version of the CodeSourcery tools are you using? > Can you provide a full test case? > * Board used. > * Code. > * Compiler options used to compile example. *** Sourcery G++ Lite 2010.09-39 for ColdFire ELF *** Eclipse IDE (eclipse-cpp-helios-SR2-win32.zip) + C/C++ Cross compiler support and C/C++ GDB hardware debugging plugin (http://download.eclipse.org/tools/cdt/releases/helios) + Zylin CDT plugin (http://www.zylin.com/zylincdt) *** Flasher HIWAVE from Codewarrior 6.3 *** proprietary board with M51FAC128C + 4.9152 MHz crystal *** Compiler settings In the console the invoking commande line is : m68k-elf-gcc -O0 -g3 -Wall -c -fmessage-length=0 -mcpu=51ac -MMD -MP -MF"main.d" -MT"main.d" *** Modified settings from the fresh install: -> Tool Settings C/C++ Build\Cross-Settings : "m68k-elf" C/C++ Build\Cross-Settings\Cross GCC Compiler\Miscellaneous\Other flags :"-c -fmessage-length=0 -mcpu=51ac" C/C++ Build\Cross-Settings\Cross GCC Linker\Miscellaneous\Linker flags : "-T m51ac128evb-rom.ld" -> Build Steps Post build steps command :"m68k-elf-objcopy -I elf32-m68k ${ProjName} -O srec c:\perso\eclipse\project.s19" *** source code #define SOPT (*( unsigned char *)0xFFFF9802) #define SOPT_COPE_MASK 128 #define PTFD (*( unsigned char *)0xFFFF800A) #define NVFTRIM (*(unsigned char *)0x000003FE) #define PTFDD (*( unsigned char *)0xFFFF800B) #define PTFD_PTFD0_MASK 1 #define PTFD_PTFD1_MASK 2 #define PTFD_PTFD2_MASK 4 #define PTFD_PTFD3_MASK 8 #define PTFD_PTFD4_MASK 16 #define PTFD_PTFD5_MASK 32 #define PTFD_PTFD6_MASK 64 #define PTFD_PTFD7_MASK 128 #define PTFDD_PTFDD0_MASK 1 #define PTFDD_PTFDD1_MASK 2 #define PTFDD_PTFDD2_MASK 4 #define PTFDD_PTFDD3_MASK 8 #define PTFDD_PTFDD4_MASK 16 #define PTFDD_PTFDD5_MASK 32 #define PTFDD_PTFDD6_MASK 64 #define PTFDD_PTFDD7_MASK 128 /************************ Main Program Loop ************************/ int main(void) { unsigned int i; SOPT=0X53; // Turn ON/OFF PTE6/7 LEDs PTFDD |= 0 | PTFDD_PTFDD0_MASK | PTFDD_PTFDD1_MASK; PTFD =0xff ; PTFD =0x00 ; for (;;) { PTFD |= PTFD_PTFD0_MASK ; PTFD &= ~PTFD_PTFD1_MASK; for (i=1; i<50000; i++){asm ("nop");}; PTFD &= ~PTFD_PTFD0_MASK;; PTFD |= PTFD_PTFD1_MASK ;; for (i=1; i<40000; i++){asm ("nop");}; } return 0; } //end main From stephane.franck.rey at cern.ch Fri May 20 20:26:33 2011 From: stephane.franck.rey at cern.ch (Stephane Franck Rey) Date: Fri, 20 May 2011 20:26:33 +0000 Subject: [coldfire-gnu-discuss] GDB freeze when steping into a loop with P&E BDM In-Reply-To: <4DD6CD5E.5020108@codesourcery.com> References: <9C97D7A81BFEA849807B13E9160B5DEF0EAA63BF@CERNXCHG21.cern.ch>,<4DD6AB34.6080004@codesourcery.com> <9C97D7A81BFEA849807B13E9160B5DEF0EAA63DA@CERNXCHG21.cern.ch>,<4DD6CD5E.5020108@codesourcery.com> Message-ID: <9C97D7A81BFEA849807B13E9160B5DEF0EAA93FF@CERNXCHG21.cern.ch> Sorry, I was just transferring my answer to the list when I've seen I hadn't done it. I havn't tested it from gdb command line. I will not be on my computer before monday in order to try it. I will let you know then the results. Thanks Stephane ________________________________________ From: Carlos O'Donell [carlos at codesourcery.com] Sent: 20 May 2011 22:21 To: Stephane Franck Rey Cc: coldfire-gnu-discuss at codesourcery.com Subject: Re: [coldfire-gnu-discuss] GDB freeze when steping into a loop with P&E BDM On 5/20/2011 4:16 PM, Stephane Franck Rey wrote: Please keep the list in the CC so others can learn about the problem. > #define SOPT (*( unsigned char *)0xFFFF9802) > #define SOPT_COPE_MASK 128 > > #define PTFD (*( unsigned char *)0xFFFF800A) > #define NVFTRIM (*(unsigned char *)0x000003FE) > #define PTFDD (*( unsigned char *)0xFFFF800B) Should be volatile otherwise the compiler will optimize them away as constants when -ON for N > 0. > // Turn ON/OFF PTE6/7 LEDs > PTFDD |= 0 | PTFDD_PTFDD0_MASK | PTFDD_PTFDD1_MASK; > PTFD =0xff ; > PTFD =0x00 ; > > for (;;) { > PTFD |= PTFD_PTFD0_MASK ; > PTFD&= ~PTFD_PTFD1_MASK; > for (i=1; i<50000; i++){asm ("nop");}; > > PTFD&= ~PTFD_PTFD0_MASK;; > PTFD |= PTFD_PTFD1_MASK ;; > for (i=1; i<40000; i++){asm ("nop");}; > } Have you debugged this from the command line gdb to show it's not an IDE problem? Cheers, Carlos. -- Carlos O'Donell Mentor Graphics / CodeSourcery carlos at codesourcery.com +1 (650) 331-3385 x716 From stephane.franck.rey at cern.ch Mon May 23 09:52:35 2011 From: stephane.franck.rey at cern.ch (Stephane Franck Rey) Date: Mon, 23 May 2011 09:52:35 +0000 Subject: [coldfire-gnu-discuss] GDB freeze when steping into a loop with P&E BDM In-Reply-To: <4DD6CD5E.5020108@codesourcery.com> References: <9C97D7A81BFEA849807B13E9160B5DEF0EAA63BF@CERNXCHG21.cern.ch>,<4DD6AB34.6080004@codesourcery.com> <9C97D7A81BFEA849807B13E9160B5DEF0EAA63DA@CERNXCHG21.cern.ch> <4DD6CD5E.5020108@codesourcery.com> Message-ID: <9C97D7A81BFEA849807B13E9160B5DEF0EAA946C@CERNXCHG21.cern.ch> Hi Carlos, Attached is a zip including my example project. I've debugged my example code using gdb command line and found the same problem excluding then an IDE problem. Below are my tests results details but to summarize here is what I've seen: 1. invoking gdb, setting breakpoints, running the program with command 'continue' The program starts but doesn't stop on breakpoint, I have to CTRL+C to stop it and could see then it is "halted" on line 57 (for ...). Displaying data 'i' shows GDB has reached an intermediate value loop iterations before halting. (several tests : i=23468, 37406, 24028, ...) When continuing again, then it stops to the first breakpoint line 66 correctly 2. When stopped on 1st breakpoint on line 66, I seize 'next' command and can stop on each line until line 68 (2nd breakpoint : for ...). Then from line 68 the program "halts" again and GDB seems to be crashed this time I can't CTRL+C. I have to kill GDB and restart it. 3. An other test is made when reaching breakpoint on line 68. I step by assembly instruction and it works perfectly. If after several steps (i=2 or 3) I 'continue' the program, then it stops correctly to the line 66 showing that the program works and reached the 2nd forever main loop iteration. Here are the details of the tests : My code is : ****************************************************************** 41 int main(void) 42 { 43 unsigned int i; 44 45 46 SOPT=0X53; 47 48// Turn ON/OFF PTE6/7 LEDs 49 PTFDD |= 0 | PTFDD_PTFDD0_MASK | PTFDD_PTFDD1_MASK; 50 PTFD =0xff ; 51 PTFD =0x00 ; 52 53 for (;;) 54 { 55 PTFD |= PTFD_PTFD0_MASK ; 56 PTFD &= ~PTFD_PTFD1_MASK; 57 for (i=1; i<50000; i++) 58 { 59 asm ("nop"); 60 SRS=0; 61 62 } 63 64 65 66 PTFD &= ~PTFD_PTFD0_MASK;; 67 PTFD |= PTFD_PTFD1_MASK ;; 68 for (i=1; i<40000; i++){asm ("nop");}; 69 } 70 71 Return 0; } //end main ****************************************************************** Then defined the target connection : ****************************************************************** (gdb) target remote | m68k-elf-sprite pe://USBMultilink m51ac128cevb Remote debugging using | m68k-elf-sprite pe://USBMultilink m51ac128cevb m68k-elf-sprite: Opening P&E USBMultilink port 1 (USB1 : USB-ML-12 Rev C (PE5516 318)) m68k-elf-sprite: Target reset 0x00000000 in _ftext () ****************************************************************** I've set some breakpoints lines 66 and line 68 : ****************************************************************** (gdb) info break Num Type Disp Enb Address What 1 breakpoint keep y 0x00000626 in main at ../main.c:66 2 breakpoint keep y 0x0000065a in main at ../main.c:68 ****************************************************************** And ran the program : ****************************************************************** (gdb) c Continuing. Note: automatically using hardware breakpoints for read-only addresses. ****************************************************************** After a while nothing is happening I press CTRL+C : ****************************************************************** Program received signal SIGINT, Interrupt. 0x00000620 in main () at ../main.c:57 57 for (i=1; i<50000; i++) (gdb) display i 1: i = 24028 ****************************************************************** Several tests have shown it halts for random value of I (24028, 37406, ...) Then I continue the execution until it stops definitely on line 68 : ****************************************************************** (gdb) c Continuing. Breakpoint 1, main () at ../main.c:66 66 PTFD &= ~PTFD_PTFD0_MASK;; 1: i = 50000 (gdb) next 67 PTFD |= PTFD_PTFD1_MASK ;; 1: i = 50000 (gdb) next Breakpoint 2, main () at ../main.c:68 68 for (i=1; i<40000; i++){asm ("nop");}; 1: i = 50000 (gdb) ^C ****************************************************************** There, CTRL+C has no action, have to quit GDB and restart it. Other test made by stepping assembly instruction when reaching breakpoint line 68 : ****************************************************************** Breakpoint 2, main () at ../main.c:68 68 for (i=1; i<40000; i++){asm ("nop");}; 1: i = 50000 (gdb) nexti 0x0000065c 68 for (i=1; i<40000; i++){asm ("nop");}; 1: i = 50000 (gdb) 0x00000660 68 for (i=1; i<40000; i++){asm ("nop");}; 1: i = 1 (gdb) 0x00000668 68 for (i=1; i<40000; i++){asm ("nop");}; 1: i = 1 (gdb) 0x0000066e 68 for (i=1; i<40000; i++){asm ("nop");}; 1: i = 1 (gdb) 0x00000672 68 for (i=1; i<40000; i++){asm ("nop");}; 1: i = 1 (gdb) 0x00000662 68 for (i=1; i<40000; i++){asm ("nop");}; 1: i = 1 (gdb) 0x00000664 68 for (i=1; i<40000; i++){asm ("nop");}; 1: i = 1 (gdb) 0x00000668 68 for (i=1; i<40000; i++){asm ("nop");}; 1: i = 2 (gdb) 0x0000066e 68 for (i=1; i<40000; i++){asm ("nop");}; 1: i = 2 (gdb) 0x00000672 68 for (i=1; i<40000; i++){asm ("nop");}; 1: i = 2 (gdb) 0x00000662 68 for (i=1; i<40000; i++){asm ("nop");}; 1: i = 2 (gdb) 0x00000664 68 for (i=1; i<40000; i++){asm ("nop");}; 1: i = 2 (gdb) c Continuing. Breakpoint 1, main () at ../main.c:66 66 PTFD &= ~PTFD_PTFD0_MASK;; 1: i = 50000 ****************************************************************** Here the program has been executed normally and looped until line 66 (1st breakpoint) -----Original Message----- From: Carlos O'Donell [mailto:carlos at codesourcery.com] Sent: vendredi 20 mai 2011 22:22 To: Stephane Franck Rey Cc: coldfire-gnu-discuss at codesourcery.com Subject: Re: [coldfire-gnu-discuss] GDB freeze when steping into a loop with P&E BDM On 5/20/2011 4:16 PM, Stephane Franck Rey wrote: Please keep the list in the CC so others can learn about the problem. > #define SOPT (*( unsigned char *)0xFFFF9802) > #define SOPT_COPE_MASK 128 > > #define PTFD (*( unsigned char *)0xFFFF800A) > #define NVFTRIM (*(unsigned char *)0x000003FE) > #define PTFDD (*( unsigned char *)0xFFFF800B) Should be volatile otherwise the compiler will optimize them away as constants when -ON for N > 0. > // Turn ON/OFF PTE6/7 LEDs > PTFDD |= 0 | PTFDD_PTFDD0_MASK | PTFDD_PTFDD1_MASK; > PTFD =0xff ; > PTFD =0x00 ; > > for (;;) { > PTFD |= PTFD_PTFD0_MASK ; > PTFD&= ~PTFD_PTFD1_MASK; > for (i=1; i<50000; i++){asm ("nop");}; > > PTFD&= ~PTFD_PTFD0_MASK;; > PTFD |= PTFD_PTFD1_MASK ;; > for (i=1; i<40000; i++){asm ("nop");}; > } Have you debugged this from the command line gdb to show it's not an IDE problem? Cheers, Carlos. -- Carlos O'Donell Mentor Graphics / CodeSourcery carlos at codesourcery.com +1 (650) 331-3385 x716 -------------- next part -------------- A non-text attachment was scrubbed... Name: testEclipse.zip Type: application/x-zip-compressed Size: 952741 bytes Desc: testEclipse.zip URL: