Code: Select all
24000000 0 SECTION LOCAL RAM1
24000000 0 NOTYPE LOCAL $d
24000000 0 NOTYPE GLOBAL _sbss_d1
24000000 256 OBJECT WEAK _ZN10DmaBuffers11gUiTxBufferE
24000000 0 NOTYPE GLOBAL __bss_d1_start__
24000100 16384 OBJECT WEAK _ZN10DmaBuffers13gMidiTxBufferE
24004100 8192 OBJECT WEAK _ZN10DmaBuffers12gUsbTxBufferE
24006100 16384 OBJECT WEAK _ZN10DmaBuffers12gUsbRxBufferE
2400a100 16384 OBJECT WEAK _ZN10DmaBuffers11gUiRxBufferE
2400e100 0 NOTYPE LOCAL $d
2400e100 49152 OBJECT WEAK gDcoBuffers
2401e200 0 NOTYPE LOCAL $d
2401e200 32 OBJECT GLOBAL gDebugRxBuffer
2401e220 0 NOTYPE LOCAL $d
2401e220 1248 OBJECT GLOBAL _ZN7CvMuxer11sDacBuffersE
2401e700 0 NOTYPE GLOBAL __bss_d1_end__
2401e700 0 NOTYPE GLOBAL _ebss_d1
Code: Select all
... in a header far far away, a long long time ago...
#define DMA1AND2_BUFFER_ZEROED __attribute__((section("RAM1")))
... in another header ...
namespace DmaBuffers
{
// Hardware buffers which need to be placed in RAM D1 to be accessible to
// DMA
inline constinit RxBufferedType::ExternalBufferType gUiRxBuffer DMA1AND2_BUFFER_ZEROED = {};
inline constinit RxBufferedType::ExternalBufferType gUsbRxBuffer DMA1AND2_BUFFER_ZEROED = {};
inline constinit UsbTxBufferedType::ExternalBufferType gUsbTxBuffer DMA1AND2_BUFFER_ZEROED = {};
inline constinit MidiTxBufferedType::ExternalBufferType gMidiTxBuffer DMA1AND2_BUFFER_ZEROED = {};
inline constinit TxBufferedType::ExternalBufferType gUiTxBuffer DMA1AND2_BUFFER_ZEROED = {};
}
... in a source file ...
inline constinit DebugUartRxBufferedType::ExternalBufferType gDebugRxBuffer DMA1AND2_BUFFER_ZEROED = {};
... yet another source file ...
inline constinit DcoPulseBufferType gDcoBuffers[kNumVoices] DMA1AND2_BUFFER_ZEROED = {};
< /code>
ExternalBufferType
Code: Select all
RAM1 (NOLOAD) :
{
. = ALIGN(4);
/* This is used by the startup in order to initialize the .bss section */
_sbss_d1 = .; /* define a global symbol at bss start */
__bss_d1_start__ = _sbss_d1;
KEEP(*(RAM1))
_ebss_d1 = .; /* define a global symbol at bss end */
__bss_d1_end__ = _ebss_d1;
} >RAM_D1
< /code>
The flags I believe are relevant are -O3 -ffunction-sections -fdata-sections
N.B. Durch das Verschieben der Puffer von Kopfzeile zu Quelldateien verschwindet die Lücke. Dies scheint jedoch eher eine Problemumgehung als eine Lösung zu sein, daher bin ich immer noch daran interessiert, was hier passiert.