mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
ddf1fe252d
19733: cpu/msp430: reorganize code r=maribu a=maribu ### Contribution description RIOT supports two distinct families of the MSP430: The [MSP430 x1xx] MCU family and the [MSP430 F2xx/G2xx] MCU family. For both incompatible MCU families the code was located in the msp430fxyz folder, resulting in case of the UART driver in particularly bizarre code looking roughly like this: ```C #ifndef UART_USE_USCI /* implementation of x1xx peripheral ... */ #else /* implementation of F2xx/G2xx peripheral ... */ #endif /* zero shared code between both variants */ ``` This moves peripheral drivers shared between the two families to msp430_common and splits the SPI and UART driver into two MCU families. In addition, it cleans up the `msp430_regs.h` by dropping most of it and using the macros and symbols provided by the vendor header files. There is little reason for us to maintain constants when TI is already doing that. [MSP430 x1xx]: https://www.ti.com/lit/ug/slau049f/slau049f.pdf [MSP430 F2xx/G2xx]: https://www.ti.com/lit/ug/slau144k/slau144k.pdf 19747: gnrc/ipv6/nib: reset rs_sent counter also for not-6LN interfaces r=maribu a=fabian18 19769: cpu/nrf53: add initial support with nRF5340DK-APP board r=maribu a=dylad ### Contribution description This PR adds support for nRF5340 MCU and its associated Nordic development board, nRF5340DK. This MCU provides a dual Cortex-M33, one application core running at up to 128MHz, and one network core running at up to 64MHz. Peripherals are inherited from others Nordic MCUs families so it shouldn't be hard to add more of them in followup PRs. For now, only the minimal set of peripherals is supported: - GPIO / GPIO_IRQ - UART - TIMER ### Testing procedure Build the usual test application for the supported peripherals and flash the board. nRF5340DK provides two serial ports on its embedded debugger. RIOT's shell should be available on the first one (/dev/ttyACM0) ### Issues/PRs references #18576 #19267 19782: cpu/msp430: fix for ti's msp430-gcc-opensource package ld version r=maribu a=hugueslarrive ### Contribution description My msp430 toolchain (https://www.ti.com/tool/MSP430-GCC-OPENSOURCE) was broken by #19484: ``` hugues@p700:~/github/cpu_msp430_common/RIOT$ BOARD=msb-430 make -j64 -C examples/hello-world make : on entre dans le répertoire « /home/hugues/github/cpu_msp430_common/RIOT/examples/hello-world » Building application "hello-world" for "msb-430" with MCU "msp430fxyz". "make" -C /home/hugues/github/cpu_msp430_common/RIOT/boards/common/init "make" -C /home/hugues/github/cpu_msp430_common/RIOT/boards/msb-430 "make" -C /home/hugues/github/cpu_msp430_common/RIOT/core "make" -C /home/hugues/github/cpu_msp430_common/RIOT/core/lib "make" -C /home/hugues/github/cpu_msp430_common/RIOT/cpu/msp430fxyz "make" -C /home/hugues/github/cpu_msp430_common/RIOT/drivers "make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys "make" -C /home/hugues/github/cpu_msp430_common/RIOT/boards/common/msb-430 "make" -C /home/hugues/github/cpu_msp430_common/RIOT/drivers/periph_common "make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/auto_init "make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/div "make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/libc "make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/malloc_thread_safe "make" -C /home/hugues/github/cpu_msp430_common/RIOT/cpu/msp430_common "make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/newlib_syscalls_default "make" -C /home/hugues/github/cpu_msp430_common/RIOT/cpu/msp430fxyz/periph "make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/preprocessor "make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/stdio_uart "make" -C /home/hugues/github/cpu_msp430_common/RIOT/cpu/msp430_common/periph /opt/ti/msp430-gcc/bin/../lib/gcc/msp430-elf/9.3.1/../../../../msp430-elf/bin/ld: .rodata not found for insert collect2: error: ld returned 1 exit status make: *** [/home/hugues/github/cpu_msp430_common/RIOT/examples/hello-world/../../Makefile.include:761 : /home/hugues/github/cpu_msp430_common/RIOT/examples/hello-world/bin/msb-430/hello-world.elf] Erreur 1 make : on quitte le répertoire « /home/hugues/github/cpu_msp430_common/RIOT/examples/hello-world » hugues@p700:~/github/cpu_msp430_common/RIOT$ /opt/ti/msp430-gcc/msp430-elf/bin/ld --version GNU ld (Mitto Systems Limited - msp430-gcc 9.3.1.11) 2.34 Copyright (C) 2020 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or (at your option) a later version. This program has absolutely no warranty. hugues@p700:~/github/cpu_msp430_common/RIOT$ /opt/ti/msp430-gcc/msp430-elf/bin/ld --version | grep -Eo '[0-9]\.[0-9]+' 9.3 1.11 2.34 hugues@p700:~/github/cpu_msp430_common/RIOT$ /opt/ti/msp430-gcc/msp430-elf/bin/ld --version | grep -Eo '[0-9]\.[0-9]+$' 2.34 ``` ### Testing procedure ``` hugues@p700:~/github/cpu_msp430_common/RIOT$ BOARD=msb-430 make -j64 -C examples/hello-world make : on entre dans le répertoire « /home/hugues/github/cpu_msp430_common/RIOT/examples/hello-world » Building application "hello-world" for "msb-430" with MCU "msp430fxyz". "make" -C /home/hugues/github/cpu_msp430_common/RIOT/boards/common/init "make" -C /home/hugues/github/cpu_msp430_common/RIOT/boards/msb-430 "make" -C /home/hugues/github/cpu_msp430_common/RIOT/core "make" -C /home/hugues/github/cpu_msp430_common/RIOT/core/lib "make" -C /home/hugues/github/cpu_msp430_common/RIOT/cpu/msp430fxyz "make" -C /home/hugues/github/cpu_msp430_common/RIOT/drivers "make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys "make" -C /home/hugues/github/cpu_msp430_common/RIOT/boards/common/msb-430 "make" -C /home/hugues/github/cpu_msp430_common/RIOT/drivers/periph_common "make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/auto_init "make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/div "make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/libc "make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/malloc_thread_safe "make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/newlib_syscalls_default "make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/preprocessor "make" -C /home/hugues/github/cpu_msp430_common/RIOT/cpu/msp430_common "make" -C /home/hugues/github/cpu_msp430_common/RIOT/sys/stdio_uart "make" -C /home/hugues/github/cpu_msp430_common/RIOT/cpu/msp430fxyz/periph "make" -C /home/hugues/github/cpu_msp430_common/RIOT/cpu/msp430_common/periph text data bss dec hex filename 8612 722 866 10200 27d8 /home/hugues/github/cpu_msp430_common/RIOT/examples/hello-world/bin/msb-430/hello-world.elf make : on quitte le répertoire « /home/hugues/github/cpu_msp430_common/RIOT/examples/hello-world » ``` ### Issues/PRs references Introduced by #19484, highlighted in #16727. Co-authored-by: Marian Buschsieweke <marian.buschsieweke@posteo.net> Co-authored-by: Fabian Hüßler <fabian.huessler@ml-pa.com> Co-authored-by: Dylan Laduranty <dylan.laduranty@mesotic.com> Co-authored-by: Hugues Larrive <hlarrive@pm.me>
37 lines
1.4 KiB
Makefile
37 lines
1.4 KiB
Makefile
# Target architecture for the build. Use msp430-elf if you are unsure.
|
|
TARGET_ARCH_MSP430 ?= msp430-elf
|
|
TARGET_ARCH ?= $(TARGET_ARCH_MSP430)
|
|
|
|
MSP430_SUPPORT_FILES ?= $(RIOTCPU)/msp430/vendor/msp430-gcc-support-files
|
|
|
|
# define build specific options
|
|
CFLAGS_CPU = -mmcu=$(CPU_MODEL) -isystem $(MSP430_SUPPORT_FILES)/include
|
|
CFLAGS_LINK = -ffunction-sections -fdata-sections
|
|
CFLAGS_DBG ?= -g -gdwarf-2
|
|
CFLAGS_OPT ?= -Os
|
|
|
|
CFLAGS += $(CFLAGS_CPU) $(CFLAGS_LINK) $(CFLAGS_DBG) $(CFLAGS_OPT)
|
|
ASFLAGS += $(CFLAGS_CPU) --defsym $(CPU_MODEL)=1 $(CFLAGS_DBG)
|
|
|
|
BINUTILS_VERSION := $(shell $(PREFIX)ld --version | grep -Eo '[0-9]\.[0-9]+$$')
|
|
NEEDS_NEW_LINKER_SCRIPT := $(call version_is_greater_or_equal,$(BINUTILS_VERSION),2.40)
|
|
|
|
LINKFLAGS += $(CFLAGS_CPU) $(CFLAGS_DBG) $(CFLAGS_OPT)
|
|
LINKFLAGS += -Wl,--gc-sections
|
|
LINKFLAGS += -Wl,-L$(MSP430_SUPPORT_FILES)/include
|
|
LINKFLAGS += -Wl,-L$(RIOTCPU)/msp430/ldscripts
|
|
|
|
ifeq (1,$(NEEDS_NEW_LINKER_SCRIPT))
|
|
LINKFLAGS += -T riot-$(CPU_MODEL).ld
|
|
else
|
|
LINKFLAGS += -T $(MSP430_SUPPORT_FILES)/include/$(CPU_MODEL).ld
|
|
LINKFLAGS += -T $(RIOTCPU)/msp430/ldscripts/msp430_common.ld
|
|
LINKFLAGS += -T $(RIOTCPU)/msp430/ldscripts/$(CPU_FAM).ld
|
|
LINKFLAGS += $(RIOTCPU)/msp430/ldscripts/xfa.ld
|
|
endif
|
|
|
|
OPTIONAL_CFLAGS_BLACKLIST += -fdiagnostics-color
|
|
OPTIONAL_CFLAGS_BLACKLIST += -Wformat-overflow
|
|
OPTIONAL_CFLAGS_BLACKLIST += -Wformat-truncation
|
|
OPTIONAL_CFLAGS_BLACKLIST += -gz
|