diff options
Diffstat (limited to '_site/log/arduino-due/index.html')
| -rw-r--r-- | _site/log/arduino-due/index.html | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/_site/log/arduino-due/index.html b/_site/log/arduino-due/index.html index a2135cb..970136d 100644 --- a/_site/log/arduino-due/index.html +++ b/_site/log/arduino-due/index.html @@ -1,9 +1,5 @@ <!DOCTYPE html> <html> - <head> - <meta charset="utf-8"> - <title>ATSAM3X8E bare-metal programming</title> - <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> @@ -13,8 +9,6 @@ </head> - - </head> <body> <div id="nav-container" class="container"> @@ -47,27 +41,17 @@ <div class="container"> <div class="container-2"> <h2 class="center" id="title">ATSAM3X8E BARE-METAL PROGRAMMING</h2> - <h6 class="center">16 SEPTEMBER 2024</h5> + <h5 class="center">16 SEPTEMBER 2024</h5> <br> - <div class="twocol justify"><p>Notes on programming ATSAM3X8E chips (Arduino Due) without bootloader. Tested -on OpenBSD.</p> + <div class="twocol justify"><p>Notes on programming bare-metal ATSAM3X8E chips (Arduino Due) using Serial Wire +Debug (SwD) protocol.</p> <h2 id="toolchain">Toolchain</h2> -<p>Need to bypass embedded bootloader—requires hardware programmer that speaks -Serial Wire Debug (SWD). ST-LINK/V2 works as SWD-USB adapter.</p> - -<p>OpenOCD translates commands to binary sequences the chip understands. Runs -telnet server on startup for issuing commands.</p> - -<p>ARM GNU Compiler Toolchain for compiling C programs. Both OpenOCD and ARM -toolchain available on OpenBSD.</p> +<p>ST-LINK/V2 programmer, OpenOCD, ARM GNU Compiler Toolchain.</p> <h2 id="electrical-connections">Electrical connections</h2> -<p>Arduino Due exposes ATSAM3X8E’s SWD interface via DEBUG port. ST-LINK/V2 -connects there.</p> - <table style="border: none; width: 100%;"> <tr style="border: none;"> <td style="border: none; width: 50%; vertical-align: top; background-color: transparent;"> @@ -86,8 +70,7 @@ ST-LINK/v2 programmer connects to that to communicate with the chip.</p> <h2 id="upload-procedure">Upload procedure</h2> -<p>Sample LED blink program with OpenOCD config and linker scripts in tarball -below.</p> +<p>Build. Magic is in the script.ld linker script.</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -T script.ld \ -nostartfiles \ @@ -95,7 +78,7 @@ below.</p> -o a.elf main.c </code></pre></div></div> -<p>Upload:</p> +<p>Upload using OpenOCD:</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>$ openocd -f openocd-due.cfg $ telnet localhost 4444 @@ -124,8 +107,8 @@ GPNVM2=0: flash0 (0x80000) maps to 0x00000. Both cleared: flash1 maps to <h2 id="linker-script-notes">Linker script notes</h2> -<p>Vector table must be at first flash address–mandatory for ARM chips unless -using VTOR register for relocation.</p> +<p>Vector table must be at first flash address–required for ARM chips unless +relocated using VTOR register.</p> <p>First vector table entry: stack pointer. Initialize to highest memory location (ATSAM3X8E has descending stack).</p> |
