diff --git a/README.md b/README.md index e633da2..24a831a 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ The default target is a generic STM32F103 dev board with an LED on PC13, commonl To build other targets, you can override the `TARGET` variable when invoking `make`. + cd src/ make clean make TARGET=STLINK @@ -26,14 +27,14 @@ To build other targets, you can override the For the above targets there are some potential variants that can be added to the target name based on what the target supports: -| Target Variant | Description | -| -------------- | ----------------------------------------------------- | -|` ` | Standard bootloader, using first 8kB of flash | -|`_HIGH` | High memory bootloader for 64kB chips (experimental) | -|`_HIGH_128` | High memory bootloader for 128kB chips (experimental) | -|`_HIGH_256` | High memory bootloader for 256kB chips (experimental) | +| Target Variant | Description | +| -------------- | ------------------------------------------------------- | +|` ` | Standard bootloader, using first 8 KiB of flash | +|`_HIGH` | High memory bootloader for 64 KiB chips (experimental) | +|`_HIGH_128` | High memory bootloader for 128 KiB chips (experimental) | +|`_HIGH_256` | High memory bootloader for 256 KiB chips (experimental) | -The high memory bootloader is a variation that doesn't require the application to be at an offset, the bootloader resides in the top 6.5kB of ROM and hides its reset and stack vectors inside unused entries of the application vector table. As an example, to compile for a Bluepill board with 128kB flash, use: +The high memory bootloader is a variation that doesn't require the application to be at an offset, the bootloader resides in the top 7 KiB of ROM and hides its reset and stack vectors inside unused entries of the application vector table. As an example, to compile for a Bluepill board with 128 KiB flash, use: make clean make TARGET=BLUEPILL_HIGH_128 @@ -64,7 +65,7 @@ You can also use the env variable `DEFS` to override default configuration for a ### Building for the bootloader The standard bootloader occupies the lower 8KiB of flash, so your application must offset its flash contents by 8KiB. This can be done by modifying your linker script or flags as appropriate. -The high memory bootloaders do not use the lower part of the flash, so you only need to make sure your application leaves 6.5kB of flash free. +The high memory bootloaders do not use the lower part of the flash, so you only need to make sure your application leaves 7 KiB of flash free. ### Switching to the bootloader diff --git a/src/stm32f103/stm32f103x8_high.ld b/src/stm32f103/stm32f103x8_high.ld index 25fda4e..9e9c124 100644 --- a/src/stm32f103/stm32f103x8_high.ld +++ b/src/stm32f103/stm32f103x8_high.ld @@ -23,7 +23,7 @@ MEMORY { vectors (rx) : ORIGIN = 0x08000000, LENGTH = 0x150 - rom (rx) : ORIGIN = 0x0800e600, LENGTH = 0x1A00 + rom (rx) : ORIGIN = 0x0800E400, LENGTH = 0x1C00 ram (rwx) : ORIGIN = 0x20000000, LENGTH = 20K } diff --git a/src/stm32f103/stm32f103xb_high.ld b/src/stm32f103/stm32f103xb_high.ld index 59d048d..df2a646 100644 --- a/src/stm32f103/stm32f103xb_high.ld +++ b/src/stm32f103/stm32f103xb_high.ld @@ -23,7 +23,7 @@ MEMORY { vectors (rx) : ORIGIN = 0x08000000, LENGTH = 0x150 - rom (rx) : ORIGIN = 0x0801e600, LENGTH = 0x1A00 + rom (rx) : ORIGIN = 0x0801E400, LENGTH = 0x1C00 ram (rwx) : ORIGIN = 0x20000000, LENGTH = 20K } diff --git a/src/stm32f103/stm32f103xc_high.ld b/src/stm32f103/stm32f103xc_high.ld index 7ca33f4..5c3ed66 100644 --- a/src/stm32f103/stm32f103xc_high.ld +++ b/src/stm32f103/stm32f103xc_high.ld @@ -23,7 +23,7 @@ MEMORY { vectors (rx) : ORIGIN = 0x08000000, LENGTH = 0x150 - rom (rx) : ORIGIN = 0x0803e600, LENGTH = 0x1A00 + rom (rx) : ORIGIN = 0x0803E400, LENGTH = 0x1C00 ram (rwx) : ORIGIN = 0x20000000, LENGTH = 48K }