> For the complete documentation index, see [llms.txt](https://docs.sky-drones.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sky-drones.com/avionics/legacy-autopilots/flashing-bootloader.md).

# Flashing Bootloader

## Tools Required

Manufactured boards come WITHOUT bootloader pre-installed. You can easily flash them yourself. The tools needed include:

* ST-Link v2 ARM JTAG Debugger
* ARM JTAG Mini connector 1.25 mm pitch

## Connections

ST Link debugger looks something like this:

![](https://449459530-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTMlWysgDtJq8Hid1v7%2F-MTPl4DQGq5TdbhbI5lr%2F-MTPndCremvt6l7Ym9ez%2Fst-link.jpg?alt=media\&token=d9cf03de-bab9-4626-ae96-422d4b0e0338)

You will need to connect the ST-Link pins to your SmartAP Pins.

The reference for ST Link pins:

![](https://449459530-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTMlWysgDtJq8Hid1v7%2F-MTPl4DQGq5TdbhbI5lr%2F-MTPndClPJbg6ABNxanb%2Fst-link-pinout.jpg?alt=media\&token=533bf233-a170-4ff7-ae66-d8570a3e13f3)

The reference for SmartAP JTAG pins (view from top):

![](https://449459530-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTMlWysgDtJq8Hid1v7%2F-MTPl4DQGq5TdbhbI5lr%2F-MTPndCk1N6s3OHpO4Xe%2Fsmartap-max-jtag.png?alt=media\&token=aa29824f-a6a1-435c-9a03-50388160e8c3)

Your connection should look like the below:

![](https://449459530-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTMlWysgDtJq8Hid1v7%2F-MTPl4DQGq5TdbhbI5lr%2F-MTPndCmJs8nVu_YqoCS%2Fst-link-smartap.jpg?alt=media\&token=e8636ca7-85e3-45f5-8fc6-c0444237fc01)

Your autopilot and ST Link debugger should be powered via USB only.

## Flashing

Open STM ST Link Utility and then go to `Target` > `Program and Verify`:

![](https://449459530-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTMlWysgDtJq8Hid1v7%2F-MTPl4DQGq5TdbhbI5lr%2F-MTPndCqFIPzDUvraVHW%2Fst-link-utility-main.png?alt=media\&token=09f69f04-ccfd-4a41-a845-580e1440b8cc)

Select the bootloader file to flash:

![](https://449459530-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTMlWysgDtJq8Hid1v7%2F-MTPl4DQGq5TdbhbI5lr%2F-MTPndCo9s00eUjMgi14%2Fst-link-utility-file.png?alt=media\&token=847e7e35-7214-4200-9818-a56e92d6e4d5)

Finally, press `Start`

![](https://449459530-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTMlWysgDtJq8Hid1v7%2F-MTPl4DQGq5TdbhbI5lr%2F-MTPndCpp0a2Im98-sPt%2Fst-link-utility-flash.png?alt=media\&token=f10ee6c7-764b-4e91-807b-d30b4572fc02)

Once completed you'll see the following:

![](https://449459530-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MTMlWysgDtJq8Hid1v7%2F-MTPl4DQGq5TdbhbI5lr%2F-MTPndCno7PbMxymX4Nd%2Fst-link-utility-done.png?alt=media\&token=8850ccfc-f8ae-4caa-aef5-d47ebdac8196)

If you now see the board LEDs flashing, congratulations! Bootloader has been successfully flashed! Now you're able to install the firmware.
