aboutsummaryrefslogtreecommitdiff
path: root/example-cdc
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2015-07-13 16:45:32 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2015-07-13 16:45:32 +0900
commit3ba8234cecde90467fb75d72055fa0c226ed16df (patch)
treef6c184a72d8759a59b3b4db109fe1bfaab6d8032 /example-cdc
parent2bb0e0de5d7d25d0bb036e6ee9cc0c94b62375ec (diff)
sys_board and stm32 primer2
Diffstat (limited to 'example-cdc')
-rw-r--r--example-cdc/sample.ld12
-rw-r--r--example-cdc/sys.c5
2 files changed, 11 insertions, 6 deletions
diff --git a/example-cdc/sample.ld b/example-cdc/sample.ld
index 7675dbb..55ad7aa 100644
--- a/example-cdc/sample.ld
+++ b/example-cdc/sample.ld
@@ -25,15 +25,16 @@ SECTIONS
{
. = 0;
- .sys : ALIGN(16) SUBALIGN(16)
+ .sys : ALIGN(16) SUBALIGN(8)
{
- _sys = .;
- KEEP(*(.vectors))
+ _sys = .;
+ KEEP(*(.vectors))
. = ALIGN(16);
- *(.sys.version)
+ KEEP(*(.sys.version))
+ KEEP(*(.sys.board))
build/sys.o(.text)
build/sys.o(.text.*)
- build/sys.o(.rodata)
+ build/sys.o(.rodata)
build/sys.o(.rodata.*)
. = ALIGN(1024);
*(.sys.0)
@@ -59,6 +60,7 @@ SECTIONS
*(.glue_7t)
*(.glue_7)
*(.gcc*)
+ . = ALIGN(8);
} > flash
.ARM.extab : {*(.ARM.extab* .gnu.linkonce.armextab.*)} > flash
diff --git a/example-cdc/sys.c b/example-cdc/sys.c
index 0f0c1ac..19c31b1 100644
--- a/example-cdc/sys.c
+++ b/example-cdc/sys.c
@@ -415,7 +415,10 @@ handler vector[] __attribute__ ((section(".vectors"))) = {
const uint8_t sys_version[8] __attribute__((section(".sys.version"))) = {
3*2+2, /* bLength */
- 0x03, /* bDescriptorType = USB_STRING_DESCRIPTOR_TYPE*/
+ 0x03, /* bDescriptorType = USB_STRING_DESCRIPTOR_TYPE */
/* sys version: "2.0" */
'2', 0, '.', 0, '0', 0,
};
+
+const uint8_t __attribute__((section(".sys.board")))
+sys_board[] = BOARD_NAME;