Prusa3d Marlin fork
xflash_layout.h
Go to the documentation of this file.
1 
9 
10 
48 // XFLASH memory layout
49 #pragma once
50 #include <stdint.h>
51 #include "bootapp.h" // for RAMSIZE
52 #include "config.h"
53 
54 #define XFLASH_SIZE 0x40000ul // size of XFLASH
55 
56 #define DUMP_MAGIC 0x55525547ul
57 
59 {
60  // start with a magic value to indicate the presence of a dump, so that clearing
61  // a single page is sufficient for resetting the state
62  uint32_t magic;
63 
64  uint8_t regs_present; // true when the lower segment containing registers is present
65  uint8_t crash_reason; // uses values from dump_crash_source
66 
67  uint32_t pc; // PC nearby the crash location
68  uint16_t sp; // SP nearby the crash location
69 };
70 
72 {
73  // contiguous region containing all addressable ranges
74  uint8_t regs[RAMSTART];
75  uint8_t sram[RAMSIZE];
76 };
77 
78 struct dump_t
79 {
80  struct dump_header_t header;
81 
82  // data is page aligned (no real space waste, due to the larger
83  // alignment required for the whole dump)
84  struct dump_data_t __attribute__((aligned(256))) data;
85 };
86 
87 #define DUMP_OFFSET ((XFLASH_SIZE - sizeof(dump_t)) & ~0xFFFul) // dump offset must be aligned to lower 4kb sector boundary
88 #define MMU_BOOTLOADER_UPDATE_OFFSET (DUMP_OFFSET - 32768) // 32KB of MMU bootloader self update.
89 #define MMU_FW_UPDATE_OFFSET (MMU_BOOTLOADER_UPDATE_OFFSET - 32768) // 32KB of MMU fw.
90 #define LANG_OFFSET 0x0 // offset for language data
91 
92 #define LANG_SIZE (MMU_FW_UPDATE_OFFSET - LANG_OFFSET) // available language space
93 #define DUMP_SIZE (XFLASH_SIZE - DUMP_OFFSET) // effective dump size area
static constexpr float __attribute__((noinline)) count_e(float layer_height
Count extrude length.
Definition: xflash_layout.h:72
Definition: xflash_layout.h:59
Definition: xflash_layout.h:79