This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/MSP432P401R: NoRTOS application on MSP432P4 using CCS/SDK, Ti Drivers and SysConfig

Part Number: MSP432P401R

Tool/software: Code Composer Studio

Hi!

I’m new to SimpleLink/SDK, don’t have RTOS or driver experience and want to implement a simple NoRTOS application on MSP432P4 using CCS/SDK on launchpad hardware (initially) with TI Drivers using SysConfig. The application is an existing product currently running on MSP430F2274 (bare metal: no rtos or drivers) so I’m looking to adapt existing C code to the MSP432P4/SDK/drivers. 

How the application runs:

  • LFXT1 clock source (4MHz crystal/MCLK on MSP430F2274) - I plan to use 12 or 24MHz MCLK on MSP432P4.
  • Runs continuously (doesn’t sleep) to keep power current constant, executing an instruction sequence each time the periodic tick flag is set. There are no sleep-wake cycles, yet power current is to be minimized within that constraint (for the selected MCLK clock frequency).

MCU resources used:

  • Tick to pace execution. Currently uses WDT in Interval Mode (time interval set at startup) with ISR setting a flag.
  • Free-running 16-bit up-counter timer running at 4MHz. Continuously counts 0-FFFF, rolling over to 0 with interrupt. Currently uses Timer_A with TAIFG interrupt.
  • 16-bit input-capture latches Free-running 16-bit up-counter value, pin-input falling edge triggered with interrupt. Currently uses TACR0
  • SPI in master mode. Currently uses USCI_B0.
  • 5 logic inputs with pull-ups, 1 logic output.
  • Info memory flash (256 bytes). Currently uses 4 64-byte segments.

 Questions:

How to proceed?

I assume it's best to start with and existing NoRTOS Ti Driver project (like gpiointerrupt) and rename and modify it?

I'm trying to understand the TI drivers application interface when SysConfig is used.

Studying imported example NoRTOS projects (gpiointerrupt, nvsinternal, pwmled2) …their main() functions look identical, containing Board_init(); NoRTOS_start(); mainThread(NULL); while (1) {}; but from the TI Driver documentation, I’m not certain precisely what I must provide (and where). Apart from adding drivers and selecting their settings within SysConfig, should the stuff of the driver Runtime API documentation usage/examples (e.g. opening an instance) go into mainthread()? The example projects seem to have it all there.

I’m not up to speed on threads (I want to learn them with TI RTOS, after this project) … Should my app run in mainthread()? And not from the while(1) of main()? Should mainthread() not return? Should I leave the while(1) of main() empty?

As mentioned above, my app must not sleep, but the SimpleLink MCU SDK Driver API Reference says all TI-Driver implementations utilize the Power driver APIs to ensure low power consumption at all times. Within my constraints of LFXT1 clock source (for timer accuracy), my selected CPU frequency, the above mentioned mcu resources and NO sleep/wake, I want to minimize power current as much as possible. That is I want to shut down / set to minimum power all unused mcu resources, clocks, etc. not mentioned above. How and where do I make these settings? Power Driver within SysConfig?

The SimpleLink MCU SDK Driver API Reference mentions the NoRTOS Framework Module – what do I need to be concerned with there? Are there settings/adjustments?

Regarding the Capture driver, apart from adding it with SysConfig and opening an instance in mainthread(), what's my application code method for getting the captured 16-bit timer values? I don’t see that in any of the API functions …

Thank you!

  • Hi Kris,

    Starting with the NoRtos examples is a good way to go. A few answers to your questions:

    1. To make things less complicated, runtime API/application code should go in the mainthread() and not the while(1) of main. Technically code can go in main() and you don’t need to use any threads but that would require some modifications and extra effort.
    2. To ensure that your application doesn’t go to sleep you will need to make changes with the Power Driver. You can refer to the power examples and documentation for this.
    3. You shouldn’t worry about the NoRTOS Framework Module. It doesn’t require any changes
    4. There’s a Capture example under drivers. The most common method for getting these values is with a capture callback function that returns the value.

    I hope this can help get you going.

    BR,
    Leo