Browse Source

Update to ChibiOS 17.6.x

Technically I updated to a development version somewhere between 17.6.3
and 17.6.4, but I don't doubt its stability.

This is a good update because I'd like users of the library to be
confident that it works with the latest version of ChibiOS.
Interestingly, none of the changes I made were in the library code, so
it did before, but now I know for sure.

I'm unclear as to whether I can now get rid of the INT_N thread in favor
of a pin interrupt.  I'll have to see if I can, or if that will have to
wait for still more ChibiOS updates.
Clara Hobbs 6 years ago
parent
commit
1783920e6c
12 changed files with 193 additions and 69 deletions
  1. 1
    1
      .gitmodules
  2. 1
    1
      ChibiOS
  3. 12
    5
      Makefile
  4. 1
    1
      boards/PD_BUDDY_SINK/cfg/board.chcfg
  5. 42
    21
      chconf.h
  6. 12
    5
      halconf.h
  7. 46
    11
      ld/STM32F072x8.ld
  8. 46
    11
      ld/STM32F072xB.ld
  9. 16
    4
      mcuconf.h
  10. 1
    0
      src/config.h
  11. 4
    4
      src/shell.c
  12. 11
    5
      src/usbcfg.c

+ 1
- 1
.gitmodules View File

1
 [submodule "ChibiOS"]
1
 [submodule "ChibiOS"]
2
 	path = ChibiOS
2
 	path = ChibiOS
3
 	url = https://github.com/ChibiOS/ChibiOS.git
3
 	url = https://github.com/ChibiOS/ChibiOS.git
4
-	branch = stable_16.1.x
4
+	branch = stable_17.6.x

+ 1
- 1
ChibiOS

1
-Subproject commit ad728cc9bce3fb2be49d67ea55e788b6772007e2
1
+Subproject commit 5b4a1f5837a83f32fd5e5e439eaa370cc7399237

+ 12
- 5
Makefile View File

69
   USE_EXCEPTIONS_STACKSIZE = 0x400
69
   USE_EXCEPTIONS_STACKSIZE = 0x400
70
 endif
70
 endif
71
 
71
 
72
+# Enables the use of FPU (no, softfp, hard).
73
+ifeq ($(USE_FPU),)
74
+  USE_FPU = no
75
+endif
76
+
72
 #
77
 #
73
 # Architecture or project specific options
78
 # Architecture or project specific options
74
 ##############################################################################
79
 ##############################################################################
84
 CHIBIOS = ChibiOS
89
 CHIBIOS = ChibiOS
85
 PDBLIB = lib
90
 PDBLIB = lib
86
 # Startup files.
91
 # Startup files.
87
-include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/startup_stm32f0xx.mk
92
+include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f0xx.mk
88
 # HAL-OSAL files (optional).
93
 # HAL-OSAL files (optional).
89
 include $(CHIBIOS)/os/hal/hal.mk
94
 include $(CHIBIOS)/os/hal/hal.mk
90
 include $(CHIBIOS)/os/hal/ports/STM32/STM32F0xx/platform.mk
95
 include $(CHIBIOS)/os/hal/ports/STM32/STM32F0xx/platform.mk
92
 include $(CHIBIOS)/os/hal/osal/rt/osal.mk
97
 include $(CHIBIOS)/os/hal/osal/rt/osal.mk
93
 # RTOS files (optional).
98
 # RTOS files (optional).
94
 include $(CHIBIOS)/os/rt/rt.mk
99
 include $(CHIBIOS)/os/rt/rt.mk
95
-include $(CHIBIOS)/os/rt/ports/ARMCMx/compilers/GCC/mk/port_v6m.mk
100
+include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v6m.mk
96
 # Other files (optional).
101
 # Other files (optional).
97
 include $(CHIBIOS)/test/rt/test.mk
102
 include $(CHIBIOS)/test/rt/test.mk
98
 include $(PDBLIB)/pd-buddy.mk
103
 include $(PDBLIB)/pd-buddy.mk
139
 TCPPSRC =
144
 TCPPSRC =
140
 
145
 
141
 # List ASM source files here
146
 # List ASM source files here
142
-ASMSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
147
+ASMSRC =
148
+ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM)
143
 
149
 
144
-INCDIR = $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
150
+INCDIR = $(CHIBIOS)/os/license \
151
+         $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \
145
          $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
152
          $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \
146
          $(CHIBIOS)/os/hal/lib/streams $(CHIBIOS)/os/various \
153
          $(CHIBIOS)/os/hal/lib/streams $(CHIBIOS)/os/various \
147
 	 $(PDBINC) \
154
 	 $(PDBINC) \
213
 # End of user defines
220
 # End of user defines
214
 ##############################################################################
221
 ##############################################################################
215
 
222
 
216
-RULESPATH = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC
223
+RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC
217
 include $(RULESPATH)/rules.mk
224
 include $(RULESPATH)/rules.mk
218
 
225
 
219
 # Special rules follow
226
 # Special rules follow

+ 1
- 1
boards/PD_BUDDY_SINK/cfg/board.chcfg View File

6
   <configuration_settings>
6
   <configuration_settings>
7
     <templates_path>resources/gencfg/processors/boards/stm32f0xx/templates</templates_path>
7
     <templates_path>resources/gencfg/processors/boards/stm32f0xx/templates</templates_path>
8
     <output_path>..</output_path>
8
     <output_path>..</output_path>
9
-    <hal_version>3.0.x</hal_version>
9
+    <hal_version>5.0.x</hal_version>
10
   </configuration_settings>
10
   </configuration_settings>
11
   <board_name>PD Buddy Sink</board_name>
11
   <board_name>PD Buddy Sink</board_name>
12
   <board_id>PD_BUDDY_SINK</board_id>
12
   <board_id>PD_BUDDY_SINK</board_id>

+ 42
- 21
chconf.h View File

17
  */
17
  */
18
 
18
 
19
 /*
19
 /*
20
-    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
20
+    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
21
 
21
 
22
     Licensed under the Apache License, Version 2.0 (the "License");
22
     Licensed under the Apache License, Version 2.0 (the "License");
23
     you may not use this file except in compliance with the License.
23
     you may not use this file except in compliance with the License.
33
 */
33
 */
34
 
34
 
35
 /**
35
 /**
36
- * @file    chconf.h
36
+ * @file    templates/chconf.h
37
  * @brief   Configuration file template.
37
  * @brief   Configuration file template.
38
  * @details A copy of this file must be placed in each project directory, it
38
  * @details A copy of this file must be placed in each project directory, it
39
  *          contains the application specific kernel settings.
39
  *          contains the application specific kernel settings.
43
  * @{
43
  * @{
44
  */
44
  */
45
 
45
 
46
-#ifndef _CHCONF_H_
47
-#define _CHCONF_H_
46
+#ifndef CHCONF_H
47
+#define CHCONF_H
48
+
49
+#define _CHIBIOS_RT_CONF_
48
 
50
 
49
 /*===========================================================================*/
51
 /*===========================================================================*/
50
 /**
52
 /**
280
  */
282
  */
281
 #define CH_CFG_USE_MAILBOXES                TRUE
283
 #define CH_CFG_USE_MAILBOXES                TRUE
282
 
284
 
283
-/**
284
- * @brief   I/O Queues APIs.
285
- * @details If enabled then the I/O queues APIs are included in the kernel.
286
- *
287
- * @note    The default is @p TRUE.
288
- */
289
-#define CH_CFG_USE_QUEUES                   TRUE
290
-
291
 /**
285
 /**
292
  * @brief   Core Memory Manager APIs.
286
  * @brief   Core Memory Manager APIs.
293
  * @details If enabled then the core memory manager APIs are included
287
  * @details If enabled then the core memory manager APIs are included
375
 
369
 
376
 /**
370
 /**
377
  * @brief   Debug option, trace buffer.
371
  * @brief   Debug option, trace buffer.
378
- * @details If enabled then the context switch circular trace buffer is
379
- *          activated.
372
+ * @details If enabled then the trace buffer is activated.
380
  *
373
  *
381
- * @note    The default is @p FALSE.
374
+ * @note    The default is @p CH_DBG_TRACE_MASK_DISABLED.
375
+ */
376
+#define CH_DBG_TRACE_MASK                   CH_DBG_TRACE_MASK_DISABLED
377
+
378
+/**
379
+ * @brief   Trace buffer entries.
380
+ * @note    The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
381
+ *          different from @p CH_DBG_TRACE_MASK_DISABLED.
382
  */
382
  */
383
-#define CH_DBG_ENABLE_TRACE                 FALSE
383
+#define CH_DBG_TRACE_BUFFER_SIZE            128
384
 
384
 
385
 /**
385
 /**
386
  * @brief   Debug option, stack checks.
386
  * @brief   Debug option, stack checks.
445
 /**
445
 /**
446
  * @brief   Threads finalization hook.
446
  * @brief   Threads finalization hook.
447
  * @details User finalization code added to the @p chThdExit() API.
447
  * @details User finalization code added to the @p chThdExit() API.
448
- *
449
- * @note    It is inserted into lock zone.
450
- * @note    It is also invoked when the threads simply return in order to
451
- *          terminate.
452
  */
448
  */
453
 #define CH_CFG_THREAD_EXIT_HOOK(tp) {                                       \
449
 #define CH_CFG_THREAD_EXIT_HOOK(tp) {                                       \
454
   /* Add threads finalization code here.*/                                  \
450
   /* Add threads finalization code here.*/                                  \
462
   /* Context switch code here.*/                                            \
458
   /* Context switch code here.*/                                            \
463
 }
459
 }
464
 
460
 
461
+/**
462
+ * @brief   ISR enter hook.
463
+ */
464
+#define CH_CFG_IRQ_PROLOGUE_HOOK() {                                        \
465
+  /* IRQ prologue code here.*/                                              \
466
+}
467
+
468
+/**
469
+ * @brief   ISR exit hook.
470
+ */
471
+#define CH_CFG_IRQ_EPILOGUE_HOOK() {                                        \
472
+  /* IRQ epilogue code here.*/                                              \
473
+}
474
+
465
 /**
475
 /**
466
  * @brief   Idle thread enter hook.
476
  * @brief   Idle thread enter hook.
467
  * @note    This hook is invoked within a critical zone, no OS functions
477
  * @note    This hook is invoked within a critical zone, no OS functions
469
  * @note    This macro can be used to activate a power saving mode.
479
  * @note    This macro can be used to activate a power saving mode.
470
  */
480
  */
471
 #define CH_CFG_IDLE_ENTER_HOOK() {                                          \
481
 #define CH_CFG_IDLE_ENTER_HOOK() {                                          \
482
+  /* Idle-enter code here.*/                                                \
472
 }
483
 }
473
 
484
 
474
 /**
485
 /**
478
  * @note    This macro can be used to deactivate a power saving mode.
489
  * @note    This macro can be used to deactivate a power saving mode.
479
  */
490
  */
480
 #define CH_CFG_IDLE_LEAVE_HOOK() {                                          \
491
 #define CH_CFG_IDLE_LEAVE_HOOK() {                                          \
492
+  /* Idle-leave code here.*/                                                \
481
 }
493
 }
482
 
494
 
483
 /**
495
 /**
506
   /* System halt code here.*/                                               \
518
   /* System halt code here.*/                                               \
507
 }
519
 }
508
 
520
 
521
+/**
522
+ * @brief   Trace hook.
523
+ * @details This hook is invoked each time a new record is written in the
524
+ *          trace buffer.
525
+ */
526
+#define CH_CFG_TRACE_HOOK(tep) {                                            \
527
+  /* Trace code here.*/                                                     \
528
+}
529
+
509
 /** @} */
530
 /** @} */
510
 
531
 
511
 /*===========================================================================*/
532
 /*===========================================================================*/
512
 /* Port-specific settings (override port settings defaulted in chcore.h).    */
533
 /* Port-specific settings (override port settings defaulted in chcore.h).    */
513
 /*===========================================================================*/
534
 /*===========================================================================*/
514
 
535
 
515
-#endif  /* _CHCONF_H_ */
536
+#endif  /* CHCONF_H */
516
 
537
 
517
 /** @} */
538
 /** @} */

+ 12
- 5
halconf.h View File

17
  */
17
  */
18
 
18
 
19
 /*
19
 /*
20
-    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
20
+    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
21
 
21
 
22
     Licensed under the Apache License, Version 2.0 (the "License");
22
     Licensed under the Apache License, Version 2.0 (the "License");
23
     you may not use this file except in compliance with the License.
23
     you may not use this file except in compliance with the License.
33
 */
33
 */
34
 
34
 
35
 /**
35
 /**
36
- * @file    halconf.h
36
+ * @file    templates/halconf.h
37
  * @brief   HAL configuration header.
37
  * @brief   HAL configuration header.
38
  * @details HAL configuration file, this file allows to enable or disable the
38
  * @details HAL configuration file, this file allows to enable or disable the
39
  *          various device drivers from your application. You may also use
39
  *          various device drivers from your application. You may also use
43
  * @{
43
  * @{
44
  */
44
  */
45
 
45
 
46
-#ifndef _HALCONF_H_
47
-#define _HALCONF_H_
46
+#ifndef HALCONF_H
47
+#define HALCONF_H
48
 
48
 
49
 #include "mcuconf.h"
49
 #include "mcuconf.h"
50
 
50
 
132
 #define HAL_USE_PWM                 FALSE
132
 #define HAL_USE_PWM                 FALSE
133
 #endif
133
 #endif
134
 
134
 
135
+/**
136
+ * @brief   Enables the QSPI subsystem.
137
+ */
138
+#if !defined(HAL_USE_QSPI) || defined(__DOXYGEN__)
139
+#define HAL_USE_QSPI                FALSE
140
+#endif
141
+
135
 /**
142
 /**
136
  * @brief   Enables the RTC subsystem.
143
  * @brief   Enables the RTC subsystem.
137
  */
144
  */
394
 #define USB_USE_WAIT                FALSE
401
 #define USB_USE_WAIT                FALSE
395
 #endif
402
 #endif
396
 
403
 
397
-#endif /* _HALCONF_H_ */
404
+#endif /* HALCONF_H */
398
 
405
 
399
 /** @} */
406
 /** @} */

+ 46
- 11
ld/STM32F072x8.ld View File

1
 /*
1
 /*
2
-    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
2
+    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
3
 
3
 
4
     Licensed under the Apache License, Version 2.0 (the "License");
4
     Licensed under the Apache License, Version 2.0 (the "License");
5
     you may not use this file except in compliance with the License.
5
     you may not use this file except in compliance with the License.
22
  */
22
  */
23
 MEMORY
23
 MEMORY
24
 {
24
 {
25
-    flash : org = 0x08000000, len = 62k
26
-    ram0  : org = 0x20000000, len = 16k
27
-    ram1  : org = 0x00000000, len = 0
28
-    ram2  : org = 0x00000000, len = 0
29
-    ram3  : org = 0x00000000, len = 0
30
-    ram4  : org = 0x00000000, len = 0
31
-    ram5  : org = 0x00000000, len = 0
32
-    ram6  : org = 0x00000000, len = 0
33
-    ram7  : org = 0x00000000, len = 0
25
+    flash0  : org = 0x08000000, len = 62k
26
+    flash1  : org = 0x00000000, len = 0
27
+    flash2  : org = 0x00000000, len = 0
28
+    flash3  : org = 0x00000000, len = 0
29
+    flash4  : org = 0x00000000, len = 0
30
+    flash5  : org = 0x00000000, len = 0
31
+    flash6  : org = 0x00000000, len = 0
32
+    flash7  : org = 0x00000000, len = 0
33
+    ram0    : org = 0x20000000, len = 16k
34
+    ram1    : org = 0x00000000, len = 0
35
+    ram2    : org = 0x00000000, len = 0
36
+    ram3    : org = 0x00000000, len = 0
37
+    ram4    : org = 0x00000000, len = 0
38
+    ram5    : org = 0x00000000, len = 0
39
+    ram6    : org = 0x00000000, len = 0
40
+    ram7    : org = 0x00000000, len = 0
34
 }
41
 }
35
 
42
 
43
+/* For each data/text section two region are defined, a virtual region
44
+   and a load region (_LMA suffix).*/
45
+
46
+/* Flash region to be used for exception vectors.*/
47
+REGION_ALIAS("VECTORS_FLASH", flash0);
48
+REGION_ALIAS("VECTORS_FLASH_LMA", flash0);
49
+
50
+/* Flash region to be used for constructors and destructors.*/
51
+REGION_ALIAS("XTORS_FLASH", flash0);
52
+REGION_ALIAS("XTORS_FLASH_LMA", flash0);
53
+
54
+/* Flash region to be used for code text.*/
55
+REGION_ALIAS("TEXT_FLASH", flash0);
56
+REGION_ALIAS("TEXT_FLASH_LMA", flash0);
57
+
58
+/* Flash region to be used for read only data.*/
59
+REGION_ALIAS("RODATA_FLASH", flash0);
60
+REGION_ALIAS("RODATA_FLASH_LMA", flash0);
61
+
62
+/* Flash region to be used for various.*/
63
+REGION_ALIAS("VARIOUS_FLASH", flash0);
64
+REGION_ALIAS("VARIOUS_FLASH_LMA", flash0);
65
+
66
+/* Flash region to be used for RAM(n) initialization data.*/
67
+REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0);
68
+
36
 /* RAM region to be used for Main stack. This stack accommodates the processing
69
 /* RAM region to be used for Main stack. This stack accommodates the processing
37
-   of all exceptions and interrupts*/
70
+   of all exceptions and interrupts.*/
38
 REGION_ALIAS("MAIN_STACK_RAM", ram0);
71
 REGION_ALIAS("MAIN_STACK_RAM", ram0);
39
 
72
 
40
 /* RAM region to be used for the process stack. This is the stack used by
73
 /* RAM region to be used for the process stack. This is the stack used by
43
 
76
 
44
 /* RAM region to be used for data segment.*/
77
 /* RAM region to be used for data segment.*/
45
 REGION_ALIAS("DATA_RAM", ram0);
78
 REGION_ALIAS("DATA_RAM", ram0);
79
+REGION_ALIAS("DATA_RAM_LMA", flash0);
46
 
80
 
47
 /* RAM region to be used for BSS segment.*/
81
 /* RAM region to be used for BSS segment.*/
48
 REGION_ALIAS("BSS_RAM", ram0);
82
 REGION_ALIAS("BSS_RAM", ram0);
50
 /* RAM region to be used for the default heap.*/
84
 /* RAM region to be used for the default heap.*/
51
 REGION_ALIAS("HEAP_RAM", ram0);
85
 REGION_ALIAS("HEAP_RAM", ram0);
52
 
86
 
87
+/* Generic rules inclusion.*/
53
 INCLUDE rules.ld
88
 INCLUDE rules.ld

+ 46
- 11
ld/STM32F072xB.ld View File

1
 /*
1
 /*
2
-    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
2
+    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
3
 
3
 
4
     Licensed under the Apache License, Version 2.0 (the "License");
4
     Licensed under the Apache License, Version 2.0 (the "License");
5
     you may not use this file except in compliance with the License.
5
     you may not use this file except in compliance with the License.
22
  */
22
  */
23
 MEMORY
23
 MEMORY
24
 {
24
 {
25
-    flash : org = 0x08000000, len = 126k
26
-    ram0  : org = 0x20000000, len = 16k
27
-    ram1  : org = 0x00000000, len = 0
28
-    ram2  : org = 0x00000000, len = 0
29
-    ram3  : org = 0x00000000, len = 0
30
-    ram4  : org = 0x00000000, len = 0
31
-    ram5  : org = 0x00000000, len = 0
32
-    ram6  : org = 0x00000000, len = 0
33
-    ram7  : org = 0x00000000, len = 0
25
+    flash0  : org = 0x08000000, len = 126k
26
+    flash1  : org = 0x00000000, len = 0
27
+    flash2  : org = 0x00000000, len = 0
28
+    flash3  : org = 0x00000000, len = 0
29
+    flash4  : org = 0x00000000, len = 0
30
+    flash5  : org = 0x00000000, len = 0
31
+    flash6  : org = 0x00000000, len = 0
32
+    flash7  : org = 0x00000000, len = 0
33
+    ram0    : org = 0x20000000, len = 16k
34
+    ram1    : org = 0x00000000, len = 0
35
+    ram2    : org = 0x00000000, len = 0
36
+    ram3    : org = 0x00000000, len = 0
37
+    ram4    : org = 0x00000000, len = 0
38
+    ram5    : org = 0x00000000, len = 0
39
+    ram6    : org = 0x00000000, len = 0
40
+    ram7    : org = 0x00000000, len = 0
34
 }
41
 }
35
 
42
 
43
+/* For each data/text section two region are defined, a virtual region
44
+   and a load region (_LMA suffix).*/
45
+
46
+/* Flash region to be used for exception vectors.*/
47
+REGION_ALIAS("VECTORS_FLASH", flash0);
48
+REGION_ALIAS("VECTORS_FLASH_LMA", flash0);
49
+
50
+/* Flash region to be used for constructors and destructors.*/
51
+REGION_ALIAS("XTORS_FLASH", flash0);
52
+REGION_ALIAS("XTORS_FLASH_LMA", flash0);
53
+
54
+/* Flash region to be used for code text.*/
55
+REGION_ALIAS("TEXT_FLASH", flash0);
56
+REGION_ALIAS("TEXT_FLASH_LMA", flash0);
57
+
58
+/* Flash region to be used for read only data.*/
59
+REGION_ALIAS("RODATA_FLASH", flash0);
60
+REGION_ALIAS("RODATA_FLASH_LMA", flash0);
61
+
62
+/* Flash region to be used for various.*/
63
+REGION_ALIAS("VARIOUS_FLASH", flash0);
64
+REGION_ALIAS("VARIOUS_FLASH_LMA", flash0);
65
+
66
+/* Flash region to be used for RAM(n) initialization data.*/
67
+REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0);
68
+
36
 /* RAM region to be used for Main stack. This stack accommodates the processing
69
 /* RAM region to be used for Main stack. This stack accommodates the processing
37
-   of all exceptions and interrupts*/
70
+   of all exceptions and interrupts.*/
38
 REGION_ALIAS("MAIN_STACK_RAM", ram0);
71
 REGION_ALIAS("MAIN_STACK_RAM", ram0);
39
 
72
 
40
 /* RAM region to be used for the process stack. This is the stack used by
73
 /* RAM region to be used for the process stack. This is the stack used by
43
 
76
 
44
 /* RAM region to be used for data segment.*/
77
 /* RAM region to be used for data segment.*/
45
 REGION_ALIAS("DATA_RAM", ram0);
78
 REGION_ALIAS("DATA_RAM", ram0);
79
+REGION_ALIAS("DATA_RAM_LMA", flash0);
46
 
80
 
47
 /* RAM region to be used for BSS segment.*/
81
 /* RAM region to be used for BSS segment.*/
48
 REGION_ALIAS("BSS_RAM", ram0);
82
 REGION_ALIAS("BSS_RAM", ram0);
50
 /* RAM region to be used for the default heap.*/
84
 /* RAM region to be used for the default heap.*/
51
 REGION_ALIAS("HEAP_RAM", ram0);
85
 REGION_ALIAS("HEAP_RAM", ram0);
52
 
86
 
87
+/* Generic rules inclusion.*/
53
 INCLUDE rules.ld
88
 INCLUDE rules.ld

+ 16
- 4
mcuconf.h View File

17
  */
17
  */
18
 
18
 
19
 /*
19
 /*
20
-    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
20
+    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
21
 
21
 
22
     Licensed under the Apache License, Version 2.0 (the "License");
22
     Licensed under the Apache License, Version 2.0 (the "License");
23
     you may not use this file except in compliance with the License.
23
     you may not use this file except in compliance with the License.
32
     limitations under the License.
32
     limitations under the License.
33
 */
33
 */
34
 
34
 
35
-#ifndef _MCUCONF_H_
36
-#define _MCUCONF_H_
35
+#ifndef MCUCONF_H
36
+#define MCUCONF_H
37
 
37
 
38
 /*
38
 /*
39
  * STM32F0xx drivers configuration.
39
  * STM32F0xx drivers configuration.
211
  */
211
  */
212
 #define STM32_SERIAL_USE_USART1             FALSE
212
 #define STM32_SERIAL_USE_USART1             FALSE
213
 #define STM32_SERIAL_USE_USART2             FALSE
213
 #define STM32_SERIAL_USE_USART2             FALSE
214
+#define STM32_SERIAL_USE_USART3             FALSE
215
+#define STM32_SERIAL_USE_UART4              FALSE
214
 #define STM32_SERIAL_USART1_PRIORITY        3
216
 #define STM32_SERIAL_USART1_PRIORITY        3
215
 #define STM32_SERIAL_USART2_PRIORITY        3
217
 #define STM32_SERIAL_USART2_PRIORITY        3
218
+#define STM32_SERIAL_USART3_8_PRIORITY      3
216
 
219
 
217
 /*
220
 /*
218
  * SPI driver system settings.
221
  * SPI driver system settings.
240
  */
243
  */
241
 #define STM32_UART_USE_USART1               FALSE
244
 #define STM32_UART_USE_USART1               FALSE
242
 #define STM32_UART_USE_USART2               FALSE
245
 #define STM32_UART_USE_USART2               FALSE
246
+#define STM32_UART_USE_USART3               FALSE
247
+#define STM32_UART_USE_UART4                FALSE
243
 #define STM32_UART_USART1_IRQ_PRIORITY      3
248
 #define STM32_UART_USART1_IRQ_PRIORITY      3
244
 #define STM32_UART_USART2_IRQ_PRIORITY      3
249
 #define STM32_UART_USART2_IRQ_PRIORITY      3
250
+#define STM32_UART_USART3_8_IRQ_PRIORITY    3
245
 #define STM32_UART_USART1_DMA_PRIORITY      0
251
 #define STM32_UART_USART1_DMA_PRIORITY      0
246
 #define STM32_UART_USART2_DMA_PRIORITY      0
252
 #define STM32_UART_USART2_DMA_PRIORITY      0
253
+#define STM32_UART_USART3_DMA_PRIORITY      0
254
+#define STM32_UART_UART4_DMA_PRIORITY       0
247
 #define STM32_UART_USART1_RX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 3)
255
 #define STM32_UART_USART1_RX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 3)
248
 #define STM32_UART_USART1_TX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 2)
256
 #define STM32_UART_USART1_TX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 2)
249
 #define STM32_UART_USART2_RX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 5)
257
 #define STM32_UART_USART2_RX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 5)
250
 #define STM32_UART_USART2_TX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 4)
258
 #define STM32_UART_USART2_TX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 4)
259
+#define STM32_UART_USART3_RX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 3)
260
+#define STM32_UART_USART3_TX_DMA_STREAM     STM32_DMA_STREAM_ID(1, 2)
261
+#define STM32_UART_UART4_RX_DMA_STREAM      STM32_DMA_STREAM_ID(1, 6)
262
+#define STM32_UART_UART4_TX_DMA_STREAM      STM32_DMA_STREAM_ID(1, 7)
251
 #define STM32_UART_DMA_ERROR_HOOK(uartp)    osalSysHalt("DMA failure")
263
 #define STM32_UART_DMA_ERROR_HOOK(uartp)    osalSysHalt("DMA failure")
252
 
264
 
253
 /*
265
 /*
262
  */
274
  */
263
 #define STM32_WDG_USE_IWDG                  FALSE
275
 #define STM32_WDG_USE_IWDG                  FALSE
264
 
276
 
265
-#endif /* _MCUCONF_H_ */
277
+#endif /* MCUCONF_H */

+ 1
- 0
src/config.h View File

22
 #include <stdint.h>
22
 #include <stdint.h>
23
 
23
 
24
 #include <ch.h>
24
 #include <ch.h>
25
+#include <hal.h>
25
 
26
 
26
 
27
 
27
 /*
28
 /*

+ 4
- 4
src/shell.c View File

674
         /* Delete a character if ASCII backspace or delete is received */
674
         /* Delete a character if ASCII backspace or delete is received */
675
         if ((c == '\b') || (c == '\x7F')) {
675
         if ((c == '\b') || (c == '\x7F')) {
676
             if (p != line) {
676
             if (p != line) {
677
-                chSequentialStreamPut(chp, 0x08);
678
-                chSequentialStreamPut(chp, 0x20);
679
-                chSequentialStreamPut(chp, 0x08);
677
+                streamPut(chp, 0x08);
678
+                streamPut(chp, 0x20);
679
+                streamPut(chp, 0x08);
680
                 p--;
680
                 p--;
681
             }
681
             }
682
             continue;
682
             continue;
692
             continue;
692
             continue;
693
         /* If there's room in the line buffer, append the new character */
693
         /* If there's room in the line buffer, append the new character */
694
         if (p < line + size - 1) {
694
         if (p < line + size - 1) {
695
-            chSequentialStreamPut(chp, c);
695
+            streamPut(chp, c);
696
             *p++ = (char)c;
696
             *p++ = (char)c;
697
         }
697
         }
698
     }
698
     }

+ 11
- 5
src/usbcfg.c View File

17
  */
17
  */
18
 
18
 
19
 /*
19
 /*
20
-    ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
20
+    ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
21
 
21
 
22
     Licensed under the Apache License, Version 2.0 (the "License");
22
     Licensed under the Apache License, Version 2.0 (the "License");
23
     you may not use this file except in compliance with the License.
23
     you may not use this file except in compliance with the License.
292
     extern SerialUSBDriver SDU1;
292
     extern SerialUSBDriver SDU1;
293
 
293
 
294
     switch (event) {
294
     switch (event) {
295
-        case USB_EVENT_RESET:
296
-            return;
297
         case USB_EVENT_ADDRESS:
295
         case USB_EVENT_ADDRESS:
298
             return;
296
             return;
299
         case USB_EVENT_CONFIGURED:
297
         case USB_EVENT_CONFIGURED:
310
 
308
 
311
             chSysUnlockFromISR();
309
             chSysUnlockFromISR();
312
             return;
310
             return;
311
+        case USB_EVENT_RESET:
312
+            /* Falls into.*/
313
         case USB_EVENT_UNCONFIGURED:
313
         case USB_EVENT_UNCONFIGURED:
314
-            return;
314
+            /* Falls into.*/
315
         case USB_EVENT_SUSPEND:
315
         case USB_EVENT_SUSPEND:
316
             chSysLockFromISR();
316
             chSysLockFromISR();
317
 
317
 
318
             /* Disconnection event on suspend.*/
318
             /* Disconnection event on suspend.*/
319
-            sduDisconnectI(&SDU1);
319
+            sduSuspendHookI(&SDU1);
320
 
320
 
321
             chSysUnlockFromISR();
321
             chSysUnlockFromISR();
322
             return;
322
             return;
323
         case USB_EVENT_WAKEUP:
323
         case USB_EVENT_WAKEUP:
324
+            chSysLockFromISR();
325
+
326
+            /* Disconnection event on suspend.*/
327
+            sduWakeupHookI(&SDU1);
328
+
329
+            chSysUnlockFromISR();
324
             return;
330
             return;
325
         case USB_EVENT_STALLED:
331
         case USB_EVENT_STALLED:
326
             return;
332
             return;

Loading…
Cancel
Save