Page 1 of 1

BUS Error in CodeBlocks

Posted: Tue Jul 25, 2017 8:33 am
by msalz
Hello,

i'm using codeblocks via vncserver for developing a small c-program to acquire data from channel.
There are no errors from the compiler.

When i start my application i get the error message: BUS Error.
Therefore i start after reboot the webinterface from Red-Pitaya and open the oscilloscop application. After this step i run my own c application. The error doesn't appear.

Has anyone similar problems or any Idea how to fix it?
Thanks

Re: BUS Error in CodeBlocks

Posted: Mon Jul 31, 2017 9:47 am
by uros.golob
Hi,
Bus errors are generally caused by applications trying to access memory that hardware cannot physically address. The cause might be an unaligned access as well as non-existent address, not enough permissions to access or alter memory.

One of many possible reason is that you use wrong fpga bitstream. Which fpga bit-stream are you using currently?

Latest stable and beta releases load logic bitstream on boot, but oscilloscope application uses classic bitstream so you should probably load that one before you try to use actual adc hardware.

Simply running "cat /opt/redpitaya/fpga/fpga_classic.bit > /dev/xdevcfg" should fix this issue if this is the reason of bus error. You can also run this from system() from inside of your c application.

Cheers,
Uroš

Re: BUS Error in CodeBlocks

Posted: Mon Jul 31, 2017 12:41 pm
by msalz
Hi,

after running "cat /opt/redpitaya/fpga/fpga_0.94.bit > /dev/xdevcfg" in my c programm with system() it works without starting the oscilloscope from webinterface. :D
(I downloaded the image file "red_pitaya_OS-stable.img.zip 23-Feb-2017 15:50 463044908" from http://downloads.redpitaya.com/downloads/)

Thank you for your help.

Re: BUS Error in CodeBlocks

Posted: Sun Aug 23, 2020 9:54 am
by omereis
It worked for me also.

Code: Select all

system ("cat /opt/redpitaya/fpga/fpga_0.94.bit > /dev/xdevcfg");
Many Thank
Omer.