Cross Compiling for posix end up with Segmentation fault

Hi everyone,

I’m currently working on porting the px4_raspberrypi_default firmware to a Rockchip RK3588 board. I successfully cross-compiled the code using my own toolchain without any errors.

However, when trying to run the generated binary on the RK3588 board, I encountered a segmentation fault , as shown in the screenshot below:

This may suggests that there be some hardware-specific or platform-related configuration issues that need to be addressed for the code to run properly on the RK3588 platform. Although I’m using a buildroot system instead of a normal Ubuntu one, it seems that the same thing happens when others try to port the code to another non-RPi platform.(see Running PX4 on zynq ultrascale+ - PX4 Autopilot - Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink)

I’m not sure where to start debugging this issue. Has anyone experienced similar problems when porting PX4 to non-RPi platforms? Or could you suggest ways to approach this segmentation fault — for example, how to trace the root cause or what kind of adjustments might be needed in the PX4 source code?

Any help or guidance would be greatly appreciated!

You got yourself a challenge!

Well, first thing I’d do is start it using gdb and get a backtrace, or alternatively use something like coredumpctl debug to get the latest backtrace from coredump.

Thanks for your advice.

I’ve finally figured out the issue — it turns out not to be related to the platform at all, but rather a silly mistake I made when transferring the program to my device.

Since I didn’t have the rsync tool installed on my RK3588 board, I manually copied the executable files from the server to the device using a Windows PC. Unfortunately, this method broke the symbolic links between the “px4-*” files and the main “px4” executable.

The problem was resolved once I switched to using tar for compression and transfer — everything now works perfectly on the RK3588.

This might be an edge case, but I’m sharing it here just in case someone else runs into something similar. Consider this a friendly reminder to always preserve file structure and symbolic links when moving binaries across systems!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.