File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 26
26
#define MICROPY_HW_BOARD_NAME "THUNDERPACK"
27
27
#define MICROPY_HW_MCU_NAME "STM32F411CE"
28
28
29
- #define FLASH_SIZE (0x80000)
30
- #define FLASH_PAGE_SIZE (0x4000)
29
+ // Non-volatile memory config
31
30
#define CIRCUITPY_INTERNAL_NVM_SIZE (0x4000)
32
31
#define CIRCUITPY_INTERNAL_NVM_START_ADDR (0x0800C000)
33
32
#define CIRCUITPY_INTERNAL_NVM_SECTOR FLASH_SECTOR_3
33
+
34
+ // Putting the entire flash sector in the NVM byte array buffer
35
+ // would take up too much RAM. This limits how much of the sector we use.
36
+ #define NVM_BYTEARRAY_BUFFER_LEN 512
37
+
38
+ // Flash config
39
+ #define FLASH_SIZE (0x80000)
40
+ #define FLASH_PAGE_SIZE (0x4000)
34
41
#define BOARD_FLASH_SIZE (FLASH_SIZE - CIRCUITPY_INTERNAL_NVM_SIZE- 0x2000 - 0xC000)
35
42
36
43
#define BOARD_OSC_DIV (24)
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ const nvm_bytearray_obj_t common_hal_mcu_nvm_obj = {
116
116
.base = {
117
117
.type = & nvm_bytearray_type ,
118
118
},
119
- .len = NVM_BYTEARRAY_BUFFER ,
119
+ .len = NVM_BYTEARRAY_BUFFER_LEN ,
120
120
.start_address = (uint8_t * ) (CIRCUITPY_INTERNAL_NVM_START_ADDR )
121
121
};
122
122
#endif
Original file line number Diff line number Diff line change 32
32
// STM flash is saved in sectors (not pages), at a minimum size of 16k.
33
33
// To limit the RAM usage during writing, we want to set a smaller
34
34
// maximum value.
35
- #define NVM_BYTEARRAY_BUFFER 512
35
+ #ifndef NVM_BYTEARRAY_BUFFER_LEN
36
+ #define NVM_BYTEARRAY_BUFFER_LEN 512
37
+ #endif
36
38
37
39
typedef struct {
38
40
mp_obj_base_t base ;
You can’t perform that action at this time.
0 commit comments