From 6343bd774f542a4f915cf1fca2053d03e93bf2c3 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 19 May 2013 20:06:03 -0700 Subject: [PATCH] altos/lpc: Don't use loader to place USB endpoint data in USB ram Instead, just assign a fixed address in registers.ld. This avoids a confusing section in the elf file. Signed-off-by: Keith Packard --- src/lpc/altos.ld | 4 ---- src/lpc/ao_usb_lpc.c | 3 +-- src/lpc/registers.ld | 1 + 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/lpc/altos.ld b/src/lpc/altos.ld index 2778797a..4d6f35a8 100644 --- a/src/lpc/altos.ld +++ b/src/lpc/altos.ld @@ -66,10 +66,6 @@ SECTIONS { } >ram PROVIDE(end = .); - .usb : { - *(.usb) - } > usb - PROVIDE(__stack__ = ORIGIN(stack) + LENGTH(stack)); } diff --git a/src/lpc/ao_usb_lpc.c b/src/lpc/ao_usb_lpc.c index cd896724..8070acc3 100644 --- a/src/lpc/ao_usb_lpc.c +++ b/src/lpc/ao_usb_lpc.c @@ -81,8 +81,7 @@ static uint8_t ao_usb_tx_count; static uint8_t ao_usb_rx_buffer[AO_USB_OUT_SIZE]; static uint8_t ao_usb_rx_count, ao_usb_rx_pos; -__attribute__((section(".usb"))) -static struct lpc_usb_endpoint lpc_usb_endpoint __attribute((aligned(256))); +extern struct lpc_usb_endpoint lpc_usb_endpoint; /* Marks when we don't need to send an IN packet. * This happens only when the last IN packet is not full, diff --git a/src/lpc/registers.ld b/src/lpc/registers.ld index 51866e07..a523c39c 100644 --- a/src/lpc/registers.ld +++ b/src/lpc/registers.ld @@ -1,4 +1,5 @@ lpc_usb_sram = 0x20004000; +lpc_usb_endpoint = 0x20004700; lpc_usart = 0x40008000; lpc_ct32b0 = 0x40014000; lpc_ct32b1 = 0x40018000; -- 2.30.2