Author Topic: TI MSPM0: toolchain and programming  (Read 8044 times)

0 Members and 2 Guests are viewing this topic.

Offline Jope

  • Regular Contributor
  • *
  • Posts: 116
  • Country: de
Re: TI MSPM0: toolchain and programming
« Reply #25 on: September 08, 2026, 03:53:27 am »
OpenOCD apparently does not support this family. I could only find device configs for MSPM0L and MSPM0G devices, but not MSPM0C.

The current sources of OpenOCD seem to contain at least support for the MSPM0C1104 (https://github.com/openocd-org/openocd/blob/master/src/flash/nor/mspm0.c).
The values for the MSPM0C1103 are missing, but you could add them here (in mspm0.c):
Code: [Select]
static const struct mspm0_part_info mspm0c_parts[] = {
{ "MSPS003F4SPW20R", 0x57b3, 0x70},
{ "MSPM0C1104SDGS20R", 0x57b3, 0x71},
{ "MSPM0C1104SRUKR", 0x57b3, 0x73},
{ "MSPM0C1104SDYYR", 0x57b3, 0x75},
{ "MSPM0C1104SDDFR", 0x57b3, 0x77},
{ "MSPM0C1104SDSGR", 0x57b3, 0x79},
};

The user IDs for the MSPM0C1103 are listed in table 8-12 here: https://www.ti.com/lit/ds/symlink/mspm0c1104.pdf
« Last Edit: September 08, 2026, 03:55:17 am by Jope »
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4657
  • Country: us
Re: TI MSPM0: toolchain and programming
« Reply #26 on: September 08, 2026, 05:44:28 am »
Quote
I have read the gnu makefile documentation, and while I see the syntax described therein, I'm still not sure how to begin with a source file and the SDK and get $whateverFormatProbeRSwants. Thus, I asked a generator bot to give me a makefile which I will hand-wave for now
Sigh.  Makefiles were a lot more understandable back before they were "usually" auto-generated.  That led to a lot of "noise" and obfuscation of the basic function. :-(

Your .c file didn't include your attempt at using sysTick, so we can't comment on what might be wrong with it.  (leave non-working code in your source, #ifdef'ed out...)
Quote
Code: [Select]
STARTUP := $(SDK)/source/ti/devices/msp/m0p/startup_system_files/gcc/startup_mspm0c110x_gcc.c
Does the startup code initialized clocks and flash wait states and such?  I don't see  that in your main.c...


 

Offline IconicPCB

  • Super Contributor
  • ***
  • Posts: 1631
  • Country: au
Re: TI MSPM0: toolchain and programming
« Reply #27 on: September 08, 2026, 11:08:02 am »
There is the option of Arduino... but only for MSPM0G3507 i recall the part number correctly
 

Offline microwhatTopic starter

  • Regular Contributor
  • *
  • Posts: 57
  • Country: us
Re: TI MSPM0: toolchain and programming
« Reply #28 on: September 12, 2026, 02:19:26 pm »
This is my sysTick test (that doesn't work). The LED at PA11 will flash, as expected, but the LED at PA4 does not, suggesting that the interrupt handler never gets called.
 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1741
  • Country: de
    • Renate's Android Page
Re: TI MSPM0: toolchain and programming
« Reply #29 on: September 12, 2026, 02:40:47 pm »
This is my sysTick test...
I don't know an MSP from a hole in the ground, but AFAIK TI MSP come up from reset with interrupts disabled.
You need to enable them:
Code: [Select]
__enable_irq()
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4657
  • Country: us
Re: TI MSPM0: toolchain and programming
« Reply #30 on: September 13, 2026, 02:22:04 am »
So... is there some particular reason that you haven't spent $10 ($6 direct from TI; apparently more from distributers) or so on the LP-MSPM0C1104 launchpad for this series?
That would give you a known-good handware and upload/debug path. (and the debugger can be disconnected from the on-board MSP and used with off-board chips.)
 

Offline microwhatTopic starter

  • Regular Contributor
  • *
  • Posts: 57
  • Country: us
Re: TI MSPM0: toolchain and programming
« Reply #31 on: September 13, 2026, 03:31:58 am »
So... is there some particular reason that you haven't spent $10 ($6 direct from TI; apparently more from distributers) or so on the LP-MSPM0C1104 launchpad for this series?

Because I have made a board for a project with a MSPM0C1103 that works. It does everything I need for this application. (except sysTick, which I have worked around with TIMG8) Why would I buy an OEM development board when mine works? Further, TI obviously intends their dev board to be used with their dev toolchain, and the whole point of this exercise is to not do that.
 

Offline voltsandjolts

  • Supporter
  • ****
  • Posts: 3785
  • Country: gb
Re: TI MSPM0: toolchain and programming
« Reply #32 on: September 13, 2026, 08:35:30 am »

I guess you've setup a makefile project with gcc for the MSPM0?
Would you share a small complete buildable project for other folks that find this thread whilst looking for such?
 

Offline cv007

  • Super Contributor
  • ***
  • Posts: 1061
Re: TI MSPM0: toolchain and programming
« Reply #33 on: September 13, 2026, 10:15:51 am »
Quote
BTW, you probably don't want "-nostartfile", since that will leave out the vectors that an ARM needs at 0x0.
You have avr on your mind, cortex-m is not getting a vector table populated from the standard library.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4657
  • Country: us
Re: TI MSPM0: toolchain and programming
« Reply #34 on: September 13, 2026, 08:41:36 pm »
Quote from: cv007 on Today at 03:15:51 am
Quote
BTW, you probably don't want "-nostartfile", since that will leave out the vectors that an ARM needs at 0x0.
You have avr on your mind, cortex-m is not getting a vector table populated from the standard library.


Yeah, I guess explicitly including startup_mspm0c110x_gcc.c in the source files will take care of it.

Does that mean that "-nostartfile" doesn't do anything for cortex-m builds?  "-nostdlib" still prevents linking in the standard libraries, though?
 

Offline cv007

  • Super Contributor
  • ***
  • Posts: 1061
Re: TI MSPM0: toolchain and programming
« Reply #35 on: September 13, 2026, 11:38:23 pm »
-nostartfiles eliminates linking in the crt*.o files, none of which are useful for our mcu's, and most likely not even executed.  If using -nostartfiles and  __libc_init_array, then an empty _init function will need to be provided as __libc_init_array will make a call _init, which is normally from crti.o (and also does nothing useful).

-nostdlib will still do what you think it will do.
 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1741
  • Country: de
    • Renate's Android Page
Re: TI MSPM0: toolchain and programming
« Reply #36 on: September 14, 2026, 04:11:55 am »
So? Did you ever get your SysTick working?
SysTick is a system exception so it doesn't need enabling in the NVIC.
 

Offline microwhatTopic starter

  • Regular Contributor
  • *
  • Posts: 57
  • Country: us
Re: TI MSPM0: toolchain and programming
« Reply #37 on: September 14, 2026, 04:40:40 pm »
Post 28 contains my latest attempt at running systick. I've done what I thought the manual said I needed to do, and it won't run.

 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4657
  • Country: us
Re: TI MSPM0: toolchain and programming
« Reply #38 on: September 21, 2026, 07:19:22 am »
Quote
Post 28 contains my latest attempt at running systick.
Yeah, and post 29 contained a suggestion for making it work...

Quote
SysTick is a system exception so it doesn't need enabling in the NVIC.
True.  But you still need the global interrupt enable via __enable_irq() (should generate a "CPSIE I" instruction)
NVIC_SetPriority() actually has special code to set the sysTick priority off in the SCB->SHPR3 "System Handler Priority" register, instead of the NVIC.
 

Offline microwhatTopic starter

  • Regular Contributor
  • *
  • Posts: 57
  • Country: us
Re: TI MSPM0: toolchain and programming
« Reply #39 on: October 02, 2026, 02:38:12 am »
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 5358
  • Country: nl
Re: TI MSPM0: toolchain and programming
« Reply #40 on: October 02, 2026, 03:19:55 am »
Only a makefile (which normally does not have an "extension" (that's a windows thing, with Linux it's just a dot in a filename)) and your c source code is not enough.

As already mentioned before, you also need a linker script (this tells the compiler how much memory your uC has, and addresses of different sections. And you need a file with startup code. That is code which initializes (static) variables, and calls your main() when it's finished with initialization.

a makefile is not strictly necessary, but remembering how to combine all the parts by the command line would be atrocious. But you could for example write a python script to do so, use scons, cmake or other "build systems". All those build systems are quite involved and complicated, and add another layer of confusion to the learning curve.

I've mostly decided to stick with makefiles even though I find it's syntax atrocious.

Recently I used a bit of ai to write a makefile for me (for stm32) and it did a quite decent job. It made a quite readable makefile, that has just enough to make it a bit universal (such as declaring CC variables and such). These AI things have grokked enough data to fill in more details of the whole compile process then I could do from memory. (I used duckduck.com, which uses different AI's depending on ...)

When using a C compiler, also use the make utility that fits with that compiler. Using a different make can (apparently) lead to problems. I never bumped into that myself (yet). I only use variants of GCC, both for PC software and uC's.

 

Online aeg

  • Frequent Contributor
  • **
  • Posts: 460
  • Country: us
Re: TI MSPM0: toolchain and programming
« Reply #41 on: October 02, 2026, 04:41:32 am »
GNU make is the only make worth using. $^ is too useful (for linker rules), and it's missing from AT&T and POSIX make.
 

Offline microwhatTopic starter

  • Regular Contributor
  • *
  • Posts: 57
  • Country: us
Re: TI MSPM0: toolchain and programming
« Reply #42 on: October 02, 2026, 05:30:38 am »
Only a makefile (which normally does not have an "extension" (that's a windows thing, with Linux it's just a dot in a filename)) and your c source code is not enough...

The linker script, startup code, and all header files are supplied in the SDK. I see no reason to waste server space when it can be downloaded from the link for free.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4657
  • Country: us
Re: TI MSPM0: toolchain and programming
« Reply #43 on: October 02, 2026, 09:29:33 am »
Quote
MSPM0C* does not have systick.
It looks like the 1103 and 1104 don't have sysTick, but the 1105 and 1106 do.

You sure can't tell that from the TI documentation (I'm NOT impressed!)
(Apparently the 1103 datasheet "doesn't mention" systick, but that's not unusual since it's "part of the m0+ core."  Sigh.)

It seems like a poor choice to omit.
I really like the vendors that get very explicit:2940507-0

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->