(5)(5.6) Load the firmware onto the board with external flash memory

Article directory

5.5 Alternatives

5.5.1 Download and install Zadig (Windows only)

5.5.2 Download ArduPilot firmware

5.5.3 Upload ArduPilot to the motherboard

5.6 Loading firmware onto board with external flash memory

5.6.1 Load firmware using SSBL

5.6.2 Installing the ArduPilot bootloader


5.5 Alternatives

5.5.1 Download and install Zadig (Windows only)

Download and run  Zadig ( search for " Zadig 2.3 " under " Download " ), allowing USB access to the board.

Select the " List all devices " option from the options menu .

Select " STM32 BOOTLOADER " from the drop-down menu and press the " Replace Driver " button.

Optionally, you may wish to check that the board is visible as a USB port:

  • Press and hold the DFU button on the board , plug in the USB cable (connected to your PC );
  • Open Windows Device Manager and look for " STM32 BOOTLOADER " under " Universal Serial Bus Devices " to confirm that the board is in DFU mode.

5.5.2 Download ArduPilot firmware

Download the ArduPilot firmware  for your board from  firmware.ardupilot.org . Usually you can find suitable firmware by:

  • Open   firmware.ardupilot.org ;
  • Choose to click the link for your aircraft type (such as  Plane , Copter , Rover , Sub  or  Antenna Tracker );
  • Select " Beta " or " Stable ";
  • Find the directory whose name is closest to autopilot ;
  • Download the " arduXXX_with_bl.hex " file, click on it. It will usually be saved in your Downloads folder.

5.5.3 Upload ArduPilot to the motherboard

Download, install and run the Betaflight Configurator ( Betaflight Configurator ).

  • Select " Firmware Flasher " on the left side of the screen;
  • Select DFU from the top right ;
  • Press " Load Firmware [Local] " from the bottom right , and select the arduXXX_with_bl.hex file you downloaded above ;
  • Press " Flash Firmware " and after a few minutes the firmware should be loaded.

You can now reboot the board and connect with your favorite ground station ( Mission Planner , QGC, etc. ), future firmware uploads should also work using the normal method for the Pixhawk board.

5.6 Loading firmware onto board with external flash memory

Some recent boards, most notably those from Seriously Pro Racing ( Seriously Pro Racing - Home ), use an MCU with a small amount of internal flash memory , but a much larger externally connected flash chip. These boards require an extra step to load the ArduPilot firmware. Typically, some sort of bootloader resides on internal flash, and then the main firmware resides on external flash.

5.6.1 Load firmware using SSBL

Boards of the SPRacing series come preloaded with a proprietary bootloader on internal flash memory, requiring a second stage bootloader to load further firmware. There are a few options for loading firmware for these boards, but no matter which one you choose, you'll need to use SSBL to initialize ArduPilot . Please follow the GitHub - spracing/ssbl: Second-Stage Bootloader for the H7 series flight controllers. Allows booting of PX4 or other firmware directly from external flash using memory mapped QuadSPI. "Installation" instructions in order to load the SSBL onto your board . Once the SSBL is loaded, follow the instructions for PX4 to load ArduPilot onto the board GitHub - spracing/ssbl: Second-Stage Bootloader for the H7 series flight controllers. Allows booting of PX4 or other firmware directly from external flash using memory mapped QuadSPI. , But instead of using PX4 firmware, usearducopter.bin firmware image. Here is a summary of the steps:

dd if=/dev/zero ibs=1k count=2048 of=AP_2MB.bin

dd conv=notrunc if=arducopter.bin of=AP_2MB.bin

  • Put the board into SSBL dfu mode -- turn off the power, press and hold BIND (not BOOT ), turn on the power -- LED flashes quickly, release BIND , LED flashes slowly -- DFU mode is enabled;
  • Burn the binary file using the following method;

dfu-util -D AP_2MB.bin -s 0x90100000:0x200000

  • Verify flash. The dfu-util command below copies the contents of the flash memory to the computer, and the diff command will tell you whether the contents are the same or different. If diff doesn't say the files are the same, don't try to fly, try again;

dfu-util -U AP_2MB-VERIFY.bin -s 0x90100000:0x200000

diff -sb AP_2MB.bin AP_2MB-VERIFY.bin

  • Shut down, install SD card (note: you must install SD card, without SD card, the firmware will not start), boot;
  • Configure the board as normal using the mission planner.

At this point, you should have working firmware on the board. If you want to load new firmware, you will need to follow steps 2-7 again (you cannot use Mission Planner to load firmware). If you're sure you'll never want to load betaflight on your board , you can install the ArduPilot bootloader.

5.6.2 Installing the ArduPilot bootloader

Warning

Installing the ArduPilot bootloader is a one-way operation. After this step, you can't restore the board to factory configuration or load betaflight - you have to send the board back to Seriously Pro and re-flash the factory firmware, assuming that's even possible.

If you are sure that you only want to use ArduPilot on the board , flashing the ardupilot bootloader can make subsequent upgrades easier.

  • You must initially have a working version of ArduPilot installed on the board - follow the steps above;
  • You must now remove copy protection from the internal flash memory. This is a destructive operation that requires a complete erase of the flash memory. ArduPilot provides support to make it easy. set  BRD_OPTIONS = 16 ;
  • Turn off the power, and then turn on the power of the board. The board will not appear to boot, but the flash sectors are being erased. Wait a few seconds, then power off the board;
  • Press and hold the start button (do not bind to start this time), power on the flight controller. This will put the board in dfu mode;
  • Download the ArduPilot bootloader, for example: https://github.com/ArduPilot/ardupilot/blob/master/Tools/bootloaders/SPRacingH7_bl.bin ;
  • Install bootloader via dfu :

dfu-util -a 0 --dfuse-address 0x08000000 -D SPRacingH7_bl.bin

  • Reboot the board;
  • Now you can use your favorite tool to upload the ArduPilot firmware.

Guess you like

Origin blog.csdn.net/qq_20016593/article/details/132128448