Skip to content

Commit

Permalink
Add external_psram_size to inform libraries of available PSRAM
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulStoffregen committed May 13, 2020
1 parent ebbd8e7 commit a41500e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions teensy4/startup.c
Expand Up @@ -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) {}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a41500e

Please sign in to comment.