So from your source tree run libraries/AP_HAL_ChibiOS/hwdef/scripts/convert_betaflight_unified.py on the config and that will give you a reasonable starting point for the hwdef
Awesome. Thank you.
Just so Iām clear, by Betaflight configuration you are referring to the results of āsave backupā from the configurator?
I donāt have to choose a specific branch within Ardupilot because the BF configuration contains enough info?
Just so Iām clear, by Betaflight configuration you are referring to the results of āsave backupā from the configurator?
No there is not enough info in the dump - you need an actual unified config of this kind - GitHub - betaflight/unified-targets: Target configurations for Betaflight Unified Targets - I couldnāt see the config in there, but maybe I didnāt look hard enough
I donāt have to choose a specific branch within Ardupilot because the BF configuration contains enough info?
Use the master branch
Ok. Iāll work on this tomorrow and report back. Thanks again for all your help and guidance.
I ran the instsall prereqs but still get the same error about arm-none-eabi-ar when I run:
./waf configure --board CubeBlack
Update: It works after a linux restart
I get this error when I try to convert the Betaflight config. BTW I donāt know what āboard IDā is that Iām prompted for so I entered the BF config filename.
wam@wam-ROG-Strix-G533ZW-G533ZW:~/ardupilot$ libraries/AP_HAL_ChibiOS/hwdef/scripts/convert_betaflight_unified.py BEFH-BETAFPVF405.config Board id? BEFH-BETAFPVF405.config define: USE_ACC define: USE_ACC_SPI_MPU6000 define: USE_GYRO define: USE_GYRO_SPI_MPU6000 define: USE_GYRO_SPI_ICM42688P define: USE_ACC_SPI_ICM42688P define: USE_ACCGYRO_BMI270 define: USE_BARO define: USE_BARO_SPI_BMP280 define: USE_FLASH define: USE_FLASH_W25Q128FV define: USE_MAX7456 resource: 1 PB4 BEEPER BEEPER resource: 1 PB0 MOTOR MOTOR resource: 2 PB1 MOTOR MOTOR resource: 3 PA3 MOTOR MOTOR resource: 4 PA2 MOTOR MOTOR resource: 5 PC8 MOTOR MOTOR resource: 6 PA8 MOTOR MOTOR resource: 1 PB8 PPM PPM resource: 1 PC9 SONAR SONAR_TRIGGER resource: 1 PA8 SONAR SONAR_ECHO resource: 1 PB6 LED LED_STRIP resource: 1 PA9 SERIAL SERIAL_TX resource: 3 PB10 SERIAL SERIAL_TX resource: 4 PA0 SERIAL SERIAL_TX resource: 6 PC6 SERIAL SERIAL_TX resource: 1 PA10 SERIAL SERIAL_RX resource: 3 PB11 SERIAL SERIAL_RX resource: 4 PA1 SERIAL SERIAL_RX resource: 5 PD2 SERIAL SERIAL_RX resource: 6 PC7 SERIAL SERIAL_RX resource: 3 PC9 INVERTER INVERTER resource: 6 PC8 INVERTER INVERTER resource: 1 PB5 LED LED resource: 1 PA5 SPI SPI_SCK resource: 2 PB13 SPI SPI_SCK resource: 3 PC10 SPI SPI_SCK resource: 1 PA6 SPI SPI_MISO resource: 2 PB14 SPI SPI_MISO resource: 3 PC11 SPI SPI_MISO resource: 1 PA7 SPI SPI_MOSI resource: 2 PB15 SPI SPI_MOSI resource: 3 PC12 SPI SPI_MOSI resource: 1 PB8 ESCSERIAL ESCSERIAL resource: 1 PC2 ADC ADC_BATT resource: 1 PC0 ADC ADC_RSSI resource: 1 PC1 ADC ADC_CURR resource: 1 PB3 BARO BARO_CS resource: 1 PB12 SDCARD SDCARD_CS resource: 1 PB7 SDCARD SDCARD_DETECT resource: 1 PB12 FLASH FLASH_CS resource: 1 PA15 OSD OSD_CS resource: 1 PC4 GYRO GYRO_EXTI resource: 1 PA4 GYRO GYRO_CS resource: 1 PC5 USB USB_DETECT timer: PB8 TIM10 CH1 timer: PC8 TIM8 CH3 timer: PB0 TIM3 CH3 timer: PB1 TIM3 CH4 timer: PA3 TIM2 CH4 timer: PA2 TIM2 CH3 timer: PB6 TIM4 CH1 timer: PA8 TIM1 CH1 timer: PA9 TIM1 CH2 timer: PA10 TIM1 CH3 feature: RX_SERIAL feature: AIRMODE feature: LED_STRIP feature: OSD settings: mag_bustype I2C settings: mag_i2c_device 2 settings: mag_hardware NONE settings: baro_spi_device 3 settings: baro_hardware NONE settings: serialrx_provider SBUS settings: adc_device 2 settings: blackbox_device SPIFLASH settings: dshot_idle_value 450 settings: dshot_burst ON settings: motor_pwm_protocol DSHOT600 settings: motor_poles 12 settings: current_meter ADC settings: battery_meter ADC settings: beeper_inversion ON settings: beeper_od OFF settings: yaw_motors_reversed ON settings: sdcard_detect_inverted ON settings: sdcard_mode SPI settings: sdcard_spi_bus 2 settings: system_hse_mhz 8 settings: vtx_band 5 settings: vtx_channel 8 settings: vtx_power 1 settings: vtx_freq 5917 settings: max7456_spi_bus 3 settings: dashboard_i2c_bus 2 settings: flash_spi_bus 2 settings: gyro_1_bustype SPI settings: gyro_1_spibus 1 settings: gyro_1_sensor_align CW270 settings: gyro_1_align_yaw 2700 settings: gyro_2_spibus 1 Traceback (most recent call last): File "/home/wam/ardupilot/libraries/AP_HAL_ChibiOS/hwdef/scripts/convert_betaflight_unified.py", line 500, in <module> convert_file(fname, board_id) File "/home/wam/ardupilot/libraries/AP_HAL_ChibiOS/hwdef/scripts/convert_betaflight_unified.py", line 319, in convert_file ''' % (get_ADC1_chan(mcu, adc[1]), int(settings['ibata_scale']) * 59.5 / 168 )) # scale taken from KakuteH7 KeyError: 'ibata_scale'
board id is a number that the bootloader protocol uses unique to each board - just pick one for now, e.g. 1200
looks like the battery info is missing from the config - try adding a fake one from another board
Thank you for that.
That completed without any error messages but I donāt see a folder under Build like when I built the example?
you still have some work to do - you should end up with hwdef.dat and hwdef-bl.dat in the current directory. You then need to create a directory in libraries/AP_HAL_ChibiOS/hwdef with an appropriate name and copy them there. Then try building using that name
Ok, now I have a folder with the name I gave the board (BetaFPV-F405AIO) that contains a bin folder with arducopter.apj and arducopter.bin. Those are my targets right? Did it also build the _bl version?
You will need to build the bootloader to get that. Run ./Tools/scripts/build_bootloaders.py BetaFPV-F405AIO to get that
Awesome thanks so much for all of your help.
What should I look for (other than obvious error messages etc) when I load the firmware into the board?
I loaded the hex file with the STM32Cube programmer. The board shows up as Ardupilot on USB as COM4, but mission planner is unable to connect - no heartbeat packets
https://ardupilot.org/dev/docs/porting.html
youāll probably need to try removing stuff until you can get something that boots. I recommend you use mavproxy for connecting since then you can see any debug messages
This slightly presupposes that the config you used is the right one - if its the wrong one with the wrong pin definitions then that would also cause this kind of problem
I let Betaflight auto-detect the board and then selected that as the base.
Should I have reset the environment (clean dist) after the first build but before the _BL version?
Not sure. If you build the bootloader you will then need to reconfigure and rebuild for the regular firmware
I suggest you start putting your changes up as a PR so that we can see what you have so far
Ok.i will read about how to do that later today or tomorrow.