RPi A111 Radar: problem getting started

I installed and built acconeer_rpi_sparkfun_v2_4_0.zip without a problem.

When trying the examples I git a problem with gpio that I have not been able to sort out:

~/rpi_sparkfun/out $ sudo ./example_assembly_test_rpi_sparkfun_a111_r2c

00:06:24.611 [ 1032] (E) (driver_gpio_linux_sysfs) Could not write to gpio export: Device or resource busy

00:06:24.612 [ 1032] (E) (driver_gpio_linux_sysfs) Could not write to gpio export: Device or resource busy

Any advice?

Do you have any background programs running that are trying to use the GPIO pins? You can run a top to check what all is running in the foreground and background.

Not that I can see, but I am not quite sure about exactly which ones to suspect.

Here is the list

Tanks a lot for responding!

iB Swap: 100,0 total, 98,5 free, 1,5 used. 276,4 avail Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND

3933 sa0bxi 20 0 13196 3280 2740 R 1,0 0,7 0:00.11 top

9 root 20 0 0 0 0 S 0,3 0,0 0:05.05 ksoftirqd/0

369 root 20 0 27656 1452 1324 S 0,3 0,3 0:34.81 rngd

540 root 20 0 51024 15308 8532 S 0,3 3,5 1:32.57 fail2ban-server

3132 sa0bxi 20 0 12236 3868 3080 S 0,3 0,9 0:00.57 sshd

3929 root 20 0 0 0 0 I 0,3 0,0 0:00.03 kworker/u8:3-events_unbound

1 root 20 0 33736 8016 6412 S 0,0 1,8 0:09.72 systemd

2 root 20 0 0 0 0 S 0,0 0,0 0:00.18 kthreadd

3 root 0 -20 0 0 0 I 0,0 0,0 0:00.00 rcu_gp

4 root 0 -20 0 0 0 I 0,0 0,0 0:00.00 rcu_par_gp

8 root 0 -20 0 0 0 I 0,0 0,0 0:00.00 mm_percpu_wq

10 root 20 0 0 0 0 I 0,0 0,0 0:08.53 rcu_sched

11 root rt 0 0 0 0 S 0,0 0,0 0:00.04 migration/0

12 root 20 0 0 0 0 S 0,0 0,0 0:00.00 cpuhp/0

13 root 20 0 0 0 0 S 0,0 0,0 0:00.00 cpuhp/1

14 root rt 0 0 0 0 S 0,0 0,0 0:00.03 migration/1

15 root 20 0 0 0 0 S 0,0 0,0 0:00.12 ksoftirqd/1

18 root 20 0 0 0 0 S 0,0 0,0 0:00.00 cpuhp/2

19 root rt 0 0 0 0 S 0,0 0,0 0:00.03 migration/2

20 root 20 0 0 0 0 S 0,0 0,0 0:00.10 ksoftirqd/2

23 root 20 0 0 0 0 S 0,0 0,0 0:00.00 cpuhp/3

24 root rt 0 0 0 0 S 0,0 0,0 0:00.03 migration/3

25 root 20 0 0 0 0 S 0,0 0,0 0:00.19 ksoftirqd/3

28 root 20 0 0 0 0 S 0,0 0,0 0:00.00 kdevtmpfs

29 root 0 -20 0 0 0 I 0,0 0,0 0:00.00 netns

32 root 20 0 0 0 0 S 0,0 0,0 0:00.22 khungtaskd

33 root 20 0 0 0 0 S 0,0 0,0 0:00.00 oom_reaper

34 root 0 -20 0 0 0 I 0,0 0,0 0:00.00 writeback

35 root 20 0 0 0 0 S 0,0 0,0 0:00.00 kcompactd0

52 root 0 -20 0 0 0 I 0,0 0,0 0:00.00 kblockd

53 root rt 0 0 0 0 S 0,0 0,0 0:00.00 watchdogd

56 root 0 -20 0 0 0 I 0,0 0,0 0:00.00 rpciod

57 root 0 -20 0 0 0 I 0,0 0,0 0:00.00 kworker/u9:0-hci0

58 root 0 -20 0 0 0 I 0,0 0,0 0:00.00 xprtiod

59 root 20 0 0 0 0 S 0,0 0,0 0:00.91 kswapd0

60 root 0 -20 0 0 0 I 0,0 0,0 0:00.00 nfsiod

61 root 0 -20 0 0 0 I 0,0 0,0 0:00.00 iscsi_eh

62 root 0 -20 0 0 0 I 0,0 0,0 0:00.00 dwc_otg

63 root 0 -20 0 0 0 I 0,0 0,0 0:00.00 DWC Notificatio

65 root 1 -19 0 0 0 S 0,0 0,0 0:00.00 vchiq-slot/0

66 root 1 -19 0 0 0 S 0,0 0,0 0:00.00 vchiq-recy/0

67 root 0 -20 0 0 0 S 0,0 0,0 0:00.00 vchiq-sync/0

68 root 20 0 0 0 0 S 0,0 0,0 0:00.00 vchiq-keep/0

69 root 10 -10 0 0 0 S 0,0 0,0 0:00.00 SMIO

72 root 0 -20 0 0 0 I 0,0 0,0 0:00.00 mmc_complete

74 root 0 -20 0 0 0 I 0,0 0,0 0:00.35 kworker/3:1H-kblockd

75 root 20 0 0 0 0 S 0,0 0,0 0:00.13 jbd2/mmcblk0p2-

76 root 0 -20 0 0 0 I 0,0 0,0 0:00.00 ext4-rsv-conver

78 root 0 -20 0 0 0 I 0,0 0,0 0:00.00 ipv6_addrconf

83 root 0 -20 0 0 0 I 0,0 0,0 0:00.18 kworker/1:1H-kblockd

85 root 0 -20 0 0 0 I 0,0 0,0 0:00.16 kworker/2:1H-kblockd

95 root 0 -20 0 0 0 I 0,0 0,0 0:00.57 kworker/0:2H-kblockd

122 root 20 0 26776 7784 6900 S 0,0 1,8 0:02.18 systemd-journal

141 root 20 0 18272 4012 3116 S 0,0 0,9 0:01.70 systemd-udevd

160 root 10 -10 0 0 0 S 0,0 0,0 0:00.00 SMIO

165 root 20 0 0 0 0 S 0,0 0,0 0:00.00 spi0

167 root 0 -20 0 0 0 I 0,0 0,0 0:00.00 mmal-vchiq

169 root 0 -20 0 0 0 I 0,0 0,0 0:00.00 mmal-vchiq

170 root 0 -20 0 0 0 I 0,0 0,0 0:00.00 mmal-vchiq

173 root 0 -20 0 0 0 I 0,0 0,0 0:00.00 mmal-vchiq

222 root 0 -20 0 0 0 I 0,0 0,0 0:00.00 cfg80211

227 root 0 -20 0 0 0 I 0,0 0,0 0:00.00 brcmf_wq/mmc1:0

228 root 20 0 0 0 0 S 0,0 0,0 0:11.48 brcmf_wdog/mmc1

302 systemd+ 20 0 22412 5652 5000 S 0,0 1,3 0:01.11 systemd-timesyn

346 message+ 20 0 6548 3520 3036 S 0,0 0,8 0:00.70 dbus-daemon

347 nobody 20 0 4320 2020 1848 S 0,0 0,5 0:02.16 thd

350 avahi 20 0 5904 2992 2608 S 0,0 0,7 0:27.56 avahi-daemon

I should say that I am using a fresh raspbian buster lite install, so whatever is blocking should not be my doing, as far as I understand…

And you’ve enabled SPI in raspi-config? https://learn.sparkfun.com/tutorials/ge … re-your-pi

yes, SPI is enabled, while i2c and onewire are disabled.

For security reasons, I do use another user than pi. could that be a problem?

Sorry to have bothered you. I started all over, stayed with user pi, installed nothing else, and now it works. Thanks for making me focus on basics.

No worries, that can be the most infuriating thing about Raspberry Pi. Small details!

Well, I just ran into exactly the same problem.

Fresh Buster install. But a slight variation: I’m logged in as “pi”. Tried everthing I could think of. To no avail. When doing a “cat /sys/kernel/debug/gpio” I get CS1 and CS0 as being used by spi0 (out hi ACTIVE LOW). Disabling SPI in raspi-config and starting the examples gives a ton of errors complaining about SPI not being available. Which is sort of logical. But SPI loaded and CS0 and CS1 being hogged by what?

Update: Did a fresh install with Stretch (version before Buster). Chip Select lines are free… This really leaves me wondering…

Hi, you mean you could run it under Stretch?

Im curretly facing same isuues, I have PI4- neither Buster + Desktop oder Buster Lite have solved,

still (E) (driver_gpio_linux_sysfs) Could not write to gpio export: Device or resource busy

Idk why SPI gets busy by anything even under Lite

Are u guys using another versions of Pi, 3,3B ?

I have had no issues using (from cat /proc/cpuinfo):

Hardware : BCM2835

Revision : a020d3

Serial : 00000000ab78959a

Model : Raspberry Pi 3 Model B Plus Rev 1.3

running (lsb_release -a):

Distributor ID: Raspbian

Description: Raspbian GNU/Linux 10 (buster)

Release: 10

Codename: buster

Hello,

I am having the same error when I am trying to run any executable example in the /out folder. I do not have anything else running at the same time. The error is

[ 4460] (E) (driver_gpio_linux_sysfs) Could not write to gpio export: Device or resource busy

I followed the instructions on [Sparkfun A111 Guide][/https://learn.sparkfun.com/tutorials/ge … dar-sensor]. Everything went smooth till the time I try running example.

Here is cat /proc/cpuinfo

Hardware : BCM2711

Revision : b03111

Serial : 10000000ce567916

Model : Raspberry Pi 4 Model B Rev 1.1

Here is lsb_release-a

Distributor ID: Raspbian

Description: Raspbian GNU/Linux 10 (buster)

Release: 10

Codename: buster

Any help would be appreciated.

Thanks

Hello people,

I get the same issue, the following user suggested this solution:

sa0bxi:
Sorry to have bothered you. I started all over, stayed with user pi, installed nothing else, and now it works. Thanks for making me focus on basics.

Unfortunately it does not work for me. The sole user on my Raspberry 4 model b is the default one (pi).

I am using the recommanded raspberry Pi OS, with the Desktop.

my top:

542 root 20 0 243164 81936 42640 S 6.6 2.1 0:13.70 Xorg

1288 pi 20 0 438408 134856 84932 S 6.6 3.4 1:05.35 chromium-browse

860 pi 20 0 237956 50392 37684 S 4.3 1.3 0:01.74 lxterminal

1062 pi 20 0 405340 108076 86716 S 4.0 2.8 0:30.23 chromium-browse

1468 pi 20 0 10436 3148 2508 R 0.7 0.1 0:00.08 top

409 nobody 20 0 4320 2148 1976 S 0.3 0.1 0:00.49 thd

1017 pi 20 0 453956 119252 83900 S 0.3 3.0 0:27.94 chromium-browse

1377 pi 20 0 329660 78996 60072 S 0.3 2.0 0:03.11 chromium-browse

1 root 20 0 33616 8028 6476 S 0.0 0.2 0:03.71 systemd

2 root 20 0 0 0 0 S 0.0 0.0 0:00.01 kthreadd

3 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_gp

4 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_par_gp

6 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kworker/0:0H-mmc_complete

7 root 20 0 0 0 0 I 0.0 0.0 0:00.47 kworker/u8:0-brcmf_wq/mmc1:0001:1

8 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 mm_percpu_wq

9 root 20 0 0 0 0 S 0.0 0.0 0:00.21 ksoftirqd/0

10 root 20 0 0 0 0 I 0.0 0.0 0:00.17 rcu_sched

11 root rt 0 0 0 0 S 0.0 0.0 0:00.01 migration/0

12 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/0

13 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/1

14 root rt 0 0 0 0 S 0.0 0.0 0:00.01 migration/1

15 root 20 0 0 0 0 S 0.0 0.0 0:00.06 ksoftirqd/1

18 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/2

19 root rt 0 0 0 0 S 0.0 0.0 0:00.00 migration/2

20 root 20 0 0 0 0 S 0.0 0.0 0:00.08 ksoftirqd/2

21 root 20 0 0 0 0 I 0.0 0.0 0:00.00 kworker/2:0-mm_percpu_wq

23 root 20 0 0 0 0 S 0.0 0.0 0:00.00 cpuhp/3

24 root rt 0 0 0 0 S 0.0 0.0 0:00.00 migration/3

25 root 20 0 0 0 0 S 0.0 0.0 0:00.08 ksoftirqd/3

28 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kdevtmpfs

29 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 netns

30 root 20 0 0 0 0 I 0.0 0.0 0:00.05 kworker/0:1-mm_percpu_wq

32 root 20 0 0 0 0 S 0.0 0.0 0:00.00 khungtaskd

33 root 20 0 0 0 0 S 0.0 0.0 0:00.00 oom_reaper

34 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 writeback

35 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kcompactd0

52 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kblockd

53 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 blkcg_punt_bio

56 root rt 0 0 0 0 S 0.0 0.0 0:00.00 watchdogd

57 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rpciod

59 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 xprtiod

60 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kswapd0

61 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 nfsiod

62 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 kthrotld

63 root -51 0 0 0 0 S 0.0 0.0 0:00.00 irq/54-aerdrv

64 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 iscsi_eh

67 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 DWC Notificatio

68 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 uas

70 root 1 -19 0 0 0 S 0.0 0.0 0:00.00 vchiq-slot/0

71 root 1 -19 0 0 0 S 0.0 0.0 0:00.00 vchiq-recy/0

72 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 vchiq-sync/0

73 root 20 0 0 0 0 S 0.0 0.0 0:00.00 vchiq-keep/0

74 root 10 -10 0 0 0 S 0.0 0.0 0:00.00 SMIO

76 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 sdhci

77 root -51 0 0 0 0 S 0.0 0.0 0:00.00 irq/41-mmc0

78 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 mmc_complete

82 root 20 0 0 0 0 S 0.0 0.0 0:00.06 jbd2/mmcblk0p2-

83 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 ext4-rsv-conver

85 root 0 -20 0 0 0 I 0.0 0.0 0:00.18 kworker/1:2H-kblockd

86 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 ipv6_addrconf

90 root 0 -20 0 0 0 I 0.0 0.0 0:00.28 kworker/2:1H-kblockd

my config.txt:

For more options and information see

http://rpf.io/configtxt

Some settings may impact device functionality. See link above for details

uncomment if you get no picture on HDMI for a default “safe” mode

#hdmi_safe=1

uncomment this if your display has a black border of unused pixels visible

and your display can output without overscan

disable_overscan=1

uncomment the following to adjust overscan. Use positive numbers if console

goes off screen, and negative if there is too much border

#overscan_left=16

#overscan_right=16

#overscan_top=16

#overscan_bottom=16

uncomment to force a console size. By default it will be display’s size minus

overscan.

#framebuffer_width=1280

#framebuffer_height=720

uncomment if hdmi display is not detected and composite is being output

#hdmi_force_hotplug=1

uncomment to force a specific HDMI mode (this will force VGA)

#hdmi_group=1

#hdmi_mode=1

uncomment to force a HDMI mode rather than DVI. This can make audio work in

DMT (computer monitor) modes

#hdmi_drive=2

uncomment to increase signal to HDMI, if you have interference, blanking, or

no display

#config_hdmi_boost=4

uncomment for composite PAL

#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.

#arm_freq=800

Uncomment some or all of these to enable the optional hardware interfaces

#dtparam=i2c_arm=on

#dtparam=i2s=on

dtparam=spi=on

Uncomment this to enable infrared communication.

#dtoverlay=gpio-ir,gpio_pin=17

#dtoverlay=gpio-ir-tx,gpio_pin=18

Additional overlays and parameters are documented /boot/overlays/README

Enable audio (loads snd_bcm2835)

#dtparam=audio=on

[pi4]

Enable DRM VC4 V3D driver on top of the dispmanx display stack

#dtoverlay=vc4-fkms-v3d

#max_framebuffers=2

[all]

#dtoverlay=vc4-fkms-v3d

thanks for the help and any inputs you could provide me.

Hi guys!

we have tried here at work some workarounds till now without success.

firstly we have check SPI connetion with another sensor and it works as usuall, raspi4 seems to be working fine.

making sure nothing else working in backfround, under Busterlite showed some message: [ 1032] (E) (driver_gpio_linux_sysfs) Could not write to gpio export: Device or resource busy

in somehow this issues persists,

we wanted to get several of them for implementation, we just dont know how to go any further

any kind of help would be very welcome, we want to keep our hopes in this device…

all best, Regards

Nicolas

Solved using the buster Debian instead of the easy-to-use install.

Great! thanks hdelon!

im gonna try right now, btw wihch version did you use, 10.5 ?

Hi guys!

I have solved by usung a short configuration for the Acconer XC112 , as explain in the README_rpi.pdf in docs folder (in SDK).

Start a terminal window and type “sudo raspi-config” - In Localisation Options,

select the appropriate timezone. - In Interfacing Options, enable SPI and I2C

and the SSH interfaces.

If you plan to use XC112 with newer kernels (v5.4 and later) the following line

must be added to /boot/config.txt (i.e. sudo nano /boot/config.txt) and then

reboot.

dtoverlay=spi0-cs,cs0_pin=8,cs1_pin=28

The reason for this is that the kernel spi driver controls and prevent any user

application from controlling the SPI0 CS1 which is by default mapped to GPIO7.

The above line will remap SPI0 CS1 to GPIO28 (which is a pin not available on

the Raspberry Pi header) and release the GPIO7 so that it can be controlled by

the Acconeer SW.

important to reboot after saving the config.txt

I hope this helps many of you :wink:

I am getting a similar error to what other posts show:

00:01:49.357 [ 950] (E) (driver_gpio_linux_sysfs) Could not write to gpio export: Device or resource busy

00:01:49.357 [ 950] (E) (driver_gpio_linux_sysfs) Could not write to gpio export: Device or resource busy

I did make the change to /boot/config.txt as noted above, no help.

Running sudo cat /sys/kernel/debug/gpio gives me:

gpiochip0: GPIOs 0-53, parent: platform/3f200000.gpio, pinctrl-bcm2835:

gpio-4 ( |onewire@0 ) out lo

gpio-8 ( |spi0 CS0 ) out hi ACTIVE LOW

gpio-28 ( |spi0 CS1 ) out hi ACTIVE LOW

gpiochip1: GPIOs 100-101, brcmvirt-gpio, can sleep:

gpio-100 ( |led0 ) out hi

gpiochip2: GPIOs 504-511, parent: platform/soc:firmware:expgpio, raspberrypi-exp-gpio, can sleep:

gpio-511 ( |led1 ) in hi

I am running Debian Buster v10 (not sure what sub-version nor how to find it).
I do have SPI and I2C enabled. The only things connected are the A111 breakout board, HDMI for video and USB for KB/Mouse. Running my tests through a terminal window on the desktop.
Running on Rpi 3 B.
Any help would be greatly appreciated