From dd72be0eebb3cd8997cf4246c25004e009882cdc Mon Sep 17 00:00:00 2001 From: Peter Hinch Date: Tue, 14 Jul 2020 16:11:30 +0100 Subject: [PATCH] Add note on Flash to Pyboard D section. --- README.md | 4 +++- pyboard_d/README.md | 23 +++++++++++++++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6d03a14..b89cfdd 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,9 @@ comments in [the test script](./soft_wdt/swdt_tests.py). ## 4.4 Reverse -Fast [reverse](./reverse/reverse.py) a bytearray in Arm Thumb assembler. +Fast [reverse](./reverse/reverse.py) a bytearray in Arm Thumb assembler: this +reverses the byte order of the array so `[1,2,3,4]` becomes `[4,3,2,1]`. + Also includes cross-platform Python code to bit-reverse (fast-ish) 8, 16 and 32 bit words. diff --git a/pyboard_d/README.md b/pyboard_d/README.md index 3b3de65..213eccf 100644 --- a/pyboard_d/README.md +++ b/pyboard_d/README.md @@ -52,11 +52,26 @@ wl.config(antenna=value) # 0 internal 1 external wl.config(txpower=value) # In dbm ``` -## Variants +## Flash memory -I am aware of two variants distinguished by the sticker on top of the CPU. - 1. SF2W (blue). This has about 178K of free RAM and 2MB of Flash. - 2. SF6W (red). This has 432K of free RAM. Also has 2MB Flash. +The SF2W and SF3W have 512KiB of internal flash, the SF6W has 2048KiB. All +have two external 2048KiB flash chips, one for the filesystem and the other for +executable code (it can be memory mapped). On SF2W and SF3W, if you freeze a +lot of code the firmware can become too big for the internal flash. To put +frozen code in external flash, edit the file +`ports/stm32/boards/PYBD_SF2/f722_qspi.ld` (or the corresponding one for +`PYBD_SF3` to add the line `*frozen_content.o(.text* .rodata*)`: +``` + .text_ext : + { + . = ALIGN(4); + *frozen_content.o(.text* .rodata*) + *lib/btstack/*(.text* .rodata*) + *lib/mbedtls/*(.text* .rodata*) + . = ALIGN(512); + *(.big_const*) + +``` ## Bootloader