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

new board support ZeroOne x6 #23623

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open

new board support ZeroOne x6 #23623

wants to merge 22 commits into from

Conversation

ZeroOne-Aero
Copy link
Contributor

Hello, our flight control is based on the V6X standard, and board_types.txt,pixhawk-standards and pab_manifest.c were merged before. Now I copied the px4/fmu-v6x folder and modified it.The firmware I modified is written into our flight control board, and the sensors are all normal. I have the following questions:

  1. Every time I modify the code, I execute make zeroone_x6_bootloader and make zeroone_x6_default, and then connect the debug port of fmu through STLink to write Zeroone_x6_bootloader.bin. Then connect QGC or MP to write zeroone_x6_default.px4 via USB port. Is this process correct?
  2. Is our CONFIG_CDCACM_PRODUCTID 0x15E0 (5600)?
  3. How do I get this value from CONFIG_CDCACM_VENDORID?
  4. Does the bootloader of the flight control board need to be replaced when PX4 firmware and APM firmware are used respectively?
    5, After burning the bootloader, and then downloading the Firmware through the ground station, an ERROR will be reported: firmware not suitable for this board fw: 53-board :101, what is the reason?
    6, the remote control channel can not be identified, what is the problem?
    7, can compile and generate firmware with bootloader?

I have rebased on main and squash my commits into 1.
I have updated pab_manifest.c:
// BASE ID 0x150 ZeroOne Pixhawk Baseboard Alaised to ID 0
{HW_BASE_ID(0x150), base_configuration_0, arraySize(base_configuration_0)}, // ZeroOne Pixhawk Baseboard ver 0x150
Hello, our flight control is based on the V6X standard, and board_types.txt,pixhawk-standards and pab_manifest.c were merged before. Now the firmware I modified is written into our flight control board, and the sensors are all normal. I have the following questions: 1. Every time I modify the code, I execute make zeroone_x6_bootloader and make zeroone_x6_default, and then connect the debug port of fmu through STLink to write Zeroone_x6_bootloader.bin. Then connect QGC or MP to write zeroone_x6_default.px4 via USB port. Is this process correct? 2. Is our CONFIG_CDCACM_PRODUCTID 0x15E0 (5600)? 3. How do I get this value from CONFIG_CDCACM_VENDORID? 4. Does the bootloader of the flight control board need to be replaced when PX4 firmware and APM firmware are used respectively? 5, After burning the bootloader, and then downloading the Firmware through the ground station, an ERROR will be reported: firmware not suitable for this board fw: 53-board :101, what is the reason? 6. the remote control channel can not be identified, what is the problem? 7. Can I compile firmware with bootloader?
@dagar
Copy link
Member

dagar commented Aug 27, 2024

Does the bootloader of the flight control board need to be replaced when PX4 firmware and APM firmware are used respectively

There should be bootloader compatibility in both directions, however we've seen minor problems in the past so if you're comfortable changing the bootloader matching PX4 bootloader + PX4 app won't hurt.

@dagar
Copy link
Member

dagar commented Aug 27, 2024

Can you delete boards/zeroone/x6/extras/px4_fmu-v6x_bootloader.bin?

@dagar dagar changed the title Add a board. new board support ZeroOne x6 Aug 27, 2024
@dagar dagar requested review from davids5 and dagar August 27, 2024 14:59
@@ -0,0 +1,17 @@
CONFIG_MODULES_AIRSPEED_SELECTOR=n
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We carry a lot of extras in px4_fmu-v6x for testing, you can probably delete this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok,I have deleted this file.

@@ -0,0 +1,4 @@
# CONFIG_BOARD_UAVCAN_TIMER_OVERRIDE is not set
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok,I have deleted this file.

@@ -0,0 +1,13 @@
CONFIG_COMMON_DIFFERENTIAL_PRESSURE=n
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete

default.px4board contains both multicopter, fixedwing, and VTOL

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok,I have deleted this file.

############################################################################


set(PX4_FW_NAME ${PX4_BINARY_DIR}/${PX4_BOARD_VENDOR}_${PX4_BOARD_MODEL}_${PX4_BOARD_LABEL}.px4)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete this file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok,I have deleted this file.

@ZeroOne-Aero
Copy link
Contributor Author

1,Is our CONFIG_CDCACM_PRODUCTID 0x15E0 (5600)?
2,How do I get this value from CONFIG_CDCACM_VENDORID?
3,When I finished writing the bootloader and firmware of PX4-AUTOPILOT I compiled, the sensor worked normally, but the ground station could not recognize the channel value of the remote control. What is the reason?
4, Can I compile and generate firmware with bootloader?

@ZeroOne-Aero
Copy link
Contributor Author

@dagar @davids5 Could you please help answer the above questions.

@davids5
Copy link
Member

davids5 commented Aug 29, 2024

1,Is our CONFIG_CDCACM_PRODUCTID 0x15E0 (5600)?
2,How do I get this value from CONFIG_CDCACM_VENDORID?

This is set in the def config of the bootloader and the default

You are currently using Auterion VID and the PID is for V6X.

You need a VID (CONFIG_CDCACM_VENDORID) and CONFIG_CDCACM_PRODUCTI (PID).

Ask @mrpollo for permission to use the dronecode PID and for the VID use 0x15e0. If not you have to buy a VID from USB for $$$$.

Once you sort out the values you will need a PR in QGC @mrpollo can guide you on this,

3,When I finished writing the bootloader and firmware of PX4-AUTOPILOT I compiled, the sensor worked normally, but the ground station could not recognize the channel value of the remote control. What is the reason?

but the ground station could not recognize the channel value of the remote control.

I do not understand, is there USB not connecting?

4, Can I compile and generate firmware with bootloader?

Do you mean one bin file with the bootloader and firmware?

@davids5
Copy link
Member

davids5 commented Aug 29, 2024

Every time I modify the code, I execute make zeroone_x6_bootloader and make zeroone_x6_default, and then connect the debug port of fmu through STLink to write Zeroone_x6_bootloader.bin. Then connect QGC or MP to write zeroone_x6_default.px4 via USB port. Is this process correct?

If you are not making changes to the bootloader files (defconfig, init.c, board.h or nuttx) - you do not need to build the bootloader. but it is good to test it and check in that last working bin in the PR.

In a development mode (faster cycle time) you can load the elf files of the bootloader and default builds with JTAG.

When done with development is is good to load the elf file of the bootloader that you committed. And use QGC and the .px4 (of the default) build.

But this will only work once the PR in QGC is merged and you use a daily build of QGC after the merge.

Until then. Use VID, PID "board_id" of V6X.

"board_id": 53,

bootloader/defconfig
CONFIG_CDCACM_PRODUCTID=0x0035
CONFIG_CDCACM_PRODUCTSTR="PX4 BL FMU v6X.x"
CONFIG_CDCACM_VENDORID=0x3185
CONFIG_CDCACM_VENDORSTR="Auterion"

nsh/defconfig
CONFIG_CDCACM_PRODUCTID=0x0035
CONFIG_CDCACM_PRODUCTSTR="PX4 FMU v6X.x"
CONFIG_CDCACM_VENDORID=0x3185
CONFIG_CDCACM_VENDORSTR="Auterion"

Once the QGC PR is in use

"board_id":  5600,

bootloader/defconfig
CONFIG_CDCACM_PRODUCTID=0x15E0
CONFIG_CDCACM_PRODUCTSTR="ZeroOne BL X6.x"
CONFIG_CDCACM_RXBUFSIZE=600
CONFIG_CDCACM_TXBUFSIZE=12000
CONFIG_CDCACM_VENDORID=0x3185

nsh/defconfig
CONFIG_CDCACM_PRODUCTID=0x15E0
CONFIG_CDCACM_PRODUCTSTR="ZeroOne X6.x"
CONFIG_CDCACM_VENDORID=0x3643 - assuming you get permission from Dronecode to use it or your purchased PID

@davids5
Copy link
Member

davids5 commented Aug 29, 2024

5, After burning the bootloader, and then downloading the Firmware through the ground station, an ERROR will be reported: firmware not suitable for this board fw: 53-board :101, what is the reason?

Bootloader and Firmware need to built with `"board_id": , set to the same value.

Hex 00x35 (decimal 53) which is an Auterion V6X.

If the bootloader is built with board_id of 5600 and the firmware is built with a board_id of 53 you would get that message.

@ZeroOne-Aero
Copy link
Contributor Author

1,Is our CONFIG_CDCACM_PRODUCTID 0x15E0 (5600)?
2,How do I get this value from CONFIG_CDCACM_VENDORID?

This is set in the def config of the bootloader and the default

You are currently using Auterion VID and the PID is for V6X.

You need a VID (CONFIG_CDCACM_VENDORID) and CONFIG_CDCACM_PRODUCTI (PID).

Ask @mrpollo for permission to use the dronecode PID and for the VID use 0x15e0. If not you have to buy a VID from USB for $$$$.

Once you sort out the values you will need a PR in QGC @mrpollo can guide you on this,

3,When I finished writing the bootloader and firmware of PX4-AUTOPILOT I compiled, the sensor worked normally, but the ground station could not recognize the channel value of the remote control. What is the reason?

but the ground station could not recognize the channel value of the remote control.

I do not understand, is there USB not connecting?

4, Can I compile and generate firmware with bootloader?

Do you mean one bin file with the bootloader and firmware?

1、This sentence already exists in board_types.txt :AP_HW_ZeroOne_X6 5600
2、Do I just need to apply for PID?
3、I burned PX4io-v2_bl, PX4_fmu-v6x_bl and stable version of PX4 firmware, QGC shows that the remote control channel is not mapped, what is the reason?

4、Yes, that's what you mean.

@ZeroOne-Aero
Copy link
Contributor Author

Every time I modify the code, I execute make zeroone_x6_bootloader and make zeroone_x6_default, and then connect the debug port of fmu through STLink to write Zeroone_x6_bootloader.bin. Then connect QGC or MP to write zeroone_x6_default.px4 via USB port. Is this process correct?

If you are not making changes to the bootloader files (defconfig, init.c, board.h or nuttx) - you do not need to build the bootloader. but it is good to test it and check in that last working bin in the PR.

In a development mode (faster cycle time) you can load the elf files of the bootloader and default builds with JTAG.

When done with development is is good to load the elf file of the bootloader that you committed. And use QGC and the .px4 (of the default) build.

But this will only work once the PR in QGC is merged and you use a daily build of QGC after the merge.

Until then. Use VID, PID "board_id" of V6X.

"board_id": 53,

bootloader/defconfig
CONFIG_CDCACM_PRODUCTID=0x0035
CONFIG_CDCACM_PRODUCTSTR="PX4 BL FMU v6X.x"
CONFIG_CDCACM_VENDORID=0x3185
CONFIG_CDCACM_VENDORSTR="Auterion"

nsh/defconfig
CONFIG_CDCACM_PRODUCTID=0x0035
CONFIG_CDCACM_PRODUCTSTR="PX4 FMU v6X.x"
CONFIG_CDCACM_VENDORID=0x3185
CONFIG_CDCACM_VENDORSTR="Auterion"

Once the QGC PR is in use

"board_id":  5600,

bootloader/defconfig
CONFIG_CDCACM_PRODUCTID=0x15E0
CONFIG_CDCACM_PRODUCTSTR="ZeroOne BL X6.x"
CONFIG_CDCACM_RXBUFSIZE=600
CONFIG_CDCACM_TXBUFSIZE=12000
CONFIG_CDCACM_VENDORID=0x3185

nsh/defconfig
CONFIG_CDCACM_PRODUCTID=0x15E0
CONFIG_CDCACM_PRODUCTSTR="ZeroOne X6.x"
CONFIG_CDCACM_VENDORID=0x3643 - assuming you get permission from Dronecode to use it or your purchased PID

Ok, for the current testing phase, I will use V6X PID and VID.

@ZeroOne-Aero
Copy link
Contributor Author

5, After burning the bootloader, and then downloading the Firmware through the ground station, an ERROR will be reported: firmware not suitable for this board fw: 53-board :101, what is the reason?

Bootloader and Firmware need to built with `"board_id": , set to the same value.

Hex 00x35 (decimal 53) which is an Auterion V6X.

If the bootloader is built with board_id of 5600 and the firmware is built with a board_id of 53 you would get that message.

@davids5 Ok,thank you very much.Now I do not use the zerooneX6 compiled by myself to write, and I use the bl and firmware compiled by PX4-fmuv6x. After connecting to QGC, I still cannot recognize the channel value of the remote control.Do you know the reason ?

@ZeroOne-Aero
Copy link
Contributor Author

7777
@davids5 @mrpollo After I burned these two files and wrote the stable version of the firmware in QGC, QGC still couldn't get the radio channel value,It says: no manual control input.There is an urgent need to solve this problem. Do you know the reason?

@davids5
Copy link
Member

davids5 commented Aug 30, 2024

@ZeroOne-Aero for HW that has not been programed before, you must JTAG on the booloader for the H7 and for the F3. Use elf files (if you use bin files you need the address)
The H7 one is built in tree (from your PX4 build folder xxx_bootloader.elf). You will need to check out build https://github.com/PX4/PX4-Bootloader and use px4io_bl.elf file from that build.

Once that is done. Load the Firmware (_default.elf) from your PX4 build folder. This firmware will update the px4io firmware.

Once done, with the unit powered from USB the FMU leds indicate boot loading and the console will show PX4IO being updated.

Once you have correctly loaded the FMU and the IO you will have working HW. Now connect the radio receiver and bind it with the remote.

do param show RC_INPUT_PROTO see if it is not set to AUTO - that may be the issue.

@ZeroOne-Aero
Copy link
Contributor Author

ZeroOne-Aero commented Sep 2, 2024

@davids5 @dagar I have modified board_id,board_type and CONFIG_CDCACM_PRODUCTID 5600,
Do I still need to apply for CONFIG CDCACM VENDORID, Can I use CONFIG CDCACM VENDORID for V6x:CONFIG_CDCACM_VENDORID=0x3185?

I have tested zeroone/x6 with board_id,board_type and CONFIG_CDCACM_PRODUCTID of 53, everything is OK; Then modify these values to 5600 on github, could you please help merge them?

Copy link
Member

@davids5 davids5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ZeroOne-Aero Ask @mrpollo for permission to use the DroneCode VID use 0x15e0 for the PID. If not you have to buy a VID from USB for $$$$. You can not use Auterion VID https://the-sz.com/products/usbid/index.php?v=0x3185&p=&n=

@ZeroOne-Aero
Copy link
Contributor Author

@dagar @davids5 @mrpollo I have updated the value of VID in the code, please check it.
About EEPROM, how do I need to modify the code to be compatible with our new resistors of base board?

@davids5
Copy link
Member

davids5 commented Sep 6, 2024

@dagar @davids5 @mrpollo I have updated the value of VID in the code, please check it. About EEPROM, how do I need to modify the code to be compatible with our new resistors of base board?

You did a pr adding the base ID. The Base Id is 0x150.

You can detect the board with if ver hwbasecmp 150 (it is a string)

Here is an eaxmple:

#Start Auterion Power Module selector for Skynode boards
if ver hwbasecmp 009 010 011
then
	pm_selector_auterion start
else
	if [ $INA_CONFIGURED = no ]
	then
		# INA226, INA228, INA238 auto-start
		i2c_launcher start -b 1
		if [ $HAVE_PM2 = yes ]
		then
			i2c_launcher start -b 2
		fi
	fi
fi

Co-authored-by: David Sidrane <David.Sidrane@Nscdg.com>
@davids5 davids5 self-requested a review September 9, 2024 10:32
Copy link
Member

@davids5 davids5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This board need to be added to ci.

see
.ci/Jenkinsfile-compile
.github/workflows/compile_nuttx.yml
.vscode/cmake-variants.yaml

see https://github.com/PX4/PX4-Autopilot/pull/22263/files for an example of hw to add a board

#Start Auterion Power Module selector for zeroone boards
if ver hwbasecmp 150
then
	pm_selector_auterion start
else
	if [ $INA_CONFIGURED = no ]
	then
		# INA226, INA228, INA238 auto-start
		i2c_launcher start -b 1
		if [ $HAVE_PM2 = yes ]
		then
			i2c_launcher start -b 2
		fi
	fi
fi
@ZeroOne-Aero
Copy link
Contributor Author

@dagar @davids5 @mrpollo I have updated the value of VID in the code, please check it. About EEPROM, how do I need to modify the code to be compatible with our new resistors of base board?

You did a pr adding the base ID. The Base Id is 0x150.

You can detect the board with if ver hwbasecmp 150 (it is a string)

Here is an eaxmple:

#Start Auterion Power Module selector for Skynode boards
if ver hwbasecmp 009 010 011
then
	pm_selector_auterion start
else
	if [ $INA_CONFIGURED = no ]
	then
		# INA226, INA228, INA238 auto-start
		i2c_launcher start -b 1
		if [ $HAVE_PM2 = yes ]
		then
			i2c_launcher start -b 2
		fi
	fi
fi

I have modified it, but I don't quite understand the function of this paragraph, please help to check it.

I add:
"zeroone_x6_bootloader",
 "zeroone_x6_default",
 "zeroone_x6_rover",
I add:
zeroone_x6_default:
      short: zeroone_x6
      buildType: MinSizeRel
      settings:
        CONFIG: zeroone_x6_default
    zeroone_x6_bootloader:
      short: zeroone_x6_bootloader
      buildType: MinSizeRel
      settings:
        CONFIG: zeroone_x6_bootloader
@ZeroOne-Aero
Copy link
Contributor Author

This board need to be added to ci.

see .ci/Jenkinsfile-compile .github/workflows/compile_nuttx.yml .vscode/cmake-variants.yaml

see https://github.com/PX4/PX4-Autopilot/pull/22263/files for an example of hw to add a board

I didn't find this file:.github/workflows/compile_nuttx.yml,
微信图片_20240909204123
I have add our board in another two files.

@davids5
Copy link
Member

davids5 commented Sep 10, 2024

This board need to be added to ci.
see .ci/Jenkinsfile-compile .github/workflows/compile_nuttx.yml .vscode/cmake-variants.yaml
see https://github.com/PX4/PX4-Autopilot/pull/22263/files for an example of hw to add a board

I didn't find this file:.github/workflows/compile_nuttx.yml, 微信图片_20240909204123 I have add our board in another two files.

There was a subsequent PR that adds the board automatically. So ignore my comment about adding anything to compile_nuttx.yaml

@davids5
Copy link
Member

davids5 commented Sep 10, 2024

So you do have real CI failures that need to be fixed for example "Multiple newlines at the end of boards/zeroone/x6/init/rc.board_sensors"

image

Please fix any of these CI failures

@ZeroOne-Aero
Copy link
Contributor Author

So you do have real CI failures that need to be fixed for example "Multiple newlines at the end of boards/zeroone/x6/init/rc.board_sensors"

image Please fix any of these CI failures

Ok,I have fixed it.

@davids5
Copy link
Member

davids5 commented Sep 11, 2024

@dagar I think this is OK to come in. Any further work can be done, now that it build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants