Skip to content

Commit

Permalink
H7: free up 29120 bytes of RAM (commaai#1120)
Browse files Browse the repository at this point in the history
free up some RAM
  • Loading branch information
briskspirit authored Oct 26, 2022
1 parent 2db69bc commit bd8d248
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
5 changes: 3 additions & 2 deletions board/drivers/can_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,14 @@ void process_can(uint8_t can_number);

#ifdef STM32H7
__attribute__((section(".ram_d1"))) can_buffer(rx_q, 0x1000)
__attribute__((section(".ram_d1"))) can_buffer(txgmlan_q, 0x1A0)
__attribute__((section(".ram_d1"))) can_buffer(tx2_q, 0x1A0)
__attribute__((section(".ram_d2"))) can_buffer(txgmlan_q, 0x1A0)
#else
can_buffer(rx_q, 0x1000)
can_buffer(tx2_q, 0x1A0)
can_buffer(txgmlan_q, 0x1A0)
#endif
can_buffer(tx1_q, 0x1A0)
can_buffer(tx2_q, 0x1A0)
can_buffer(tx3_q, 0x1A0)
// FIXME:
// cppcheck-suppress misra-c2012-9.3
Expand Down
8 changes: 7 additions & 1 deletion board/stm32h7/stm32h7x5_flash.ld
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ SECTIONS
_edata = .; /* define a global symbol at data end */
} >DTCMRAM AT> FLASH


/* Uninitialized data section */
. = ALIGN(4);
.bss :
Expand Down Expand Up @@ -186,6 +186,12 @@ SECTIONS
*(.ram_d1*)
} >RAM_D1

.ram_d2 (NOLOAD) :
{
. = ALIGN(4);
*(.ram_d2*)
} >RAM_D2

.ARM.attributes 0 : { *(.ARM.attributes) }
}

Expand Down

0 comments on commit bd8d248

Please sign in to comment.