cancel
Showing results for 
Search instead for 
Did you mean: 

Segmentation fault when running STUHFL_demo applications

CDemi.11
Associate

Hello,

I am working on ST25RU3993 STUHFL SDK package v3.1.0.0 to run the STUHFL_demo applications on a Raspberry Pi 3 Model B V1.2 device.

Following the instructions specified in the user manual (UM2618), I compiled the middleware source files on RPi 3B using the makefile provided. The installed gcc version and the kernel version of RPi 3 which I've worked on are as follows, respectively:

gcc (Debian 10.2.1-6) 10.2.1 20210110

Linux raspberrypi 5.15.32-v8+ #1538 SMP PREEMPT Thu Mar 31 19:40:39 BST 2022 aarch64 GNU/Linux

Then, I compiled STUHFL_demo application as well without any errors although there are some casting and conversion warnings. And, I was able to generate the executable named as STUHFL_demo.out. Upon running the executable, the ST25RU3993-HPEV board is recognized successfully but after a while, occurs a segmentation fault and the application exits. I also ran Python script named STUHFL_demo.py after placing the libSTUHFL.so file to the appropriate path. Unfortunately, I encountered the same situation. You can see the console logs of STUHFL_demo.py script below:

Welcome to the ST-UHF-L demo 

STUHFL version.3.1.0.0

Using port: /dev/ttyUSB0

************************************

*  GET VERSION DEMO

LIB:.3.1.0.0

Board SW:.3.1.0.0

Board HW:.1.1.0.0

STUHFL SDK Evaluation FW @ STM32L4x6

ST25RU3993-EVAL Board

************************************

*  INVENTORY RUNNER DEMO

Tuning: ANTENNA_0, Algo: 3

Freq: 866900, cin_ANT0:10, clen_ANT0:12, cout_ANT0:1, cin_ANT1:0, clen_ANT1:0, cout_ANT1:0

Freq: 865700, cin_ANT0:10, clen_ANT0:12, cout_ANT0:1, cin_ANT1:0, clen_ANT1:0, cout_ANT1:0

Freq: 866300, cin_ANT0:10, clen_ANT0:12, cout_ANT0:1, cin_ANT1:0, clen_ANT1:0, cout_ANT1:0

Freq: 867500, cin_ANT0:10, clen_ANT0:12, cout_ANT0:1, cin_ANT1:0, clen_ANT1:0, cout_ANT1:0

Segmentation fault

The application exits upon calling "inventory.start(rounds)" in the line 109 of STUHFL_demoInventoryRunner.py script. Python 3.9.2 is installed on RPi 3B and all dependencies of libSTUHFL.so seem available on the device. "ldd libSTUHFL.so" command gives the following output:

linux-vdso.so.1 (0x0000007f82aa8000)

libpthread.so.0 => /lib/aarch64-linux-gnu/libpthread.so.0 (0x0000007f82a0c000)

libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000007f82896000)

/lib/ld-linux-aarch64.so.1 (0x0000007f82a78000)

What point may I be missing? Thanks for your advice and help in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Nick K
ST Employee

Hello CDemi.11,

I tried now with my RPi4 and can not reproduce any segmentation fault.

I am using a 32bit Raspbian OS (version details see below.)

When looking to your system information it looks you are using a 64bit kernel and the toolchain for AARCH64. Could you please try a 32bit RPi OS and 32bit toolchain (arm-linux-gnueabihf) with your RPi to see if the segmentation fault is related to 32 vs 64bit in your case ?

Kernel version: Linux 4.19.75-v7l+ #1270 SMP Tue Sep 24 18:51:41 BST 2019 armv7l GNU/Linux

gcc version: 8.3.0

ldd libSTUHFL.so:

    linux-vdso.so.1 (0xbea07000)

    /usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so => /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so (0xb6efa000)

    libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0xb6d9c000)

    libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6d1a000)

    libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb6ced000)

    libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6cc3000)

    libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6b75000)

    /lib/ld-linux-armhf.so.3 (0xb6f3e000)

BR

View solution in original post

2 REPLIES 2
Nick K
ST Employee

Hello CDemi.11,

I tried now with my RPi4 and can not reproduce any segmentation fault.

I am using a 32bit Raspbian OS (version details see below.)

When looking to your system information it looks you are using a 64bit kernel and the toolchain for AARCH64. Could you please try a 32bit RPi OS and 32bit toolchain (arm-linux-gnueabihf) with your RPi to see if the segmentation fault is related to 32 vs 64bit in your case ?

Kernel version: Linux 4.19.75-v7l+ #1270 SMP Tue Sep 24 18:51:41 BST 2019 armv7l GNU/Linux

gcc version: 8.3.0

ldd libSTUHFL.so:

    linux-vdso.so.1 (0xbea07000)

    /usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so => /usr/lib/arm-linux-gnueabihf/libarmmem-v7l.so (0xb6efa000)

    libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0xb6d9c000)

    libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb6d1a000)

    libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb6ced000)

    libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6cc3000)

    libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6b75000)

    /lib/ld-linux-armhf.so.3 (0xb6f3e000)

BR

CDemi.11
Associate

Hello Nick,

I loaded 32-bit image (Linux 5.15.32-v7l+) to the RPi and natively compiled the source files. Now, I am able to run demo applications without any problems. Thank you for your support.

Best regards,