Caanoo / WIZ Caanoo Sdk, Debugging


surdules

Still Fresh
Joined
Nov 22, 2010
Messages
3
Hi,

What Linux SDKs are folks using for developing on the Caanoo? There is the official one, and the unofficial one. From what I can tell, they're actually pretty similar, with the main difference that the unofficial one does not have the DGE libraries/samples.

Also, I am experiencing a crash that only happens when I run the Caanoo binary on the device (running the same exact code as an x86 Linux binary on my PC works fine). Has anyone successfully run gdb on the Caanoo itself, any other tips for how to debug this?

Thanks,

Razvan.
 
Hi!

I'm using the official one, and having same weird issues: code will work on the PC but will crash on the Caanoo...
 
kouky said:
I'm using the official one, and having same weird issues: code will work on the PC but will crash on the Caanoo...

I read on another discussion board that both official and unofficial Caanoo SDKs are broken and produce code that is subtly buggy (meaning, for simple programs it might work, but for anything moderately complex, it is likely to cause crashes on the Caanoo). This is pretty unfortunate. :(

Has anyone been successful in building their own toolchain (with crosstool-ng, for instance)?

Razvan.
 
Last edited by a moderator:
Can you guys isolate the code that is making caanoo crash?

I mean, how simple a program should be to don't crash?

Maybe is it some specific function, like g-sensor, touch screen or the vibration that is causing this problem.
 
If you have not done this already, you definitely want to get some remote execution setup going first (ie SSH via USB or WLAN).

This will enable you to:

1) Do "printf-debugging"
  • Run your code in a remote terminal and put debug messages around the critical parts:
    Code:
    fprintf(stderr, "It did not crash yet in %s:%d\n", __FILE__, __LINE__ );

2) Run GDB in a remote terminal
  • A GDB binary to run on the Caanoo is already included in the SDK (tools/target/debug/gdb)
  • You need a debug build of your executable though which needs more memory...

3) Run gdbserver in a remote terminal
  • A gdbserver binary is also included in the SDK, BUT...
  • The cross-debugger from the SDK (tools/gcc-4.2.4-glibc-2.7-eabi/bin/arm-gph-linux-gnueabi-gdb) seems to be broken (built against ancient libs that are no longer found on current Linux systems).
  • You can easily build your own gdbserver/cross-debugger from the GDB sources using the SDK though.
  • You can run the stripped binary on the Caannoo and leave the debug symbols on the PC
 
Would you have any examples on how to do debugging via USB from Windows?
Is it just a matter of running cygwin and a telnet? But how to point to the device?
 
I don't exactly know how to get this to work on Windows, but there is how it works in theory:

You load the ethernet gadget driver on the Caanoo and set up a network interface (see here). On the PC you can then set up a matching network interface and talk to the Caanoo by it's IP address. You can then run Dropbear or telnetd on the Caanoo and connect via putty etc.

Actually setting up the network interface in Windows seems to be the tricky part - you might need to install special drivers and do some tweaking. Google for "usbnet windows" ;-)

Good luck!
 
Thanks, that's exactly what I needed to know.
I'll try to find a Windows usbnet driver then...
 
Newsdee said:
Thanks, that's exactly what I needed to know.
I'll try to find a Windows usbnet driver then...

maybe this http://mytether.net/#other helps.

didn't try that solution on my own, but i never managed to setup usb networking on windows :(

*edit*
ah i guess there was some reason hardware wise on the caanoo that it didnt work; some odd thing for sure; don't try too long figuring it out but buy a wifi adapter and you're good to go. that's what i do and this works fine.
 
Last edited by a moderator:
Back
Top