BeagleBone Black: Cannot execute binary on MicroSD - c++

I recently purchased a BeagleBone Black Revision C. To test my first program this is what I did:
I plugged an old spare MicroSD card into BeagleBone Black's MicroSD Slot.
Connected BeagleBone Black directly to my Ubuntu PC using a USB cable and powered it on.
Used SSH to connect directly with the BBB board.
Debian OS on BeagleBone shows the contents of the MicroSD inside the /media/xxx folder.
I used nano to create a "hello world" C++ program and saved it on the microSD and used the on-board g++ to compile/link it.
Compilation/linking created an a.out binary on the MicroSD.
My Issue:
When I try to run the binary using the command ./a.out from my SSH prompt I receive a Permisison Denied message.
I unsuccessfully tried to set the executable flag using chmod command.
But everything works when I save the program on the on-board storage, compile and link it, and run the binary from there.
Please assist, I am a complete novice. My first guess is that Debian OS on the BeagleBone Black doesn't allow execution of binaries stored outside the on-board eMMC, but I might be wrong.

Related

Difference between USB Serial in Windows and Linux

I bought a Variense VMU931 inertial measurement unit (IMU) for a robotics project at school, and I am struggling to get it to reliably communicate with my laptop in Ubuntu. I am using C++ with termios to connect to it using 8n1 no parity blah blah blah. I've tried EVERY permutation of settings I can think of, and I still cannot reliably send commands to the IMU.
I called Variense support and spoke to the engineer that wrote their software, and he said it is a known issue. Evidently it works perfectly in Windows (and the Windows demo software worked fine with my device), but neither of us is aware of a significant difference between the USB Serial emulation in Windows and in Linux.
The constructor at the top of this file shows how I am opening and configuring the port:
https://github.com/jsford/FFAST/blob/master/VMU931/src/vmu.cpp
Any help would be great. I've been tearing my hair out over this!
Thanks!
Use the cu utility for running tests with different parameters.
To debug the issue: run the USB packet capture with Wireshark on Linux directly and also on a Windows VM running in VirtualBox/VmWare. Compare the traffic.
Check which kernel module is chosen and loaded for that USB device. Use /sys/ filesystem for that: this virtual fs has information from kernel about what's used. Also, the lsmod-kind of commands show the kernel module usage. The driver choice for USB depends on something like <usb-manufacturer-id>:<usb-product-id>.
Put some printfs into the kernel module to see where is fails. Use the DKMS build system for rebuilding the kernel module. There is a config file somewhere in Linux to blacklist/whitelist the kernel modules - useful to make sure that the right one is loaded.
That's what I was doing to fix a driver of an USB-serial device.

System crash with QMediaPlayer and gstreamer

I am currently writing an application with build-in audio player.
When I setup QMediaPlayer, I (always) get the following error:
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
There are some google results about that, but I did not find any solution to fix it.
Please note that I do not use jack.
So far I can live with that error message, but there is a much worse problem. Most of the time, the application works fine and does the expected but sporadically it freezes. The whole system freezes. I can turn the mouse around (with a poor frame rate) but I cannot click on anything or interact with any other program. Even switching to a text terminal with Ctrl+Alt+F1 does not help which make me think there should be an issue with a driver or a kernel module.
I tried mp3 and vorbis, with and without debugger, in debug and in release mode. Always the same.
There is no additional warning, error etc.
The error also occurs when starting the application from console (an executable that ran just before without any problems).
System:
Linux t420s 3.16-3-amd64 #1 SMP Debian 3.16.5-1 (2014-10-10) x86_64 GNU/Linux
Qt 5.1.1, C++11
qmake:
qmake .../CAN.pro -r -spec linux-g++-64 CONFIG+=debug
The part of code causing the issue:
QMediaPlayer* _player = 0;
_player = new QMediaPlayer(this);
...
QFile tmpFile(filename);
tmpFile.open(QIODevice::ReadWrite);
tmpFile.write(_mediaFile);
_player->setMedia(QUrl::fromLocalFile(filename)); // <-- this line causes the freezing
The last system update/upgrade was on November 9, 2014.
Btw, the whole project is publicly hosted on github. I also asked the same question here but did not receive any answer. Sorry for multipost.
One or two months ago, I had to reinstall my system for irrelevant reasons. I decided to install Ubunutu 14.04 instead of Debian.
Since then, the error did not show up again. So I guess this issue is solved. Although I'd be glad to know the reasons...

remote DBG via TCP cannot find bounds of current function

I am trying to remotely debug a linux machine c++ hello world code from a windows client. I am Debuging from windows 7 to Beaglebone Black running ubuntu. I remember i had similar issues when i was debuging from a linux machine to raspberry pi host.
The problem is, when i start debbuging i cant step anywhere because i am getting ths message:
I provided the gdb debugger and executable for the client program within i debug from but i have no clue what else shuld i give? One thing is that when i instead of stepping continue through the code, i finally get to my breakpoint but i get segfault at the end anyways. How can i provide the apropriate info for the debugger?
Any help would be really aprichiated.

Dealing with full-screen crashes on Mac, using command-line LLDB

I'm trying to debug a crash in a full-screen Mac game I'm working on, but when I have LLDB attached it just causes the game to freeze when the crash happens, and I can't get away from the game - I need to do a hard reset on the computer. Is there any kind of tool or preference for doing this? The computer I'm using to reproduce the crash doesn't have multiple monitors.
Can you do two-computer debugging? Set up an ssh account on the game-running machine, log in to it remotely (command line in Terminal) from your not-game-running machine, run command line lldb on your game. (process attach -n <appname>)
In the past, with gdb, Xcode had support for "remote debugging" which was this arrangement (Xcode running on one Mac, your full-screen game on the other) assuming you already had ssh configured correctly. I don't believe Xcode currently supports remote debugging with lldb - I'd encourage you to file a bug report at http://bugreport.apple.com/ registering your need for this feature if it's something you need in your workflow.
I'm afraid I can't think of any answers for you off-hand if you're doing single-machine debugging.

How to debug a linux C++ program from Windows with Eclipse?

I use a headless (i.e. no screen) remote ubuntu server x64 for developping a C++ application (with no UI either).
I want to conveniently (IDE like, not command line) debug this program from windows (7/64), with Eclipse if possible. I have a windows share between the two and full root access on both machines.
So far I have heard of two solutions :
Remote gdb
Remote X server
I have worked on solution 1 : built a cross gdb, copied my program and libs on windows. I'm able to remote-gdb from cygwin command line, but not from eclipse (stuck at "launching... 85%" with no error message nor log)
I have also worked on solution 2 : installed xauth, set X forwarding, installed xming on my windows, set DISPLAY on the linux box. But no effect "can't open DISPLAY xxx" with no easy troubleshoot.
When googling for those problems, I only find outdated pages or different problems.
Did anyone do it ? Can you share advices or fresh pointers on how to remote debug a C++ linux app from Windows ?
I suggest to install an X11 server on your Windows machine (e.g. Xming perhaps?) and to do ssh -X with some X11 client applications (like emacs, ddd if needed, xterm) on your Linux server. Don't use a complex thing like Eclipse. You could just use emacs (remotely on the Linux server, displaying on the Windows desktop X11 server)...
Once emacs works well (running on the remote Linux server, displaying on the Windows desktop X11 server), you can run gdb inside it.
To get ssh -X working, you need to configure it appropriately. Maybe you forgot that step. To test it, just use ssh -X yourlinuxhost xterm, and work on configuration till that step works.
Of course you could also install Linux on your laptop or desktop, perhaps inside a virtual machine above your Windows.
NB. I never used Windows, but I do know that some X11 servers exist for it.
There is a eclipse plugin RSE (Remote System Explorer), it can pretty much do what you are expecting. The code base can be in linux server, eclipses uses telnet / ssh to login. Execution again can happen on a server, native gdb is used to debug.
You can use the following simple plugin for Eclipse.
http://marketplace.eclipse.org/content/direct-remote-c-debugging
It needs just ssh connection to the server and it cares about anything else