Browse Source

Add external_psram_size to inform libraries of available PSRAM

teensy4-core
PaulStoffregen 4 years ago
parent
commit
a41500ec8e
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      teensy4/startup.c

+ 3
- 0
teensy4/startup.c View File

uint32_t set_arm_clock(uint32_t frequency); // clockspeed.c uint32_t set_arm_clock(uint32_t frequency); // clockspeed.c
extern void __libc_init_array(void); // C++ standard library extern void __libc_init_array(void); // C++ standard library


uint8_t external_psram_size = 0;


extern int main (void); extern int main (void);
void startup_default_early_hook(void) {} void startup_default_early_hook(void) {}
if (flexspi2_psram_id(0x800000) == 0x5D0D) { if (flexspi2_psram_id(0x800000) == 0x5D0D) {
flexspi2_command(4, 0x800000); flexspi2_command(4, 0x800000);
// Two PSRAM chips are present, 16 MByte // Two PSRAM chips are present, 16 MByte
external_psram_size = 16;
} else { } else {
// One PSRAM chip is present, 8 MByte // One PSRAM chip is present, 8 MByte
external_psram_size = 8;
} }
// TODO: zero uninitialized EXTMEM variables // TODO: zero uninitialized EXTMEM variables
// TODO: copy from flash to initialize EXTMEM variables // TODO: copy from flash to initialize EXTMEM variables

Loading…
Cancel
Save