Skip to content

Commit

Permalink
update linker script parameter docs
Browse files Browse the repository at this point in the history
  • Loading branch information
shadow578 authored Apr 12, 2024
1 parent d9d3243 commit d1e1e8c
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions docs/config_options/LINKER_SCRIPT.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
# Linker Script Configuration

the linker script can be configured in the platformio environment using options in `board_build`.
options are **directly** passed to the linker script using the `--defsym` option.
the linker script can be configured in the platformio environment using options in `board_build` and `board_upload`.

| option | description | default value |
| ------------- | ------------------------------------- | ------------- |
| `flash_start` | the start address of the flash memory | `0x0` |
| `flash_size` | the size of the flash memory | `256K` |
| `boot_mode` | firmware boot mode | `primary` |
| `preprocess` | enable linker script preprocessing | `true` |
| option | description | default value |
| ----------------------- | ------------------------------------- | ------------- |
| `upload.offset_address` | the start address of the flash memory | `0x0` |
| `upload.maximum_size` | the size of the flash memory | `262144` |
| `build.boot_mode` | firmware boot mode | `primary` |
| `build.ld_preprocess` | enable linker script preprocessing | `true` |

> [!TIP]
> the `flash_size` option describes the **total** size of the flash memory in bytes.
> the `upload.maximum_size` option describes the **total** size of the flash memory in bytes.
> do not subtract the bootloader size from the flash size, as this is done automatically by the build script.
> [!NOTE]
Expand All @@ -36,7 +35,7 @@ platformio.ini:
[env:my_env]
# ...
board_upload.offset_address = 0x0000C000
board_upload.maximum_size = 256K
board_upload.maximum_size = 262144
board_build.boot_mode = primary
```

Expand Down

0 comments on commit d1e1e8c

Please sign in to comment.