update stm32wb linker to match new startup

This commit is contained in:
hathach
2025-05-14 15:28:29 +07:00
parent fe4446090e
commit 0ebc91ec97
3 changed files with 33 additions and 19 deletions

View File

@@ -233,11 +233,13 @@ void tuh_enum_descriptor_device_cb(uint8_t daddr, tusb_desc_device_t const* desc
void tuh_mount_cb(uint8_t daddr) {
cdc_printf("mounted device %u\r\n", daddr);
tud_cdc_write_flush();
is_print[daddr] = true;
}
void tuh_umount_cb(uint8_t daddr) {
cdc_printf("unmounted device %u\r\n", daddr);
tud_cdc_write_flush();
is_print[daddr] = false;
}

View File

@@ -3,21 +3,26 @@
**
** File : stm32wb55xx_flash_cm4.ld
**
** Abstract : System Workbench Minimal System calls file
** Author : STM32CubeIDE
**
** For more information about which c-functions
** need which of these lowlevel functions
** please consult the Newlib libc-manual
** Abstract : Linker script for STM32WB55xx Device
** 1024Kbytes FLASH
** 128Kbytes RAM
**
** Environment : System Workbench for MCU
** Set heap size, stack size and stack location according
** to application requirements.
**
** Distribution: The file is distributed “as is,” without any warranty
** Set memory bank area and size if external memory is used.
**
** Target : STMicroelectronics STM32
**
** Distribution: The file is distributed as is without any warranty
** of any kind.
**
*****************************************************************************
** @attention
**
** Copyright (c) 2019 STMicroelectronics.
** Copyright (c) 2019-2022 STMicroelectronics.
** All rights reserved.
**
** This software is licensed under terms that can be found in the LICENSE file
@@ -81,7 +86,10 @@ SECTIONS
. = ALIGN(4);
} >FLASH
.ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
.ARM.extab :
{
*(.ARM.extab* .gnu.linkonce.armextab.*)
} >FLASH
.ARM : {
__exidx_start = .;
*(.ARM.exidx*)
@@ -124,7 +132,6 @@ SECTIONS
_edata = .; /* define a global symbol at data end */
} >RAM1 AT> FLASH
/* Uninitialized data section */
. = ALIGN(4);
.bss :
@@ -152,8 +159,6 @@ SECTIONS
. = ALIGN(8);
} >RAM1
/* Remove information from the standard libraries */
/DISCARD/ :
{
@@ -165,5 +170,13 @@ SECTIONS
.ARM.attributes 0 : { *(.ARM.attributes) }
MAPPING_TABLE (NOLOAD) : { *(MAPPING_TABLE) } >RAM_SHARED
MB_MEM1 (NOLOAD) : { *(MB_MEM1) } >RAM_SHARED
MB_MEM2 (NOLOAD) : { _sMB_MEM2 = . ; *(MB_MEM2) ; _eMB_MEM2 = . ; } >RAM_SHARED
/* used by the startup to initialize .MB_MEM2 data */
_siMB_MEM2 = LOADADDR(.MB_MEM2);
.MB_MEM2 :
{
_sMB_MEM2 = . ;
*(MB_MEM2) ;
_eMB_MEM2 = . ;
} >RAM_SHARED AT> FLASH
}

View File

@@ -184,8 +184,7 @@ void HardFault_Handler(void) {
asm("bkpt 1");
}
// Required by __libc_init_array in startup code if we are compiling using
// -nostdlib/-nostartfiles.
// Required by __libc_init_array in startup code if we are compiling using -nostdlib/-nostartfiles.
void _init(void);
void _init(void) {
}