Skip to content

Conversation

Hannes7eicher
Copy link
Contributor

What This PR Changes

  • This PR is for a tutorial based on a forum post by Per giving instructions on how to burn the bootloader on non-AVR boards.

Contribution Guidelines

This PR summarizes an forum post by Per giving instructions on how to burn the bootloader on non-AVR boards.
@gatsby-cloud
Copy link

gatsby-cloud bot commented Dec 21, 2022

✅ docs-content deploy preview ready

@karlsoderby karlsoderby changed the title Bootloader reloading (non-AVR boards) tutorial [MKC-761] Bootloader reloading (non-AVR boards) tutorial Dec 21, 2022
@karlsoderby karlsoderby self-requested a review December 21, 2022 15:18
Copy link
Contributor

@karlsoderby karlsoderby left a comment

Choose a reason for hiding this comment

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

Hey @Hannes7eicher , there's a lot of formatting errors in this article, and some other minor things that needs to be addressed (btw preview is here: https://docscontent-hannes7eicherbootloaderreloadi.gatsbyjs.io/tutorials/generic/bootloader-reloading)

  • Several H1 titles used (single hashtag). We never use them because in an article, there's only one (the title of the article). Instead, use a simple structure of H2s and H3s (## and ###).
  • I think "Step 1" and "Step 2" doesn't fit well in an article style. They should be named something like "Requirements" and "Instructions".
  • The step by step is all rendered as a paragraph. They need to be bullet points to work.
  • Code snippets are not closed, because the backticks needs to be placed on a new line.
  • There is a couple of first person used. Example: "..so I recommend against this option..". Let's not use "I". Would be better to use "..so it is recommend to not use this option..".

@karlsoderby
Copy link
Contributor

karlsoderby commented Jan 3, 2023

Hi @per1234, this is a tutorial based on this forum post about unbricking Nano 33 IoT that you wrote some time back.

We were asked to make it into a tutorial as it may aid people with the same issues. It should be more or less your instructions, polished and fit into a docs article format.

Can you take a look and see if there are anything you would change? Thank you.

Edit: here is the preview: https://docscontent-hannes7eicherbootloaderreloadi.gatsbyjs.io/tutorials/generic/bootloader-reloading

Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

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

In addition to the specific items I pointed out, I think you should consider an easier alternative approach that was added to the library since the time of the forum post you used as a reference.

The Adafruit_DAP library now provides an example sketch that has the bootloader binary built in to the sketch, which eliminates the need to download the binary and use an SD card, significantly simplifying the required hardware and the instructions.

I'll share my instructions for that method:

1. Select **Sketch > Include Library > Manage Libraries...** from the Arduino IDE menus.
1. Wait for any index updates to finish.
1. In the **"Filter your search..."** field, type `Adafruit DAP library`
1. Press **<kbd>Enter</kbd>**.
1. Click on "**Adafruit DAP library by Adafruit**".
1. Click the **<kbd>Install</kbd>** button.
1. Wait for the installation to finish.
1. Close **Library Manager**.
1. Select **File > Examples > Adafruit DAP library > samd21 > flash_MKR_bootloaders** from the Arduino IDE menus. <br />
   (despite the "MKR" in the sketch name, this also supports the [**Nano 33 IoT**](https://store.arduino.cc/products/arduino-nano-33-iot))
1. Select your **programmer** Arduino board from Arduino IDE's **Tools > Board** menu.
1. Select the port of the **programmer** Arduino board from Arduino IDE's **Tools > Port** menu.
1. Select **Sketch > Upload** from the Arduino IDE menus.
1. Wait for the upload to finish successfully.
1. Unplug the **programmer** Arduino board from your computer.
1. Connect the **programmer** Arduino board to the **target** Arduino board as follows:
   | Programmer | Target |
   | ---------- | ------ |
   | VCC        | +3V3   |
   | 1          | SWDIO  |
   | 2          | SWCLK  |
   | GND        | GND    |
   | 0          | RESETN |

   **SWD pads on MKR boards other than MKR 1000:** <br />
   ![MKR SWD](assets/SWDpadsMKR1000.png) <br />
   **MKR 1000 SWD header pinout:** <br />
   ![MKR 1000 SWD](assets/SWDMKR1000header.png) <br />
   **Nano 33 IoT SWD pads:** <br />
   ![Nano 33 IoT SWD](assets/SWDpadsNano33IoT.png) <br />
1. Plug the USB cable of the **programmer** Arduino board into your computer.
1. Select **Tools > Serial Monitor** from the Arduino IDE menus.
1. Select "No line ending" from the dropdown menu near the bottom right corner of the **Serial Monitor** window.
1. You should see some instructions for using the sketch in the **Serial Monitor** output field. <br />
   This includes a menu of the boards supported by the sketch:
   ```text
   [...]

   Select Arduino MKR board to erase and flash with bootloader:
   
   Z     -> Arduino Zero (6504 bytes)
   MZ    -> Arduino MKR Zero (6408 bytes)
   1000  -> Arduino MKR 1000 WIFI (6408 bytes)
   1010  -> Arduino MKR WIFI 1010 (7984 bytes)

   [...]
   ```
   Find your **target** Arduino board on the list and note the code written to the left of it.
1. Type the code for the **target** Arduino board in the message field of **Serial Monitor**.
1. Press the <kbd>**Enter**</kbd> key.
1. The Serial Monitor output field should now show the board you selected and the progress of flashing the bootloader to the **target** Arduino board.
   Wait for it to show "Done!"
1. Unplug the **programmer** Arduino board from your computer.
1. Disconnect the **programmer** Arduino board from the **target** Arduino board.

@Hannes7eicher Hannes7eicher deleted the Hannes7eicher/bootloader-reloading branch January 12, 2023 13:51
@Hannes7eicher Hannes7eicher restored the Hannes7eicher/bootloader-reloading branch January 12, 2023 13:55
@Hannes7eicher Hannes7eicher reopened this Jan 12, 2023
Hannes7eicher and others added 10 commits January 12, 2023 15:48
…ading.md

Co-authored-by: per1234 <accounts@perglass.com>
…ading.md

Co-authored-by: per1234 <accounts@perglass.com>
…ading.md

Co-authored-by: per1234 <accounts@perglass.com>
…ading.md

Co-authored-by: per1234 <accounts@perglass.com>
…ading.md

Co-authored-by: per1234 <accounts@perglass.com>
…ading.md

Co-authored-by: per1234 <accounts@perglass.com>
…ading.md

Co-authored-by: per1234 <accounts@perglass.com>
…ading.md

Co-authored-by: per1234 <accounts@perglass.com>
Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

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

It seems 5961cd8 was intended to add a tutorial for the approach that doesn't require the use of the SD card, as I shared at #738 (review). However, both files have instructions for the approach that uses the SD card.

If you are creating tutorials for both approaches, I think it would be good to cross-link them with an explanation of they reason why one one would be chosen over the other:

  • The tutorial that uses the SD card should be used when the user wants to flash a different bootloader than the ones Adafruit bundled with the "flash_MKR_bootloaders" example.
  • The tutorial that does not use an SD card should be used by users who want the easiest solution.

Instead of splitting the sd card & non-sd card approach into different files, I've put them together.
@Hannes7eicher Hannes7eicher requested a review from per1234 January 13, 2023 14:48
Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

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

I wonder if it would be better to swap the order of the two tutorials so the preferred approach is first, with the more difficult approach that is only superior for rare advanced use cases is second?

Hannes7eicher and others added 7 commits January 16, 2023 11:56
…ading.md

Co-authored-by: per1234 <accounts@perglass.com>
…ading.md

Co-authored-by: per1234 <accounts@perglass.com>
…ading.md

Co-authored-by: per1234 <accounts@perglass.com>
…ading.md

Co-authored-by: per1234 <accounts@perglass.com>
…ading.md

Co-authored-by: per1234 <accounts@perglass.com>
…ading.md

Co-authored-by: per1234 <accounts@perglass.com>
@Hannes7eicher Hannes7eicher requested a review from per1234 January 16, 2023 12:56
Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

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

Looks great. Thanks @Hannes7eicher!

@Hannes7eicher Hannes7eicher merged commit 0d8fa52 into main Jan 17, 2023
@Hannes7eicher Hannes7eicher deleted the Hannes7eicher/bootloader-reloading branch January 17, 2023 08:50
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