altos/lpc: Stick USB control structure in USB memory
authorKeith Packard <keithp@keithp.com>
Sat, 18 May 2013 10:52:14 +0000 (03:52 -0700)
committerKeith Packard <keithp@keithp.com>
Sat, 18 May 2013 10:52:14 +0000 (03:52 -0700)
No reason to have that in regular ram, and it means we've got space
for large enough stacks now

Signed-off-by: Keith Packard <keithp@keithp.com>
src/lpc/altos.ld
src/lpc/ao_arch.h
src/lpc/ao_usb_lpc.c

index bcfba1ea17955e4038772a820d42778f9813cfb9..2778797a4a378b8f4411f995377608411659c334 100644 (file)
@@ -17,8 +17,9 @@
 
 MEMORY {
        rom (rx) : ORIGIN = 0x00000000, LENGTH = 32K
-       ram (!w) : ORIGIN = 0x10000000, LENGTH = 4K - 512
-       stack (!w) : ORIGIN = 0x10000000 + 4K - 512, LENGTH = 512
+       ram (!w) : ORIGIN = 0x10000000, LENGTH = 4K - 128
+       usb (!x) : ORIGIN = 0x20004000 + 2K - 256, LENGTH = 256
+       stack (!w) : ORIGIN = 0x10000000 + 4K - 128, LENGTH = 128
 }
 
 INCLUDE registers.ld
@@ -63,9 +64,13 @@ SECTIONS {
                *(COMMON)
                __bss_end__ = .;
        } >ram
+       PROVIDE(end = .);
+
+       .usb : {
+               *(.usb)
+       } > usb
 
        PROVIDE(__stack__ = ORIGIN(stack) + LENGTH(stack));
-       PROVIDE(end = .);
 }
 
 ENTRY(start);
index 9240564989748c49892734b1eff17663938732b8..9dbebf4ace1edb1b612df90ce16353bfa409aa06 100644 (file)
@@ -24,7 +24,7 @@
  * LPC11U14 definitions and code fragments for AltOS
  */
 
-#define AO_STACK_SIZE  192
+#define AO_STACK_SIZE  320
 
 #define AO_LED_TYPE    uint16_t
 
index 0f8817207aecdadf7745e74eb1d1f348b9e91496..cd8967249643c365312985816a37a4429dfd681d 100644 (file)
@@ -81,6 +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)));
 
 /* Marks when we don't need to send an IN packet.