From a6440c00abbc30230f8a59c737e4ec55cb82a350 Mon Sep 17 00:00:00 2001 From: Sadeep Madurange Date: Mon, 5 Jan 2026 17:39:10 +0800 Subject: Fix Arduino Due post, ol list css. --- _log/arduino-due.md | 70 +++++++++++-------------------- _log/e-reader.md | 9 ++-- _log/neo4j-a-star-search.md | 2 +- _site/assets/css/skeleton.css | 2 + _site/feed.xml | 2 +- _site/index.html | 6 +-- _site/log/arduino-due/index.html | 71 +++++++++++--------------------- _site/log/e-reader/index.html | 11 ++--- _site/log/neo4j-a-star-search/index.html | 4 +- _site/posts.xml | 2 +- _site/projects/index.html | 4 +- assets/css/skeleton.css | 2 + 12 files changed, 73 insertions(+), 112 deletions(-) diff --git a/_log/arduino-due.md b/_log/arduino-due.md index a0bfe4a..e24666c 100644 --- a/_log/arduino-due.md +++ b/_log/arduino-due.md @@ -1,17 +1,24 @@ --- -title: Bare-metal ATSAM3X8E +title: ATSAM3X8E bare-metal notes date: 2024-09-16 layout: post --- -Notes on programming bare-metal ATSAM3X8E chips (Arduino Due) using Serial Wire -Debug (SwD) protocol. +Bypassing ATSAM3X8E (Due) bootloader via Serial Wire Debug (SWD). -## Toolchain +Toolchain: ST-LINK/V2 programmer, OpenOCD, ARM GNU Compiler Toolchain. -ST-LINK/V2 programmer, OpenOCD, ARM GNU Compiler Toolchain. +ARM chips boot into 0x00000. GPNVM bits map one of ROM, flash0, flash1 to +0x00000: -## Electrical connections + - GPNVM1=0 → ROM (default). + - GPNVM1=1 and GPNVM2=0 → flash0. + - GPNVM1=1 and GPNVM2=1 → flash1. + +By default, control jumps to Atmel's SAM-BA bootloader in ROM. To bypass, set +GPNVM1=1 and place vector table at 0x80000 (flash0). + +Connect ST-LINK/v2 to Arduino Due's DEBUG port: @@ -26,22 +33,7 @@ ST-LINK/V2 programmer, OpenOCD, ARM GNU Compiler Toolchain.
-Arduino Due exposes the ATSAM3X8E's SWD interface via its DEBUG port. The -ST-LINK/v2 programmer connects to that to communicate with the chip. - -## Upload procedure - -Build. Magic is in the script.ld linker script. - -``` -$ arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -T script.ld \ - -nostartfiles \ - -nostdlib \ - -o a.elf main.c -``` - - -Upload using OpenOCD: +Remap memory: ``` $ openocd -f openocd-due.cfg @@ -50,35 +42,19 @@ $ telnet localhost 4444 > at91sam3 gpnvm show > at91sam3 gpnvm set 1 > at91sam3 gpnvm show -$ openocd -f openocd-due.cfg -c "program a.elf verify reset exit" ``` -First command starts OpenOCD. Telnet session halts chip, checks GPNVM bit. If -unset (returns 0), set to 1 and verify. Final command uploads program. See -OpenOCD manual AT91SAM3 flash driver section for full command list. +Full command list is in OpenOCD manual AT91SAM3 (flash driver section). -## GPNVM bits +Compile and upload program: -ARM chips boot into address 0x00000. ATSAM3X8E has ROM and dual-banked flash -(flash0/flash1) at different addresses. GPNVM bits control which maps to -0x00000. - -GPNVM1 cleared (default): boots from ROM (Atmel SAM-BA bootloader). GPNVM1=1, -GPNVM2=0: flash0 (0x80000) maps to 0x00000. Both cleared: flash1 maps to -0x00000. - -Program goes in flash0, so set GPNVM1=1 to boot our code instead of bootloader. - -## Linker script notes - -Vector table must be at first flash address--required for ARM chips unless -relocated using VTOR register. - -First vector table entry: stack pointer. Initialize to highest memory location -(ATSAM3X8E has descending stack). - -Second entry: reset vector. Place initialization code here (zero memory, set -registers) before jumping to main(). +``` +$ arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -T script.ld \ + -nostartfiles \ + -nostdlib \ + -o a.elf main.c +$ openocd -f openocd-due.cfg -c "program a.elf verify reset exit" +``` Commit: [3184969](https://git.asciimx.com/bare-metal-arduino-due/commit/?id=318496925ca76668dd9d63c3d060376f489276f8) diff --git a/_log/e-reader.md b/_log/e-reader.md index 87417f7..69b1e96 100644 --- a/_log/e-reader.md +++ b/_log/e-reader.md @@ -1,5 +1,5 @@ --- -title: ESP32 prototype e-reader +title: 512 KB e-reader date: 2023-10-24 layout: post project: true @@ -15,9 +15,10 @@ First project with e-paper displays and ESP32. ESP-WROOM-32, 7.5" Waveshare e-paper display, three-button interface (prev/next/sleep). -Memory: 512KB SRAM + 4MB flash--insufficient for local library. Streams via -HTTP Range requests over WiFi. Reading progress saved to RTC memory; persists -through deep sleep. +Memory: 512KB SRAM + 4MB flash. Internal 4 MB flash unsuitable for storing +books due to P/E cycle limits. HTTP Range requests for on-demand bitmap +streaming. Progress saved to RTC memory to survive deep sleep without flash +wear. EBM format: Raw bitmap sequence. 1 byte = 8 pixels, 1 page = 48 KB (display resolution), headerless. Optimized for HTTP Range requests: diff --git a/_log/neo4j-a-star-search.md b/_log/neo4j-a-star-search.md index fe6f33f..de0ef25 100644 --- a/_log/neo4j-a-star-search.md +++ b/_log/neo4j-a-star-search.md @@ -1,5 +1,5 @@ --- -title: Neo4j shortest path optimization +title: 'Neo4J path traversal: A* optimization' date: 2018-03-06 layout: post --- diff --git a/_site/assets/css/skeleton.css b/_site/assets/css/skeleton.css index 90239a6..87b0050 100644 --- a/_site/assets/css/skeleton.css +++ b/_site/assets/css/skeleton.css @@ -291,6 +291,8 @@ ol ul { li { margin-bottom: 0.6rem; } +ol { + margin-left: 1.8em; } /* Code –––––––––––––––––––––––––––––––––––––––––––––––––– */ diff --git a/_site/feed.xml b/_site/feed.xml index 50fefd9..5d9d93f 100644 --- a/_site/feed.xml +++ b/_site/feed.xml @@ -1 +1 @@ -Jekyll2026-01-05T16:42:22+08:00http://localhost:4000/feed.xmlASCIIMX | LogW. D. Sadeep MadurangeSearch engine (Perl + FastCGI + SA)2026-01-03T00:00:00+08:002026-01-03T00:00:00+08:00http://localhost:4000/log/site-searchW. D. Sadeep MadurangeMatrix Rain: 2025 refactor2025-12-21T00:00:00+08:002025-12-21T00:00:00+08:00http://localhost:4000/log/matrix-digital-rainW. D. Sadeep MadurangeFingerprint door lock (LP)2025-08-18T00:00:00+08:002025-08-18T00:00:00+08:00http://localhost:4000/log/fpm-door-lock-lpW. D. Sadeep MadurangeHigh-side MOSFET switching2025-06-22T00:00:00+08:002025-06-22T00:00:00+08:00http://localhost:4000/log/mosfet-switchesW. D. Sadeep MadurangeATmega328P at 3.3V and 5V2025-06-10T00:00:00+08:002025-06-10T00:00:00+08:00http://localhost:4000/log/arduino-unoW. D. Sadeep MadurangeFingerprint door lock (RF)2025-06-05T00:00:00+08:002025-06-05T00:00:00+08:00http://localhost:4000/log/fpm-door-lock-rfW. D. Sadeep MadurangeBumblebee: browser automation2025-04-02T00:00:00+08:002025-04-02T00:00:00+08:00http://localhost:4000/log/bumblebeeW. D. Sadeep MadurangeBare-metal ATSAM3X8E2024-09-16T00:00:00+08:002024-09-16T00:00:00+08:00http://localhost:4000/log/arduino-dueW. D. Sadeep MadurangeEtlas: e-paper dashboard2024-09-05T00:00:00+08:002024-09-05T00:00:00+08:00http://localhost:4000/log/etlasW. D. Sadeep MadurangeESP32 prototype e-reader2023-10-24T00:00:00+08:002023-10-24T00:00:00+08:00http://localhost:4000/log/e-readerW. D. Sadeep Madurange \ No newline at end of file +Jekyll2026-01-05T18:48:39+08:00http://localhost:4000/feed.xmlASCIIMX | LogW. D. Sadeep MadurangeSearch engine (Perl + FastCGI + SA)2026-01-03T00:00:00+08:002026-01-03T00:00:00+08:00http://localhost:4000/log/site-searchW. D. Sadeep MadurangeMatrix Rain: 2025 refactor2025-12-21T00:00:00+08:002025-12-21T00:00:00+08:00http://localhost:4000/log/matrix-digital-rainW. D. Sadeep MadurangeFingerprint door lock (LP)2025-08-18T00:00:00+08:002025-08-18T00:00:00+08:00http://localhost:4000/log/fpm-door-lock-lpW. D. Sadeep MadurangeHigh-side MOSFET switching2025-06-22T00:00:00+08:002025-06-22T00:00:00+08:00http://localhost:4000/log/mosfet-switchesW. D. Sadeep MadurangeATmega328P at 3.3V and 5V2025-06-10T00:00:00+08:002025-06-10T00:00:00+08:00http://localhost:4000/log/arduino-unoW. D. Sadeep MadurangeFingerprint door lock (RF)2025-06-05T00:00:00+08:002025-06-05T00:00:00+08:00http://localhost:4000/log/fpm-door-lock-rfW. D. Sadeep MadurangeBumblebee: browser automation2025-04-02T00:00:00+08:002025-04-02T00:00:00+08:00http://localhost:4000/log/bumblebeeW. D. Sadeep MadurangeATSAM3X8E bare-metal notes2024-09-16T00:00:00+08:002024-09-16T00:00:00+08:00http://localhost:4000/log/arduino-dueW. D. Sadeep MadurangeEtlas: e-paper dashboard2024-09-05T00:00:00+08:002024-09-05T00:00:00+08:00http://localhost:4000/log/etlasW. D. Sadeep Madurange512 KB e-reader2023-10-24T00:00:00+08:002023-10-24T00:00:00+08:00http://localhost:4000/log/e-readerW. D. Sadeep Madurange \ No newline at end of file diff --git a/_site/index.html b/_site/index.html index cce84be..5b62029 100644 --- a/_site/index.html +++ b/_site/index.html @@ -149,7 +149,7 @@ - Bare-metal ATSAM3X8E + ATSAM3X8E bare-metal notes @@ -175,7 +175,7 @@ - ESP32 prototype e-reader + 512 KB e-reader