Skip to content

Commit

Permalink
Correct flash memory layouts
Browse files Browse the repository at this point in the history
Document the actual values of the flash partition offsets and update
linker scripts to match.
  • Loading branch information
NickeZ committed Feb 19, 2024
1 parent de92acb commit 78dcbc3
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bootloader.ld
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ SEARCH_DIR(.)
/* Memory Spaces Definitions */
MEMORY
{
/* Reserve (at least) 32 bytes of space for factory install random bytes */
/* Reserve 32 bytes of space for factory install random bytes */
rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x0000DFE0
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00040000
bkupram (rwx) : ORIGIN = 0x47000000, LENGTH = 0x00002000
Expand Down
2 changes: 1 addition & 1 deletion firmware.ld
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ SEARCH_DIR(.)
/* Memory Spaces Definitions */
MEMORY
{
rom (rx) : ORIGIN = 0x00010000, LENGTH = 0x000F0000
rom (rx) : ORIGIN = 0x00010000, LENGTH = 0x000D8000
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00040000
bkupram (rwx) : ORIGIN = 0x47000000, LENGTH = 0x00002000
qspi (rwx) : ORIGIN = 0x04000000, LENGTH = 0x01000000
Expand Down
30 changes: 30 additions & 0 deletions src/flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,36 @@

#include "memory/smarteeprom.h"

//
// Memory layout flash
//
// +-------------+ 0xFA000
// | Boot data |
// | (0x02000) |
// | |
// +-------------+ 0xF8000
// | App data |
// | (0x10000) |
// | |
// +-------------+ 0xE8000
// | App |
// | (0xD8000) |
// | |
// +-------------+ 0x10000
// | Shared data |
// | (0x02000) |
// | |
// +-------------+ 0x0E000
// | Factory |
// | Randomness |
// | (0x00020) |
// +-------------+ 0x0DFE0
// | Boot |
// | (0x0DFE0) |
// | |
// +-------------+ 0x00000
//

// The total size of the flash is 1MB (2048 pages).
#define FLASH_END (2048 * FLASH_PAGE_SIZE)

Expand Down

0 comments on commit 78dcbc3

Please sign in to comment.