Skip to main content
Visitor II
January 6, 2021
Question

STM32H7 Change USB buffers

  • January 6, 2021
  • 2 replies
  • 540 views

I recently changed my SPI, I2C and USB HID to DMA. I changed buffers so they are in specific RAM sections which are accessible to DMA (RAM_D3 for I2C and RAM_D2 for SPI and USB). I am using DTCM RAM for stack, heap, data, etc. It was easy to change previous buffers with SPI and I2C but with USB I can't find where to change USB DMA buffers so it uses my buffers and not his. Because it will be probably located by the linker in DTCM and cause error. Here is my buffers :

uint8_t __attribute__(( section(".ramd2section") )) usb_rx[0x40]; // USB Rx
uint8_t __attribute__(( section(".ramd2section") )) usb_tx[0x40]; // USB Tx

    This topic has been closed for replies.

    2 replies

    Graduate II
    January 6, 2021

    Where does the linker script put ramd2section? And look at the picture "bus maxtrix" is this is compatible with your selection.

    Gabriel TAuthor
    Visitor II
    January 7, 2021
     .ramd2block (NOLOAD) :
     {
     KEEP(*(.ramd2section))
     } > RAM_D2

    I wrote this in the linker script, I use this domain because it is the same as the USB peripheral