BUS Error in CodeBlocks

Applications, development tools, FPGA, C, WEB
Post Reply
msalz
Posts: 11
Joined: Fri Jul 14, 2017 11:51 pm

BUS Error in CodeBlocks

Post by msalz » Tue Jul 25, 2017 8:33 am

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

uros.golob
Posts: 7
Joined: Thu Jan 07, 2016 10:39 am

Re: BUS Error in CodeBlocks

Post by uros.golob » Mon Jul 31, 2017 9:47 am

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š

msalz
Posts: 11
Joined: Fri Jul 14, 2017 11:51 pm

Re: BUS Error in CodeBlocks

Post by msalz » Mon Jul 31, 2017 12:41 pm

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.

omereis
Posts: 21
Joined: Mon Jan 27, 2020 1:10 pm

Re: BUS Error in CodeBlocks

Post by omereis » Sun Aug 23, 2020 9:54 am

It worked for me also.

Code: Select all

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

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 19 guests