Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.14 backport - Pr ver px4io check backport #22527

Merged
merged 2 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 22 additions & 20 deletions ROMFS/px4fmu_common/init.d/rcS
Original file line number Diff line number Diff line change
Expand Up @@ -266,37 +266,39 @@ else
. $FCONFIG
fi

# Check if PX4IO present and update firmware if needed.
if [ -f $IOFW ]
if px4io supported
then
if ! px4io checkcrc ${IOFW}
# Check if PX4IO present and update firmware if needed.
if [ -f $IOFW ]
then
# tune Program PX4IO
tune_control play -t 16 # tune 16 = PROG_PX4IO

if px4io update ${IOFW}
if ! px4io checkcrc ${IOFW}
then
usleep 10000
tune_control stop
if px4io checkcrc ${IOFW}
# tune Program PX4IO
tune_control play -t 16 # tune 16 = PROG_PX4IO

if px4io update ${IOFW}
then
tune_control play -t 17 # tune 17 = PROG_PX4IO_OK
usleep 10000
tune_control stop
if px4io checkcrc ${IOFW}
then
tune_control play -t 17 # tune 17 = PROG_PX4IO_OK
else
tune_control play -t 18 # tune 18 = PROG_PX4IO_ERR
fi
else
tune_control play -t 18 # tune 18 = PROG_PX4IO_ERR
tune_control stop
fi
else
tune_control stop
fi
fi

if ! px4io start
then
echo "PX4IO start failed"
set STARTUP_TUNE 2 # tune 2 = ERROR_TUNE
if ! px4io start
then
echo "PX4IO start failed"
set STARTUP_TUNE 2 # tune 2 = ERROR_TUNE
fi
fi
fi


#
# RC update (map raw RC input to calibrate manual control)
# start before commander
Expand Down
6 changes: 5 additions & 1 deletion src/drivers/px4io/px4io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1556,6 +1556,10 @@ int PX4IO::custom_command(int argc, char *argv[])
{
const char *verb = argv[0];

if (!strcmp(verb, "supported")) {
return 0;
}

if (!strcmp(verb, "checkcrc")) {
if (is_running()) {
PX4_ERR("io must be stopped");
Expand Down Expand Up @@ -1761,7 +1765,7 @@ Output driver communicating with the IO co-processor.
extern "C" __EXPORT int px4io_main(int argc, char *argv[])
{
if (!PX4_MFT_HW_SUPPORTED(PX4_MFT_PX4IO)) {
PX4_ERR("PX4IO Not Supported");
PX4_INFO("PX4IO Not Supported");
return -1;
}
return PX4IO::main(argc, argv);
Expand Down
Loading