summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/host/msc_file_explorer/src/main.c17
-rw-r--r--examples/host/msc_file_explorer/src/msc_app.c1
-rw-r--r--hw/bsp/lpc18/boards/lpcxpresso18s37/lpc1837.ld34
-rw-r--r--hw/bsp/lpc18/boards/mcb1800/lpc1857.ld37
-rw-r--r--hw/bsp/lpc18/family.cmake8
-rw-r--r--hw/bsp/nrf/family.cmake3
-rw-r--r--src/portable/ehci/ehci.c2
7 files changed, 64 insertions, 38 deletions
diff --git a/examples/host/msc_file_explorer/src/main.c b/examples/host/msc_file_explorer/src/main.c
index 73f3e9eb5..f6b6810f5 100644
--- a/examples/host/msc_file_explorer/src/main.c
+++ b/examples/host/msc_file_explorer/src/main.c
@@ -72,8 +72,7 @@ extern bool msc_app_init(void);
extern void msc_app_task(void);
/*------------- MAIN -------------*/
-int main(void)
-{
+int main(void) {
board_init();
printf("TinyUSB Host MassStorage Explorer Example\r\n");
@@ -87,8 +86,7 @@ int main(void)
msc_app_init();
- while (1)
- {
+ while (1) {
// tinyusb host task
tuh_task();
@@ -103,28 +101,25 @@ int main(void)
// TinyUSB Callbacks
//--------------------------------------------------------------------+
-void tuh_mount_cb(uint8_t dev_addr)
-{
+void tuh_mount_cb(uint8_t dev_addr) {
(void) dev_addr;
}
-void tuh_umount_cb(uint8_t dev_addr)
-{
+void tuh_umount_cb(uint8_t dev_addr) {
(void) dev_addr;
}
//--------------------------------------------------------------------+
// Blinking Task
//--------------------------------------------------------------------+
-void led_blinking_task(void)
-{
+void led_blinking_task(void) {
const uint32_t interval_ms = 1000;
static uint32_t start_ms = 0;
static bool led_state = false;
// Blink every interval ms
- if ( board_millis() - start_ms < interval_ms) return; // not enough time
+ if (board_millis() - start_ms < interval_ms) return; // not enough time
start_ms += interval_ms;
board_led_write(led_state);
diff --git a/examples/host/msc_file_explorer/src/msc_app.c b/examples/host/msc_file_explorer/src/msc_app.c
index f323e30f0..ddd39c674 100644
--- a/examples/host/msc_file_explorer/src/msc_app.c
+++ b/examples/host/msc_file_explorer/src/msc_app.c
@@ -95,7 +95,6 @@ void msc_app_task(void)
//
//--------------------------------------------------------------------+
-
bool inquiry_complete_cb(uint8_t dev_addr, tuh_msc_complete_data_t const * cb_data)
{
msc_cbw_t const* cbw = cb_data->cbw;
diff --git a/hw/bsp/lpc18/boards/lpcxpresso18s37/lpc1837.ld b/hw/bsp/lpc18/boards/lpcxpresso18s37/lpc1837.ld
index f1a3add8f..8562a6e71 100644
--- a/hw/bsp/lpc18/boards/lpcxpresso18s37/lpc1837.ld
+++ b/hw/bsp/lpc18/boards/lpcxpresso18s37/lpc1837.ld
@@ -311,6 +311,20 @@ SECTIONS
PROVIDE(end = .);
} > RamLoc40 AT> RamLoc40 /* > RamLoc32 AT> RamLoc32 */
+ .heap (NOLOAD): {
+ __heap_start = .;
+ __HeapBase = .;
+ __heap_base = .;
+ __end = .;
+ PROVIDE(end = .);
+ PROVIDE(_end = .);
+ PROVIDE(__end__ = .);
+ KEEP(*(.heap*))
+ __HeapLimit = .;
+ __heap_limit = .;
+ __heap_end = .;
+ } > RamLoc40
+
/* NOINIT section for RamLoc40 */
.noinit_RAM2 (NOLOAD) : ALIGN(4)
{
@@ -383,15 +397,17 @@ SECTIONS
PROVIDE(_vStackTop = DEFINED(__user_stack_top) ? __user_stack_top : __top_RamLoc32 - 0);
/* ## Create checksum value (used in startup) ## */
- PROVIDE(__valid_user_code_checksum = 0 -
- (_vStackTop
- + (ResetISR + 1)
- + (NMI_Handler + 1)
- + (HardFault_Handler + 1)
- + (( DEFINED(MemManage_Handler) ? MemManage_Handler : 0 ) + 1) /* MemManage_Handler may not be defined */
- + (( DEFINED(BusFault_Handler) ? BusFault_Handler : 0 ) + 1) /* BusFault_Handler may not be defined */
- + (( DEFINED(UsageFault_Handler) ? UsageFault_Handler : 0 ) + 1) /* UsageFault_Handler may not be defined */
- ) );
+ /* This cause issue with clang linker, so it is disabled */
+ /* MemManage_Handler, BusFault_Handler, UsageFault_Handler may not be defined */
+/* PROVIDE(__valid_user_code_checksum = 0 -*/
+/* (_vStackTop*/
+/* + (ResetISR + 1)*/
+/* + (NMI_Handler + 1)*/
+/* + (HardFault_Handler + 1)*/
+/* + (( DEFINED(MemManage_Handler) ? MemManage_Handler : 0 ) + 1)*/
+/* + (( DEFINED(BusFault_Handler) ? BusFault_Handler : 0 ) + 1)*/
+/* + (( DEFINED(UsageFault_Handler) ? UsageFault_Handler : 0 ) + 1)*/
+/* ) );*/
/* Provide basic symbols giving location and size of main text
* block, including initial values of RW data sections. Note that
diff --git a/hw/bsp/lpc18/boards/mcb1800/lpc1857.ld b/hw/bsp/lpc18/boards/mcb1800/lpc1857.ld
index 837dec364..02ea1088e 100644
--- a/hw/bsp/lpc18/boards/mcb1800/lpc1857.ld
+++ b/hw/bsp/lpc18/boards/mcb1800/lpc1857.ld
@@ -255,7 +255,6 @@ SECTIONS
*(COMMON)
. = ALIGN(4) ;
_ebss = .;
- PROVIDE(end = .);
} > RamLoc40 /* RamLoc32 */
/* NOINIT section for RamLoc40 */
@@ -266,6 +265,20 @@ SECTIONS
. = ALIGN(4) ;
} > RamLoc40
+ .heap (NOLOAD): {
+ __heap_start = .;
+ __HeapBase = .;
+ __heap_base = .;
+ __end = .;
+ PROVIDE(end = .);
+ PROVIDE(_end = .);
+ PROVIDE(__end__ = .);
+ KEEP(*(.heap*))
+ __HeapLimit = .;
+ __heap_limit = .;
+ __heap_end = .;
+ } > RamLoc40
+
/* NOINIT section for RamAHB32 */
.noinit_RAM3 (NOLOAD) : ALIGN(4)
{
@@ -298,19 +311,21 @@ SECTIONS
. = ALIGN(4) ;
_end_noinit = .;
} > RamLoc32
- PROVIDE(_pvHeapStart = DEFINED(__user_heap_base) ? __user_heap_base : .);
+
PROVIDE(_vStackTop = DEFINED(__user_stack_top) ? __user_stack_top : __top_RamLoc32 - 0);
/* ## Create checksum value (used in startup) ## */
- PROVIDE(__valid_user_code_checksum = 0 -
- (_vStackTop
- + (ResetISR + 1)
- + (NMI_Handler + 1)
- + (HardFault_Handler + 1)
- + (( DEFINED(MemManage_Handler) ? MemManage_Handler : 0 ) + 1) /* MemManage_Handler may not be defined */
- + (( DEFINED(BusFault_Handler) ? BusFault_Handler : 0 ) + 1) /* BusFault_Handler may not be defined */
- + (( DEFINED(UsageFault_Handler) ? UsageFault_Handler : 0 ) + 1) /* UsageFault_Handler may not be defined */
- ) );
+ /* This cause issue with clang linker, so it is disabled */
+ /* MemManage_Handler, BusFault_Handler, UsageFault_Handler may not be defined */
+/* PROVIDE(__valid_user_code_checksum = 0 -*/
+/* (_vStackTop*/
+/* + (ResetISR + 1)*/
+/* + (NMI_Handler + 1)*/
+/* + (HardFault_Handler + 1)*/
+/* + (( DEFINED(MemManage_Handler) ? MemManage_Handler : 0 ) + 1)*/
+/* + (( DEFINED(BusFault_Handler) ? BusFault_Handler : 0 ) + 1)*/
+/* + (( DEFINED(UsageFault_Handler) ? UsageFault_Handler : 0 ) + 1)*/
+/* ) );*/
/* Provide basic symbols giving location and size of main text
* block, including initial values of RW data sections. Note that
diff --git a/hw/bsp/lpc18/family.cmake b/hw/bsp/lpc18/family.cmake
index 78f4c510b..bf8efabba 100644
--- a/hw/bsp/lpc18/family.cmake
+++ b/hw/bsp/lpc18/family.cmake
@@ -47,9 +47,11 @@ function(add_board_target BOARD_TARGET)
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_link_options(${BOARD_TARGET} PUBLIC
"LINKER:--script=${LD_FILE_GNU}"
- # nanolib
- --specs=nosys.specs
- --specs=nano.specs
+ --specs=nosys.specs --specs=nano.specs
+ )
+ elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang")
+ target_link_options(${BOARD_TARGET} PUBLIC
+ "LINKER:--script=${LD_FILE_GNU}"
)
elseif (CMAKE_C_COMPILER_ID STREQUAL "IAR")
target_link_options(${BOARD_TARGET} PUBLIC
diff --git a/hw/bsp/nrf/family.cmake b/hw/bsp/nrf/family.cmake
index 56ff62bc4..1d6702720 100644
--- a/hw/bsp/nrf/family.cmake
+++ b/hw/bsp/nrf/family.cmake
@@ -39,7 +39,6 @@ function(add_board_target BOARD_TARGET)
if (NOT DEFINED LD_FILE_GNU)
set(LD_FILE_GNU ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/linker/${MCU_VARIANT_XXAA}.ld)
endif ()
- set(LD_FILE_Clang ${LD_FILE_GNU})
if (NOT DEFINED STARTUP_FILE_${CMAKE_C_COMPILER_ID})
set(STARTUP_FILE_GNU ${NRFX_DIR}/mdk/gcc_startup_${MCU_VARIANT}.S)
@@ -89,7 +88,7 @@ function(add_board_target BOARD_TARGET)
)
elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang")
target_link_options(${BOARD_TARGET} PUBLIC
- "LINKER:--script=${LD_FILE_Clang}"
+ "LINKER:--script=${LD_FILE_GNU}"
-L${NRFX_DIR}/mdk
)
elseif (CMAKE_C_COMPILER_ID STREQUAL "IAR")
diff --git a/src/portable/ehci/ehci.c b/src/portable/ehci/ehci.c
index e145cbb1b..01bbf62bf 100644
--- a/src/portable/ehci/ehci.c
+++ b/src/portable/ehci/ehci.c
@@ -92,7 +92,7 @@ CFG_TUH_MEM_SECTION TU_ATTR_ALIGNED(4096) static ehci_data_t ehci_data;
//--------------------------------------------------------------------+
// Debug
//--------------------------------------------------------------------+
-#if CFG_TUSB_DEBUG >= (EHCI_DBG + 1)
+#if 0 && CFG_TUSB_DEBUG >= (EHCI_DBG + 1)
static inline void print_portsc(ehci_registers_t* regs) {
TU_LOG_HEX(EHCI_DBG, regs->portsc);
TU_LOG(EHCI_DBG, " Connect Status : %u\r\n", regs->portsc_bm.current_connect_status);