Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » GDB Debug Error Code 126 - STM32F4 Board (Arm Cortex M4)
GDB Debug Error Code 126 - STM32F4 Board (Arm Cortex M4) [message #1384554] Thu, 29 May 2014 05:45 Go to next message
Eclipse UserFriend
Hi guys,
So i have looked but cant find an answer to my issue.
Im very new to this and its my first project.

Im using Eclipse Kepler on Ubuntu.
I have Embedded GDB as the debugger and Zylin Native, and Openocd.
When i start Flash and Debug, it seems to work, and goes to a (Suspended) states. Then i press 'Resume', and then it terminates with:
<During startup program exited with code 126>

If i run GDB from Terminal, i get the same thing, and it says Permission Denied.
But if i type into Terminal:

"Gcc -g main.cpp -o main.o"

And then go through Gdb, Run, etc, it 'Reads from directory (or something)' and then says:
"Starting Program" but then Terminal just stays saying that.

Any ideas how to get the debug to work in Eclipse?

I've made sure all files are allowed to be executed, chmod..., but not sure if my 'mount' is, my fstab file says nothing about my user or mount.

Thanks in advance, and leymans terms please as i dont know the jargon.


Dan

[Updated on: Fri, 30 May 2014 03:37] by Moderator

Re: GDB Debug Error Code 126 - STM32F4 Board (Arm Cortex M4) [message #1384782 is a reply to message #1384554] Sun, 01 June 2014 09:37 Go to previous message
Eclipse UserFriend
**Update**

Ok, so i read somewhere about the 'GDB Script', found under:

Debug Config >> Zylin Native >> Debugger >> GDB Script

I can't find GDB script, im assuming that it means the GDB Command File??

So i changed the GDB Command File (which was blank) to: gdb/stm32f407vg.script

Now, when i flash and debug, it seems to actually do something, but still getting an error:

source gdb/stm32f407vg.script
warning: Architecture rejected target-supplied description
warning: Architecture rejected target-supplied description

0x00000000 in ?? ()
background polling: on
TAP: stm32f4x.cpu (enabled)
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x01000000 pc: 0x0800009d msp: 0x20020000
device id = 0x10016413
flash size = 1024kbytes
flash 'stm32f2x' found at 0x08000000
cleared protection for sectors 0 through 11 on flash bank 0
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0800009c msp: 0x20020000
erased sectors 0 through 11 on flash bank 0 in 16.039459s
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x20000042 msp: 0x20020000
wrote 1708 bytes from file bin/bareCortexM.elf in 0.072416s (23.033 KiB/s)
set protection for sectors 0 through 11 on flash bank 0
requesting target halt and executing a soft reset
*** stack smashing detected ***: /usr/bin/gdb terminated


So it looks like it doesn't like what i put into the command file, but it does seem to 'write' to the board, i think. (If you look up a few lines, it says: wrote 1708 bytes...)

Any help would be great, i think theres something in the command file bit which is right as it does seem to write, but wrong because it doesn't like it, and it does then terminate GDB after writing.

Thanks,


Dan

(PS I'm doing this project as a task to get a job interview as an apprentice in a robotics company, i've got a HNC in Electronic Engineering but we only did about 4 weeks worth of Visual Studio C++ programming.)



Just to add, Although i'm still coming up with that error, i am succesfully Flashing the STM32 Board, although i cannot Debug and see what is happening in reak time.

[Updated on: Sun, 01 June 2014 18:15] by Moderator

Previous Topic:GETTING ERROR "BINARY NOT FOUND"
Next Topic:CDT Editor - width of line number column
Goto Forum:
  


Current Time: Thu Jul 17 03:14:45 EDT 2025

Powered by FUDForum. Page generated in 0.06459 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top