Skip to content

Commit 8e491b0

Browse files
committed
Enlarged stack and heap since there is a lot of unused RAM.
1 parent 04134f6 commit 8e491b0

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

boards/varmint_h7/common/STM32H7LinkerScript.ld

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ ENTRY(Reset_Handler)
3737
/* Highest address of the user mode stack */
3838
_estack = ORIGIN(RAM_D1) + LENGTH(RAM_D1); /* end of RAM */
3939
/* Generate a link error if heap and stack don't fit into RAM */
40-
_Min_Heap_Size = 0x2000; /* required amount of heap */
41-
_Min_Stack_Size = 0x2000; /* required amount of stack */
40+
_Min_Heap_Size = 0x10000; /* required amount of heap note _user_heap_stack is one location */
41+
_Min_Stack_Size = 0x20000; /* required amount of stack */
4242

4343
/* Specify the memory areas */
4444
MEMORY

boards/varmint_h7/common/drivers/Auav.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ extern Time64 time64;
4747
DMA_RAM uint8_t auav_dma_txbuf[SPI_DMA_MAX_BUFFER_SIZE];
4848
DMA_RAM uint8_t auav_dma_rxbuf[SPI_DMA_MAX_BUFFER_SIZE];
4949

50-
DTCM_RAM uint8_t pitot_double_buffer[2 * sizeof(PressurePacket)];
51-
DTCM_RAM uint8_t baro_double_buffer[2 * sizeof(PressurePacket)];
50+
DTCM_RAM uint8_t auav_pitot_double_buffer[2 * sizeof(PressurePacket)];
51+
DTCM_RAM uint8_t auav_baro_double_buffer[2 * sizeof(PressurePacket)];
5252

5353
#define ROLLOVER 10000
5454

@@ -99,7 +99,7 @@ uint32_t Auav::init(uint16_t sample_rate_hz, //
9999
{
100100
spi_[AUAV_PITOT].init(hspi, auav_dma_txbuf, auav_dma_rxbuf, pitot_cs_port, pitot_cs_pin);
101101

102-
double_buffer_[AUAV_PITOT].init(pitot_double_buffer, sizeof(pitot_double_buffer));
102+
double_buffer_[AUAV_PITOT].init(auav_pitot_double_buffer, sizeof(auav_pitot_double_buffer));
103103

104104
char name[] = "Auav (pitot)";
105105
memset(name_local_[AUAV_PITOT], '\0', sizeof(name_local_[AUAV_PITOT]));
@@ -127,7 +127,7 @@ uint32_t Auav::init(uint16_t sample_rate_hz, //
127127
{
128128
spi_[AUAV_BARO].init(hspi, auav_dma_txbuf, auav_dma_rxbuf, baro_cs_port, baro_cs_pin);
129129

130-
double_buffer_[AUAV_BARO].init(baro_double_buffer, sizeof(baro_double_buffer));
130+
double_buffer_[AUAV_BARO].init(auav_baro_double_buffer, sizeof(auav_baro_double_buffer));
131131

132132
char name[] = "Auav (baro) ";
133133
memset(name_local_[AUAV_BARO], '\0', sizeof(name_local_[AUAV_BARO]));

boards/varmint_h7/common/drivers/Telem.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
extern Time64 time64;
4848

49-
#define TELEM_RX_BUFFER_SIZE (4096) // Use a multiple of 32!
49+
#define TELEM_RX_BUFFER_SIZE (4096-32) // Use a multiple of 32!
5050

5151
DTCM_RAM uint8_t telem_fifo_rx_buffer[TELEM_RX_BUFFER_SIZE];
5252

@@ -62,8 +62,8 @@ DTCM_RAM uint8_t telem_fifo_tx_buffer1[SERIAL_TX_FIFO_BUFFERS1 * sizeof(SerialTx
6262
DTCM_RAM uint8_t telem_fifo_tx_buffer2[SERIAL_TX_FIFO_BUFFERS2 * sizeof(SerialTxPacket)];
6363
DTCM_RAM PacketFifo telem_tx_fifos[SERIAL_QOS_FIFOS];
6464

65-
DATA_RAM uint8_t * telem_fifo_tx_buffer[SERIAL_QOS_FIFOS] = {telem_fifo_tx_buffer0, telem_fifo_tx_buffer1,
66-
telem_fifo_tx_buffer2};
65+
DATA_RAM uint8_t * telem_fifo_tx_buffer[SERIAL_QOS_FIFOS] =
66+
{telem_fifo_tx_buffer0, telem_fifo_tx_buffer1, telem_fifo_tx_buffer2};
6767

6868
uint32_t Telem::init(
6969
// Driver initializers

0 commit comments

Comments
 (0)