Skip to content

Commit

Permalink
Merge pull request #2576 from HiFiPhile/dwc2_dma
Browse files Browse the repository at this point in the history
DWC2 DMA support
  • Loading branch information
hathach authored Sep 25, 2024
2 parents f4dd176 + e483c6a commit c8ab65f
Show file tree
Hide file tree
Showing 10 changed files with 400 additions and 284 deletions.
35 changes: 18 additions & 17 deletions hw/bsp/stm32h7/linker/stm32h743xx_flash.ld
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,24 @@
/* Entry Point */
ENTRY(Reset_Handler)

/* Highest address of the user mode stack */
_estack = 0x20020000; /* end of RAM */
/* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 0x200; /* required amount of heap */
_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 = 512K
RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K
RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 64K
ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 2048K
DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
RAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 512K
RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K
RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 64K
ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K

}

/* Highest address of the user mode stack */
_estack = ORIGIN(RAM_D1) + LENGTH(RAM_D1); /* end of RAM */
/* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 0x200; /* required amount of heap */
_Min_Stack_Size = 0x400; /* required amount of stack */

/* Define output sections */
SECTIONS
{
Expand Down Expand Up @@ -127,7 +128,7 @@ SECTIONS

. = ALIGN(4);
_edata = .; /* define a global symbol at data end */
} >DTCMRAM AT> FLASH
} >RAM_D1 AT> FLASH


/* Uninitialized data section */
Expand All @@ -144,7 +145,9 @@ SECTIONS
. = ALIGN(4);
_ebss = .; /* define a global symbol at bss end */
__bss_end__ = _ebss;
} >DTCMRAM
} >RAM_D1



/* User_heap_stack section, used to check that there is enough RAM left */
._user_heap_stack :
Expand All @@ -155,9 +158,7 @@ SECTIONS
. = . + _Min_Heap_Size;
. = . + _Min_Stack_Size;
. = ALIGN(8);
} >DTCMRAM


} >RAM_D1

/* Remove information from the standard libraries */
/DISCARD/ :
Expand Down
6 changes: 6 additions & 0 deletions hw/bsp/xmc4000/family.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ uint32_t board_button_read(void) {
return BUTTON_STATE_ACTIVE == XMC_GPIO_GetInput(BUTTON_PIN);
}

size_t board_get_unique_id(uint8_t id[], size_t max_len) {
uint8_t const len = tu_min8(16, max_len);
memcpy(id, g_chipid, len);
return len;
}

int board_uart_read(uint8_t* buf, int len) {
#ifdef UART_DEV
for(int i=0;i<len;i++) {
Expand Down
2 changes: 1 addition & 1 deletion src/common/tusb_mcu.h
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@
#define TUP_DCD_EDPT_ISO_ALLOC
#endif

#if defined(TUP_USBIP_DWC2)
#if defined(TUP_USBIP_DWC2) // && CFG_TUD_DWC2_DMA == 0
#define TUP_MEM_CONST_ADDR
#endif

Expand Down
Loading

0 comments on commit c8ab65f

Please sign in to comment.