mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
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:
@@ -40,6 +40,7 @@
|
|||||||
#include <drivers/drv_hrt.h>
|
#include <drivers/drv_hrt.h>
|
||||||
#include <lib/parameters/param.h>
|
#include <lib/parameters/param.h>
|
||||||
#include <px4_platform_common/px4_work_queue/WorkQueueManager.hpp>
|
#include <px4_platform_common/px4_work_queue/WorkQueueManager.hpp>
|
||||||
|
#include <px4_platform_common/spi.h>
|
||||||
#include <uORB/uORB.h>
|
#include <uORB/uORB.h>
|
||||||
#include <sys/boardctl.h>
|
#include <sys/boardctl.h>
|
||||||
|
|
||||||
@@ -49,6 +50,8 @@ extern "C" void px4_userspace_init(void)
|
|||||||
{
|
{
|
||||||
hrt_init();
|
hrt_init();
|
||||||
|
|
||||||
|
px4_set_spi_buses_from_hw_version();
|
||||||
|
|
||||||
px4::WorkQueueManagerStart();
|
px4::WorkQueueManagerStart();
|
||||||
|
|
||||||
uorb_start();
|
uorb_start();
|
||||||
|
|||||||
Reference in New Issue
Block a user