px4_userspace_init: Fix NULL dereference for px4_spi_buses in user space

For targets that define the SPI buses via px4_spi_buses_all_hw, a call
to px4_set_spi_buses_from_hw_version() is needed. Otherwise a NULL
de-reference will occur when trying to access px4_spi_buses.

Fixes a system crash in px4_fmu-v5_protected:
up_assert: Assertion failed at file:armv7-m/arm_memfault.c line: 101 task: wq:lp_default
This commit is contained in:
Ville Juven 2022-09-07 10:23:23 +03:00 committed by Beat Küng
parent 88bf1030b5
commit 9c204774f1
1 changed files with 3 additions and 0 deletions

View File

@ -40,6 +40,7 @@
#include <drivers/drv_hrt.h>
#include <lib/parameters/param.h>
#include <px4_platform_common/px4_work_queue/WorkQueueManager.hpp>
#include <px4_platform_common/spi.h>
#include <uORB/uORB.h>
#include <sys/boardctl.h>
@ -49,6 +50,8 @@ extern "C" void px4_userspace_init(void)
{
hrt_init();
px4_set_spi_buses_from_hw_version();
px4::WorkQueueManagerStart();
uorb_start();