Skip to content

Add TI MSP DMA Support for MSPM33 Platform #7

Merged
padmaraghunathan90 merged 6 commits intodev_mspm33from
feature/mspm33-dma
Jan 23, 2026
Merged

Add TI MSP DMA Support for MSPM33 Platform #7
padmaraghunathan90 merged 6 commits intodev_mspm33from
feature/mspm33-dma

Conversation

@Aman-Lachhiramka-ti
Copy link
Collaborator

This PR adds Direct Memory Access (DMA) support for the Texas Instruments MSP microcontrollers, specifically targeting the MSPM33 series.

Testing

The implementation has been verified with the following tests:

  • tests/drivers/dma/chan_blen_transfer - Validates basic DMA transfers with different block lengths
  • tests/drivers/dma/loop_transfer - Tests continuous DMA loop transfers

All tests pass on the lp_mspm33c321a target board.

chan_blen_transfer test:

image

loop_transfer test:

image

@github-actions
Copy link

github-actions bot commented Dec 23, 2025

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
msp-hal_ti TexasInstruments/msp-hal_ti@1.01.00.00_ea TexasInstruments/msp-hal_ti@dev_mspm33 TexasInstruments/msp-hal_ti@1.01.00.00_ea..dev_mspm33

All manifest checks OK

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@Aman-Lachhiramka-ti
Copy link
Collaborator Author

Addressed all the comments given by @Shreyas-Shankar155 and pushed the changes
https://github.com/TexasInstruments/msp-zephyr/compare/bb2d4a328eedabe86ccfaf02f880c877e8ab27a1..f5dd89a4dad00481d9efd8ccb9768e524b601bc6

  • Converted the data width macros to an enum
  • Added error handling for the DMA channel enablement APIs
  • Changed the burst size configuration to use a switch-case statement
  • Added a check to verify that source_burst_length matches dest_burst_length
  • Updated the DTS binding file with a more detailed description of driver capabilities
  • Added early validation for channel direction during configuration
  • Renamed most instances of the data variable to chan_data for clarity
  • Updated the callback status parameter from 0 to DMA_STATUS_COMPLETE

@Aman-Lachhiramka-ti Aman-Lachhiramka-ti force-pushed the feature/mspm33-dma branch 2 times, most recently from bfcff35 to 368fdd7 Compare January 2, 2026 08:35
Add DMA driver binding for Texas Instruments MSP Family series

Signed-off-by: Aman Lachhiramka <a-lachhiramka@ti.com>
source ~/zephyrproject/zephyr/zephyr-env.sh
west build -p always -b lp_mspm33c321a samples/basic/blinky

- name: Build ADC Sequence example
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this removed ?

Copy link
Collaborator Author

@Aman-Lachhiramka-ti Aman-Lachhiramka-ti Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HSADC has changed a lot during SDK APL release and that's why the sample is not building. So needs to inculcate those changes in the drivers

@Aman-Lachhiramka-ti Aman-Lachhiramka-ti force-pushed the feature/mspm33-dma branch 3 times, most recently from 24bc8f0 to a395ccc Compare January 6, 2026 05:44
Add DMA driver support for Texas Instruments MSP family series

Signed-off-by: Aman Lachhiramka <a-lachhiramka@ti.com>
Add DMA nodes to the dtsi for TI MSPM33

Signed-off-by: Aman Lachhiramka <a-lachhiramka@ti.com>
Add DMA test driver support for Texas Instrument's lp_mspm33c321a launchpad

Signed-off-by: Aman Lachhiramka <a-lachhiramka@ti.com>
Temporary removing ADC test case due to the changes made in the APL release of SDK for ADC

Signed-off-by: Aman Lachhiramka <a-lachhiramka@ti.com>
Signed-off-by: Aman Lachhiramka <a-lachhiramka@ti.com>
@padmaraghunathan90 padmaraghunathan90 merged commit 086bca0 into dev_mspm33 Jan 23, 2026
10 of 13 checks passed
@Aman-Lachhiramka-ti Aman-Lachhiramka-ti deleted the feature/mspm33-dma branch January 28, 2026 05:58
JFMSP pushed a commit that referenced this pull request Mar 12, 2026
ASM is notoriously harder to maintain than C and requires core specific
adaptation which impairs even more the readability of the code.

There's a bug in current arch_cpu_atomic_idle asm version:
	tst	x0, #(DAIF_IRQ_BIT) //here Z := (DAIF_IRQ_BIT == 0)
	beq	_irq_disabled //jump to _irq_disabled when Z is set
	msr	daifclr, #(DAIFCLR_IRQ_BIT)
_irq_disabled:
	ret

As can be seen, the asm code jumps to _irq_disabled when Z is set, but
per aarch64 architecture reference, DAIF_IRQ == 0 means the IRQ is
unmasked, I.E enabled. So the asm logic here is wrong. I fixed this bug
in C version. This shows the benefit of ASM -> C

As for performance concern, except the bug fix above, there's no
difference of generated code between ASM and C version.
ASM version:
<arch_cpu_idle>:
d5033f9f 	dsb	sy
d503207f 	wfi
d50342ff 	msr	daifclr, #0x2
d65f03c0 	ret

arch_cpu_atomic_idle>:
d50342df 	msr	daifset, #0x2
d5033fdf 	isb
d503205f 	wfe
f279001f 	tst	x0, #0x80
54000040 	b.eq	1001d10 <_irq_disabled>  // b.none
d50342ff 	msr	daifclr, #0x2

_irq_disabled>:
d65f03c0 	ret

C version:
<arch_cpu_idle>:
d5033f9f 	dsb	sy
d503207f 	wfi
d50342ff 	msr	daifclr, #0x2
d65f03c0 	ret

<arch_cpu_atomic_idle>:
d50342df 	msr	daifset, #0x2
d5033fdf 	isb
d503205f 	wfe
37380040 	tbnz	w0, #7, 1001d0c <arch_cpu_atomic_idle+0x14>
d50342ff 	msr	daifclr, #0x2
d65f03c0 	ret

And as can be seen, C version use the tbnz instruction to test bit and
branch. Unlike TST, TBNZ does not affect the Z, N, C, or V flags in the
processor state. So except the bug fix, C version looks a bit better
than asm version.

Other architectures such as x86, riscv, rx, xtensa, mips and even arm
cortex_m also use c version for cpu_idle, it's safe for ASM -> C.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants