AbhraneelBera / wiringBone

Wiring/Arduino style library for BeagleBone Black Platform
25 stars 14 forks source link

bus error #5

Open Rahul5214 opened 8 years ago

Rahul5214 commented 8 years ago

im getting this error: "./build-source: line 2: 2025 Bus error ./main" even when i upload just a simple blink code so no source of error in code.

aagrxyz commented 8 years ago

I receive the same error even in a simple code that just counts from 1 to 100. I am still unable to find the reason of the problem and the way to solve it. Any help is greatly appreciated .

AbhraneelBera commented 8 years ago

Please let me know which OS image and which kernel you are using. There may be some recent changes in the hardware drivers which may cause this issue.

On Mon, May 30, 2016 at 10:29 PM, Aman Agrawal notifications@github.com wrote:

I receive the same error even in a simple code that just counts from 1 to 100. I am still unable to find the reason of the problem and the way to solve it. Any help is greatly appreciated .

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/AbhraneelBera/wiringBone/issues/5#issuecomment-222528127, or mute the thread https://github.com/notifications/unsubscribe/AMPwc1WyUA9UI94rwoZD33LVsTnue4tFks5qGxeMgaJpZM4IpVkt .

Rahul5214 commented 8 years ago

Problem resolved. Bus error is gone after updating beaglebone black to latest Debian (Debian 8.4) image. Kernel : 4.4.9

KaiboFu commented 8 years ago

I also meet the same error when compiling and running a simple Arduino-like UART codes as follws:

include "UserPinConfig.h"

using namespace std;

void setup(){

Serial2.end();

Serial2.begin(9600);

}

void loop(){

while(Serial2.available()){

    int x = Serial2.read();

    cout <<x <<endl;

}

Serial2.end();

}

But the strange thing is that: I also run a simple python UART code before before running the Arduino-like UART codes. The python codes work and the reading content is normal. If I restart BBB and exchange the program running order, i.e., running the Arduino-like UART codes first, the Arduino-like UART codes work and the bus error does not occurs. But the reading content is only -1, which means nothing. Then i run the python codes, it works but cannot read anything.

I really do not know why it happens and could you help me? Thanks in advance!

AbhraneelBera commented 8 years ago

Have you configured the appropriate pins (for your case it's P9_11 and P9_13) in UserPinConfig.h? While the program is running open a new terminal and use the command : "config-pin -q pin_num". For example "config-pin -q P9.13". Check whether both the pins are set to mode : uart.