logs archiveBotHelp.net / Freenode / #43oh / 2015 / July / 17 / 1
Amperture
getting some weird buggery in msp430-elf-gdb with my ADC code.
If I try to print the return value from an ADC read (unsigned int, right?) in gdb, it gives me "can't compute CFA for this frame"
http://pastebin.com/Sv5stSnE
g0rdon
paste removed
Amperture
Whoops, set it to auto-purge after an hour
hang on, re-uploading
http://pastebin.com/hyycuH5v
Well, now that I'm actually outputting the data to UART, I can tell it's roughly correct.
gdb still can't print in-memory variables though
g0rdon
convertIntToString(adcValue, &cString);
this should rather be "cString"
not &cString
it doesn't make a practical difference in this case, but it's wrong
i don't get what this convertinttostring does
but it doesn't seem to convert int to any sensible string here
anyway i think can't compute cfa for this frame is a stack corruption of some sort
so you are probably overwriting something somewhere that you shouldn't be overwriting
Amperture
Sorry, I rewrote convertIntToString to include proper ASCII values.
I was originally trying to convert it to the ASCII representation of the hex value
and I was using a bad implementation
Now I'm converting it to the ASCII rep of the dec value
And it works well enough
It DOES assume no larger than a 3-digit value, but hey.
g0rdon
can you paste this one?
Amperture
It's probably worth mentioning before we go too far down the rabbit hole with my int to string converter function, I was having the CFA problem long before it ever got written
but all the same, sure
http://pastebin.com/js6q9f5e
g0rdon
right, i'm getting completely different (correct) results now
with the previous one, it was all basically junk
Amperture
Yeah, before, I was still in the process of writing it
in gdb, do you have trouble "print"ing any variables?
g0rdon
i only have host stuff now
well, maybe not
yeah but it's all in one file ;)
no time to goof with that now, sorry
Amperture
Let me see if another project may be causing it.
er, if another, "more innocent" project also causes it.
Yep
Made a project that does nothing more than stop the watchdog, declare an integer, then in a while(1) loop increment the integer.
And I still get "Can't Compute CFA for this frame"
when I try and print the integer in gdb
g0rdon
can you share that?
the bare minimal example you just created
preferably in a form that doesn't take much tingering for me to bring up
Amperture
g0rdon, http://pastebin.com/ydhRQ8Ym
ike
http://9gag.com/gag/a8jyDpQ
g0rdon
amperture, this is intresting ;o
what compiler?
and what switches to it?
Amperture
compiler msp430-elf-gcc,
https://aur.archlinux.org/packages/mspgcc-ti/
Note, it says mspgcc, but claims to be built from redhat's gcc patch
and what switches to it? <-- Sorry, not entirely sure the context of this question
g0rdon
what's the compiler command line?
Amperture
msp430-elf-<tool>
Where <tool> can be gcc, gdb, objcopy, etc
g0rdon
yes, but what options
-c -o -g -O3
Amperture
Ah
Hang on, let me pull that up
I'm using uctools' Makefile
msp430-elf-gcc -c -mmcu=msp430g2553 -g -Wall -Iinc -o build/main.o src/main.c
msp430-elf-gcc build/uart.o build/main.o -mmcu=msp430g2553 -Wl,-Map=build/main.map -o build/main.elf
g0rdon
well, color me dumbfu*ked
i don't know
i'd like to believe that compiler can't be that bad
try pabigot's latest?
Amperture
Eh, I'm not too fussed about it right now. I started printing numbers to UART->tty, and they seem correct, and this project shouldn't need much more debugging than that.
Though I'll write down that maybe I should try and update the whole toolchain soon
g0rdon
(or downdate...)
Amperture
that too
Rickta59
so what are you using with gdb? mspdebug?
@ Amperture
Amperture
Rickta59, yes, mspdebug
Rickta59
which version?
which driver?
show your command line
Amperture
MSPDebug version 0.23 - debugging tool for MSP430 MCUs
rf2500
Rickta59
and you are using a 1.5 launchpad?
Amperture
yes
Rickta59
hmm .. i'm falling behind
i have 0.22
Amperture
I pulled mine from the AUR, so it's possibly not a stable version
Rickta59
hmm .. and sf is down today
did you try the older compiler?
Amperture
pabigot's? no not yet
I may this evening
Rickta59
i seem to remember issues with msp430-elf-gdb and the rf2500
just download energia and you get the toolchain that works
Amperture
Energia packages a debugger?
Rickta59
sure
Amperture
and a gdb server?
Rickta59
how do you think they load the code?
yes mspdebug is used to load the code
Amperture
ah
Rickta59
although I haven't been following its latest versions
Amperture
I'll have to dig around inside /opt/energia I suppose to find the stuff I'll need.
Haven't really touched anything in Energia, not a fan of Arduino's way of doing things.
Rickta59
$ find . -name 'msp430-gcc'
« prev 1 2 next »