Skip to content

Instantly share code, notes, and snippets.

@mskvortsov
Created October 29, 2018 09:04
Show Gist options
  • Save mskvortsov/5d395af6c394c1081aed0ae8f68266f1 to your computer and use it in GitHub Desktop.
Save mskvortsov/5d395af6c394c1081aed0ae8f68266f1 to your computer and use it in GitHub Desktop.
#!/bin/sh
LLVMROOT=/home/mskvortsov/msp430-clang/build
NEWLIB=/opt/msp430-newlib
TICCS=/opt/ti/ccsv8
PWD=$(pwd)
make \
BOARD=telosb \
CC=$LLVMROOT/bin/clang \
CFLAGS="-isystem $NEWLIB/msp430-elf/include -isystem $TICCS/ccs_base/msp430/include_gcc -D__MSP430F1611__ -integrated-as -Wno-unused-command-line-argument -Wno-atomic-alignment -include $PWD/bin/telosb/riotbuild/riotbuild.h -DMODULE_CORE_MSG -DMODULE_GNRC -DMODULE_GNRC_IPV6 -DMODULE_GNRC_ICMPV6 -DMODULE_GNRC_IPV6_NIB -DMODULE_GNRC_IPV6_NIB_6LN -DMODULE_GNRC_SIXLOWPAN -DMODULE_GNRC_SIXLOWPAN_CTX -O2" \
LINK="$TICCS/tools/compiler/msp430-gcc-7.3.1.24_linux64/bin/msp430-elf-gcc -L $TICCS/ccs_base/msp430/include_gcc" \
OBJCOPY=$LLVMROOT/bin/llvm-objcopy \
AR=$LLVMROOT/bin/llvm-ar \
SIZE=$LLVMROOT/bin/llvm-size \
QUIET=0
diff --git a/cpu/msp430_common/cpu.c b/cpu/msp430_common/cpu.c
index af2b83370..9ab8923f3 100644
--- a/cpu/msp430_common/cpu.c
+++ b/cpu/msp430_common/cpu.c
@@ -18,7 +18,7 @@
* for thread_yield_higher(), since we rely on the RETI instruction at the end
* of its execution, in the inlined __restore_context() sub-function
*/
-__attribute__((naked)) void thread_yield_higher(void)
+/*__attribute__((naked)) */void thread_yield_higher(void)
{
__asm__("push r2"); /* save SR */
__disable_irq();
diff --git a/cpu/msp430_common/include/cpu.h b/cpu/msp430_common/include/cpu.h
index 529c2183c..ca7698b68 100644
--- a/cpu/msp430_common/include/cpu.h
+++ b/cpu/msp430_common/include/cpu.h
@@ -43,7 +43,7 @@ extern "C" {
/**
* @brief Macro for defining interrupt service routines
*/
-#define ISR(a,b) void __attribute__((naked, interrupt (a))) b(void)
+#define ISR(a,b) void /*__attribute__((naked, interrupt (a))) */b(void)
/**
* @brief Globally disable IRQs
diff --git a/cpu/msp430_common/include/sys/cdefs.h b/cpu/msp430_common/include/sys/cdefs.h
index 06ad62ba3..93ecea56f 100644
--- a/cpu/msp430_common/include/sys/cdefs.h
+++ b/cpu/msp430_common/include/sys/cdefs.h
@@ -264,8 +264,10 @@ extern "C" {
#endif
#if __GNUC_PREREQ__(4, 3) || __has_attribute(__alloc_size__)
#define __alloc_size(x) __attribute__((__alloc_size__(x)))
+#define __alloc_size2(n, x) __attribute__((__alloc_size__(n, x)))
#else
#define __alloc_size(x)
+#define __alloc_size2(n, x)
#endif
#if __GNUC_PREREQ__(4, 9) || __has_attribute(__alloc_align__)
#define __alloc_align(x) __attribute__((__alloc_align__(x)))
@asl
Copy link

asl commented Oct 29, 2018

I think we need to set & use interrupt attribute :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment