From 3ba8234cecde90467fb75d72055fa0c226ed16df Mon Sep 17 00:00:00 2001
From: NIIBE Yutaka <gniibe@fsij.org>
Date: Mon, 13 Jul 2015 16:45:32 +0900
Subject: sys_board and stm32 primer2

---
 example-cdc/sample.ld | 12 +++++++-----
 example-cdc/sys.c     |  5 ++++-
 2 files changed, 11 insertions(+), 6 deletions(-)

(limited to 'example-cdc')

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;
-- 
cgit v1.2.3