Combine ram_usb[01] into a single region.
Assign usb_bulk_buffer symbol to ram_usb origin, instead of hard-coding a pointer in C. Change declaration of usb_bulk_buffer from a pointer to an array.
This commit is contained in:
@ -33,14 +33,15 @@ MEMORY
|
||||
ram_sleep (rwx) : ORIGIN = 0x10088000, LENGTH = 8K
|
||||
ram_m0 (rwx) : ORIGIN = 0x20000000, LENGTH = 28K
|
||||
ram_shared (rwx) : ORIGIN = 0x20007000, LENGTH = 4K
|
||||
ram_usb0 (rwx) : ORIGIN = 0x20008000, LENGTH = 16K
|
||||
ram_usb1 (rwx) : ORIGIN = 0x2000c000, LENGTH = 16K
|
||||
/* ram_usb[01]: USB buffer. Straddles two blocks of RAM
|
||||
ram_usb (rwx) : ORIGIN = 0x20008000, LENGTH = 32K
|
||||
/* ram_usb: USB buffer. Straddles two blocks of RAM
|
||||
* to get performance benefit of having two USB buffers addressable
|
||||
* simultaneously (on two different buses of the AHB multilayer matrix)
|
||||
*/
|
||||
}
|
||||
|
||||
usb_bulk_buffer = ORIGIN(ram_usb);
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_lpc43xx.ld
|
||||
|
||||
|
@ -34,14 +34,15 @@ MEMORY
|
||||
ram_sleep (rwx) : ORIGIN = 0x10088000, LENGTH = 8K
|
||||
ram_m0 (rwx) : ORIGIN = 0x20000000, LENGTH = 28K
|
||||
ram_shared (rwx) : ORIGIN = 0x20007000, LENGTH = 4K
|
||||
ram_usb0 (rwx) : ORIGIN = 0x20008000, LENGTH = 16K
|
||||
ram_usb1 (rwx) : ORIGIN = 0x2000c000, LENGTH = 16K
|
||||
/* ram_usb[01]: USB buffer. Straddles two blocks of RAM
|
||||
ram_usb (rwx) : ORIGIN = 0x20008000, LENGTH = 32K
|
||||
/* ram_usb: USB buffer. Straddles two blocks of RAM
|
||||
* to get performance benefit of having two USB buffers addressable
|
||||
* simultaneously (on two different buses of the AHB multilayer matrix)
|
||||
*/
|
||||
}
|
||||
|
||||
usb_bulk_buffer = ORIGIN(ram_usb);
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_lpc43xx_rom_to_ram.ld
|
||||
|
||||
|
@ -33,14 +33,15 @@ MEMORY
|
||||
ram_sleep (rwx) : ORIGIN = 0x10090000, LENGTH = 8K
|
||||
ram_m0 (rwx) : ORIGIN = 0x20000000, LENGTH = 28K
|
||||
ram_shared (rwx) : ORIGIN = 0x20007000, LENGTH = 4K
|
||||
ram_usb0 (rwx) : ORIGIN = 0x20008000, LENGTH = 16K
|
||||
ram_usb1 (rwx) : ORIGIN = 0x2000c000, LENGTH = 16K
|
||||
/* ram_usb[01]: USB buffer. Straddles two blocks of RAM
|
||||
ram_usb (rwx) : ORIGIN = 0x20008000, LENGTH = 32K
|
||||
/* ram_usb: USB buffer. Straddles two blocks of RAM
|
||||
* to get performance benefit of having two USB buffers addressable
|
||||
* simultaneously (on two different buses of the AHB multilayer matrix)
|
||||
*/
|
||||
}
|
||||
|
||||
usb_bulk_buffer = ORIGIN(ram_usb);
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_lpc43xx.ld
|
||||
|
||||
|
@ -34,14 +34,15 @@ MEMORY
|
||||
ram_sleep (rwx) : ORIGIN = 0x10090000, LENGTH = 8K
|
||||
ram_m0 (rwx) : ORIGIN = 0x20000000, LENGTH = 28K
|
||||
ram_shared (rwx) : ORIGIN = 0x20007000, LENGTH = 4K
|
||||
ram_usb0 (rwx) : ORIGIN = 0x20008000, LENGTH = 16K
|
||||
ram_usb1 (rwx) : ORIGIN = 0x2000c000, LENGTH = 16K
|
||||
/* ram_usb[01]: USB buffer. Straddles two blocks of RAM
|
||||
ram_usb (rwx) : ORIGIN = 0x20008000, LENGTH = 32K
|
||||
/* ram_usb: USB buffer. Straddles two blocks of RAM
|
||||
* to get performance benefit of having two USB buffers addressable
|
||||
* simultaneously (on two different buses of the AHB multilayer matrix)
|
||||
*/
|
||||
}
|
||||
|
||||
usb_bulk_buffer = ORIGIN(ram_usb);
|
||||
|
||||
/* Include the common ld script. */
|
||||
INCLUDE libopencm3_lpc43xx_rom_to_ram.ld
|
||||
|
||||
|
@ -22,6 +22,11 @@
|
||||
|
||||
#include "usb_bulk_buffer.h"
|
||||
|
||||
uint8_t* const usb_bulk_buffer = (uint8_t*)0x20008000;
|
||||
/* Address of usb_bulk_buffer is set in ldscripts. If you change the name of this
|
||||
* variable, it won't be where it needs to be in the processor's address space,
|
||||
* unless you also adjust the ldscripts.
|
||||
*/
|
||||
uint8_t usb_bulk_buffer[32768];
|
||||
|
||||
const uint32_t usb_bulk_buffer_mask = 32768 - 1;
|
||||
volatile uint32_t usb_bulk_buffer_offset = 0;
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
extern uint8_t* const usb_bulk_buffer;
|
||||
extern uint8_t usb_bulk_buffer[32768];
|
||||
extern const uint32_t usb_bulk_buffer_mask;
|
||||
|
||||
extern volatile uint32_t usb_bulk_buffer_offset;
|
||||
|
Reference in New Issue
Block a user