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

@@ -36,6 +36,7 @@ extern void tempmon_init(void); //tempmon.c
uint32_t set_arm_clock(uint32_t frequency); // clockspeed.c
extern void __libc_init_array(void); // C++ standard library

uint8_t external_psram_size = 0;

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

Loading…
Cancel
Save