Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpu/msp430/f2xx: clean up periph_uart,periph_spi #20357

Merged
merged 2 commits into from
Mar 28, 2024

Conversation

maribu
Copy link
Member

@maribu maribu commented Feb 7, 2024

Contribution description

This cleans up the USCI based UART and SPI implementations and allows
multiple instances of either interface to be configured by the
boards. In addition, it allows sharing the USCI peripherals to provide
multiple serial interfaces with the same hardware (round-robin).

Testing procedure

With an PCB sandwich consisting of an olimex-msp430-h2618 plugged into our Arduino UNO adapter and our peripheral selftest shield plugged into the other side of said adapter (so that SPI MISO and MOSI are conntected):

make BOARD=olimex-msp430-h2618 -C tests/periph/spi flash term
make: Entering directory '/home/maribu/Repos/software/RIOT/msp430/tests/periph/spi'
Building application "tests_spi" for "olimex-msp430-h2618" with MCU "msp430".

"make" -C /home/maribu/Repos/software/RIOT/msp430/boards/common/init
"make" -C /home/maribu/Repos/software/RIOT/msp430/boards/olimex-msp430-h2618
"make" -C /home/maribu/Repos/software/RIOT/msp430/core
"make" -C /home/maribu/Repos/software/RIOT/msp430/core/lib
"make" -C /home/maribu/Repos/software/RIOT/msp430/cpu/msp430
"make" -C /home/maribu/Repos/software/RIOT/msp430/cpu/msp430/periph
"make" -C /home/maribu/Repos/software/RIOT/msp430/drivers
"make" -C /home/maribu/Repos/software/RIOT/msp430/drivers/periph_common
"make" -C /home/maribu/Repos/software/RIOT/msp430/sys
"make" -C /home/maribu/Repos/software/RIOT/msp430/sys/auto_init
"make" -C /home/maribu/Repos/software/RIOT/msp430/sys/div
"make" -C /home/maribu/Repos/software/RIOT/msp430/sys/frac
"make" -C /home/maribu/Repos/software/RIOT/msp430/sys/isrpipe
"make" -C /home/maribu/Repos/software/RIOT/msp430/sys/libc
"make" -C /home/maribu/Repos/software/RIOT/msp430/sys/malloc_thread_safe
"make" -C /home/maribu/Repos/software/RIOT/msp430/sys/newlib_syscalls_default
"make" -C /home/maribu/Repos/software/RIOT/msp430/sys/preprocessor
"make" -C /home/maribu/Repos/software/RIOT/msp430/sys/shell
"make" -C /home/maribu/Repos/software/RIOT/msp430/sys/shell/cmds
"make" -C /home/maribu/Repos/software/RIOT/msp430/sys/stdio_uart
"make" -C /home/maribu/Repos/software/RIOT/msp430/sys/tsrb
"make" -C /home/maribu/Repos/software/RIOT/msp430/sys/ztimer
   text	  data	   bss	   dec	   hex	filename
  16484	   208	  1366	 18058	  468a	/home/maribu/Repos/software/RIOT/msp430/tests/periph/spi/bin/olimex-msp430-h2618/tests_spi.elf
/home/maribu/Repos/software/RIOT/msp430/dist/tools/mspdebug/mspdebug -j --expect-id "MSP430F2618" olimex "prog /home/maribu/Repos/software/RIOT/msp430/tests/periph/spi/bin/olimex-msp430-h2618/tests_spi.hex"
MSPDebug version 0.25 - debugging tool for MSP430 MCUs
Copyright (C) 2009-2017 Daniel Beer <[email protected]>
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Chip info database from MSP430.dll v3.15.0.1 Copyright (C) 2013 TI, Inc.

Resetting Olimex command processor...
Initializing FET...
FET protocol version is 20000007
Set Vcc: 3000 mV
Configured for JTAG (2)
Sending reset...
Using Olimex identification procedure
Device ID: 0xf26f
  Code start address: 0x3100
  Code size         : 118528 byte = 115 kb
  RAM  start address: 0x200
  RAM  end   address: 0x9ff
  RAM  size         : 2048 byte = 2 kb
Device: MSP430F2618
Number of breakpoints: 8
fet: FET returned error code 34 (Not supported by selected interface or interface is not initialized)
fet: warning: message C_IDENT3 failed
fet: FET returned NAK
warning: device does not support power profiling
Device: MSP430F2618
Erasing...
Programming...
Writing 4096 bytes at 3100...
Writing 4096 bytes at 4100...
Writing 4096 bytes at 5100...
Writing 4096 bytes at 6100...
Writing  296 bytes at 7100...
Writing    2 bytes at ffe2...
Writing    4 bytes at fff0...
Writing    4 bytes at fff8...
Writing    2 bytes at fffe...
Done, 16692 bytes total
/home/maribu/Repos/software/RIOT/msp430/dist/tools/pyterm/pyterm -p "/dev/ttyUSB0" -b "115200"  
2024-02-07 20:00:41,687 # Connect to serial port /dev/ttyUSB0
Welcome to pyterm!
Type '/exit' to exit.
2024-02-07 20:00:42,705 # main(): This is RIOT! (Version: 2024.04-devel-147-g179cd-cpu/msp430/usci)
2024-02-07 20:00:42,706 # Manual SPI peripheral driver test (see README.md)
2024-02-07 20:00:42,706 # There are 2 SPI devices configured for your platform.
> init
2024-02-07 20:00:46,997 # init
2024-02-07 20:00:47,000 # usage: init <dev> <mode> <clk> [cs port] [cs pin]
2024-02-07 20:00:47,000 # 	dev:
2024-02-07 20:00:47,003 # 		0: SPI_DEV(0)
2024-02-07 20:00:47,003 # 		1: SPI_DEV(1)
> init 0 0 3 1 4
2024-02-07 20:00:52,503 # init 0 0 3 1 4
2024-02-07 20:00:52,509 # Trying to initialize SPI_DEV(0): mode: 0, clk: 3, cs_port: 1, cs_pin: 4
2024-02-07 20:00:52,520 # (if below the program crashes with a failed assertion, then it means the configuration is not supported)
2024-02-07 20:00:52,521 # Success.
> send Hello
2024-02-07 20:00:54,961 # send Hello
2024-02-07 20:00:54,961 # Sent bytes
2024-02-07 20:00:54,964 #    0    1    2    3    4 
2024-02-07 20:00:54,967 #   0x48 0x65 0x6c 0x6c 0x6f
2024-02-07 20:00:54,970 #     H    e    l    l    o 
2024-02-07 20:00:54,970 # 
2024-02-07 20:00:54,970 # Received bytes
2024-02-07 20:00:54,973 #    0    1    2    3    4 
2024-02-07 20:00:54,975 #   0x48 0x65 0x6c 0x6c 0x6f
2024-02-07 20:00:54,978 #     H    e    l    l    o 
2024-02-07 20:00:54,978 # 
> 2024-02-07 20:01:07,521 # Exiting Pyterm

Issues/PRs references

Depends on and includes: #20356

@maribu maribu added Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation State: waiting for other PR State: The PR requires another PR to be merged first CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Feb 7, 2024
@github-actions github-actions bot added Platform: MSP Platform: This PR/issue effects MSP-based platforms Area: doc Area: Documentation Area: tests Area: tests and testing framework Area: boards Area: Board ports Area: cpu Area: CPU/MCU ports Area: examples Area: Example Applications labels Feb 7, 2024
@riot-ci
Copy link

riot-ci commented Feb 7, 2024

Murdock results

✔️ PASSED

10ee192 examples,tests: bump Makefile.cis

Success Failures Total Runtime
10026 0 10027 09m:57s

Artifacts

@benpicco benpicco removed the State: waiting for other PR State: The PR requires another PR to be merged first label Feb 8, 2024
@github-actions github-actions bot removed the Area: doc Area: Documentation label Feb 9, 2024
@maribu maribu enabled auto-merge February 13, 2024 10:56
maribu added 2 commits March 27, 2024 18:54
This cleans up the USCI based UART and SPI implementations and allows
multiple instances of either interface to be configured by the
boards. In addition, it allows sharing the USCI peripherals to provide
multiple serial interfaces with the same hardware (round-robin).
Ran `dist/tools/insufficient_memory/update_insufficient_memory_board.sh`
for both `z1` and `olimex-msp430-h2618`.
@maribu maribu added this pull request to the merge queue Mar 27, 2024
Merged via the queue into RIOT-OS:master with commit 4b3308c Mar 28, 2024
25 checks passed
@maribu
Copy link
Member Author

maribu commented Mar 28, 2024

Wooohooo 🎉 Thx!

@maribu maribu deleted the cpu/msp430/usci branch March 28, 2024 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports Area: cpu Area: CPU/MCU ports Area: examples Area: Example Applications Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: MSP Platform: This PR/issue effects MSP-based platforms Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants