Skip to content

Commit

Permalink
update dfifo allocation scheme to use top pointer, update document an…
Browse files Browse the repository at this point in the history
…d explanation for EPInfo address and GDFIFO.

some function rename
update h743 linker to use SRAM1 since USB DMA cannot access DTCM ram
update xmc4500 to use uuid for testing
  • Loading branch information
hathach committed Sep 24, 2024
1 parent 40b5517 commit 86b4608
Show file tree
Hide file tree
Showing 4 changed files with 206 additions and 210 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
Loading

0 comments on commit 86b4608

Please sign in to comment.