Bläddra i källkod

+ freertos support for openocd

Sergey Alirzaev 5 år sedan
förälder
incheckning
771455cfbe
2 ändrade filer med 21 tillägg och 0 borttagningar
  1. 1 0
      Makefile.inc.stm32
  2. 20 0
      thirdparty/FreeRTOS/FreeRTOS-openocd.c

+ 1 - 0
Makefile.inc.stm32

@@ -14,6 +14,7 @@ LDFLAGS = $(COMMONFLAGS) -static
 LDFLAGS += -fno-exceptions -ffunction-sections -fdata-sections
 LDFLAGS += -static -Xlinker --gc-sections
 LDFLAGS += -Wl,-Map=$(BUILDDIR)/$(TARGET).map,--cref
+LDFLAGS += -Wl,--undefined=uxTopUsedPriority	# openocd freertos support
 ASFLAGS = $(COMMONFLAGS)
 
 

+ 20 - 0
thirdparty/FreeRTOS/FreeRTOS-openocd.c

@@ -0,0 +1,20 @@
+/*
+ * Since at least FreeRTOS V7.5.3 uxTopUsedPriority is no longer
+ * present in the kernel, so it has to be supplied by other means for
+ * OpenOCD's threads awareness.
+ *
+ * Add this file to your project, and, if you're using --gc-sections,
+ * ``--undefined=uxTopUsedPriority'' (or
+ * ``-Wl,--undefined=uxTopUsedPriority'' when using gcc for final
+ * linking) to your LDFLAGS; same with all the other symbols you need.
+ */
+
+#include "FreeRTOS.h"
+
+#ifdef __GNUC__
+#define USED __attribute__((used))
+#else
+#define USED
+#endif
+
+const int USED uxTopUsedPriority = configMAX_PRIORITIES - 1;