Skip to content

Commit

Permalink
bugfix: D2 SRAM clocks and CRun CPU state (commaai#1125)
Browse files Browse the repository at this point in the history
D2 SRAM clocks
  • Loading branch information
briskspirit authored Nov 2, 2022
1 parent 0ca6d9d commit f7c74e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions board/stm32h7/clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,8 @@ void clock_init(void) {
register_set_bits(&(RCC->CR), RCC_CR_CSSHSEON);
//Enable Vdd33usb supply level detector
register_set_bits(&(PWR->CR3), PWR_CR3_USB33DEN);

// Enable CPU access to SRAM1 and SRAM2 (in domain D2)
register_set_bits(&(RCC->AHB2ENR), RCC_AHB2ENR_SRAM1EN);
register_set_bits(&(RCC->AHB2ENR), RCC_AHB2ENR_SRAM2EN);
}
8 changes: 4 additions & 4 deletions board/stm32h7/stm32h7x5_flash.ld
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ _Min_Stack_Size = 0x400; /* required amount of stack */
/* Specify the memory areas */
MEMORY
{
DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
RAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 320K
RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 32K
RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 16K
DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K /* DTCM */
RAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 320K /* AXI SRAM */
RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 32K /* SRAM1(16kb) + SRAM2(16kb) */
RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 16K /* SRAM4 */
ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K
}
Expand Down

0 comments on commit f7c74e0

Please sign in to comment.