Because of the holidays, TI E2E™ design support forum responses will be delayed from Dec. 25 through Jan. 2. Thank you for your patience.

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: BPSK Modem Implementation With SimpleLink™ MSP432™ MCUs - slaa681a

Part Number: MSP432P401R

Tool/software: Code Composer Studio

Hello,

From the demo BPSK modem source code supplied in 'slaa681a' - I'm trying to import the project directories/source code into CCS V8 on a Windows 10 host - to compile and test. I can easily compile other projects imported into the CCS IDE from the TI Resource Explorer, and can flash the target MSP432 board. But are there any specific steps that I have to do in order to get CCS to try to 'make' or 'compile' this code? I can edit/change as needed a few source lines, but then it doesn't automatically build/install or do anything for that matter - yet the other projects are well behaved in terms of edit > build > link > flash cycle.

Or do I have to import the package contents in a particular method to make it an active project?


BTW, there was an earlier thread 

  • 0044.startup_msp432p401r_ccs.c
    /******************************************************************************
    * 
    *  Copyright (C) 2012 - 2016 Texas Instruments Incorporated - http://www.ti.com/ 
    * 
    *  Redistribution and use in source and binary forms, with or without 
    *  modification, are permitted provided that the following conditions 
    *  are met:
    * 
    *   Redistributions of source code must retain the above copyright 
    *   notice, this list of conditions and the following disclaimer.
    * 
    *   Redistributions in binary form must reproduce the above copyright
    *   notice, this list of conditions and the following disclaimer in the 
    *   documentation and/or other materials provided with the   
    *   distribution.
    * 
    *   Neither the name of Texas Instruments Incorporated nor the names of
    *   its contributors may be used to endorse or promote products derived
    *   from this software without specific prior written permission.
    * 
    *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
    *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
    *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
    *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
    *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
    *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
    *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
    *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
    * 
    *  MSP432P401R Interrupt Vector Table and startup code for CCS TI ARM
    * 
    *****************************************************************************/
    
    #include <stdint.h>
    
    /* Forward declaration of the default fault handlers. */
    static void resetISR(void);
    static void nmiISR(void);
    static void faultISR(void);
    static void defaultISR(void);
    
    
    /* External declaration for the reset handler that is to be called when the */
    /* processor is started                                                     */
    extern void _c_int00(void);
    
    /* External declaration for system initialization function                  */
    extern void SystemInit(void);
    
    /* Linker variable that marks the top of the stack. */
    extern unsigned long __STACK_END;
    
    
    /* External declarations for the interrupt handlers used by the application. */
    /* To be added by user */
    extern void TA1_0_IRQHandler(void);
    extern void TA2_0_IRQHandler(void);
    extern void PORT1_IRQHandler(void);
    
    /* Interrupt vector table.  Note that the proper constructs must be placed on this to */
    /* ensure that it ends up at physical address 0x0000.0000 or at the start of          */
    /* the program if located at a start address other than 0.                            */
    #pragma RETAIN(interruptVectors)
    #pragma DATA_SECTION(interruptVectors, ".intvecs")
    void (* const interruptVectors[])(void) =
    {
        (void (*)(void))((uint32_t)&__STACK_END),
                                                /* The initial stack pointer */
        resetISR,                               /* The reset handler         */
        nmiISR,                                 /* The NMI handler           */
        faultISR,                               /* The hard fault handler    */
        defaultISR,                             /* The MPU fault handler     */
        defaultISR,                             /* The bus fault handler     */
        defaultISR,                             /* The usage fault handler   */
        0,                                      /* Reserved                  */
        0,                                      /* Reserved                  */
        0,                                      /* Reserved                  */
        0,                                      /* Reserved                  */
        defaultISR,                             /* SVCall handler            */
        defaultISR,                             /* Debug monitor handler     */
        0,                                      /* Reserved                  */
        defaultISR,                             /* The PendSV handler        */
        defaultISR,                             /* The SysTick handler       */
        defaultISR,                             /* PSS ISR                   */
        defaultISR,                             /* CS ISR                    */
        defaultISR,                             /* PCM ISR                   */
        defaultISR,                             /* WDT ISR                   */
        defaultISR,                             /* FPU ISR                   */
        defaultISR,                             /* FLCTL ISR                 */
        defaultISR,                             /* COMP0 ISR                 */
        defaultISR,                             /* COMP1 ISR                 */
        defaultISR,                             /* TA0_0 ISR                 */
        defaultISR,                             /* TA0_N ISR                 */
    	TA1_0_IRQHandler,                       /* TA1_0 ISR                 */
        defaultISR,                             /* TA1_N ISR                 */
    	TA2_0_IRQHandler,                       /* TA2_0 ISR                 */
        defaultISR,                             /* TA2_N ISR                 */
        defaultISR,                             /* TA3_0 ISR                 */
        defaultISR,                             /* TA3_N ISR                 */
        defaultISR,                             /* EUSCIA0 ISR               */
        defaultISR,                             /* EUSCIA1 ISR               */
        defaultISR,                             /* EUSCIA2 ISR               */
        defaultISR,                             /* EUSCIA3 ISR               */
        defaultISR,                             /* EUSCIB0 ISR               */
        defaultISR,                             /* EUSCIB1 ISR               */
        defaultISR,                             /* EUSCIB2 ISR               */
        defaultISR,                             /* EUSCIB3 ISR               */
        defaultISR,                             /* ADC14 ISR                 */
        defaultISR,                             /* T32_INT1 ISR              */
        defaultISR,                             /* T32_INT2 ISR              */
        defaultISR,                             /* T32_INTC ISR              */
        defaultISR,                             /* AES ISR                   */
        defaultISR,                             /* RTC ISR                   */
        defaultISR,                             /* DMA_ERR ISR               */
        defaultISR,                             /* DMA_INT3 ISR              */
        defaultISR,                             /* DMA_INT2 ISR              */
        defaultISR,                             /* DMA_INT1 ISR              */
        defaultISR,                             /* DMA_INT0 ISR              */
    	PORT1_IRQHandler,                       /* PORT1 ISR                 */
        defaultISR,                             /* PORT2 ISR                 */
        defaultISR,                             /* PORT3 ISR                 */
        defaultISR,                             /* PORT4 ISR                 */
        defaultISR,                             /* PORT5 ISR                 */
        defaultISR,                             /* PORT6 ISR                 */
        defaultISR,                             /* Reserved 41               */
        defaultISR,                             /* Reserved 42               */
        defaultISR,                             /* Reserved 43               */
        defaultISR,                             /* Reserved 44               */
        defaultISR,                             /* Reserved 45               */
        defaultISR,                             /* Reserved 46               */
        defaultISR,                             /* Reserved 47               */
        defaultISR,                             /* Reserved 48               */
        defaultISR,                             /* Reserved 49               */
        defaultISR,                             /* Reserved 50               */
        defaultISR,                             /* Reserved 51               */
        defaultISR,                             /* Reserved 52               */
        defaultISR,                             /* Reserved 53               */
        defaultISR,                             /* Reserved 54               */
        defaultISR,                             /* Reserved 55               */
        defaultISR,                             /* Reserved 56               */
        defaultISR,                             /* Reserved 57               */
        defaultISR,                             /* Reserved 58               */
        defaultISR,                             /* Reserved 59               */
        defaultISR,                             /* Reserved 60               */
        defaultISR,                             /* Reserved 61               */
        defaultISR,                             /* Reserved 62               */
        defaultISR                              /* Reserved 63               */
    };
    
    
    /* This is the code that gets called when the processor first starts execution */
    /* following a reset event.  Only the absolutely necessary set is performed,   */
    /* after which the application supplied entry() routine is called.  Any fancy  */
    /* actions (such as making decisions based on the reset cause register, and    */
    /* resetting the bits in that register) are left solely in the hands of the    */
    /* application.                                                                */
    void resetISR(void)
    {
        SystemInit();
    
        /* Jump to the CCS C Initialization Routine. */
        __asm("    .global _c_int00\n"
              "    b.w     _c_int00");
    }
    
    /* This is the code that gets called when the processor receives a NMI.  This  */
    /* simply enters an infinite loop, preserving the system state for examination */
    /* by a debugger.                                                              */
    static void nmiISR(void)
    {
        /* Fault trap exempt from ULP advisor */
        #pragma diag_push
        #pragma CHECK_ULP("-2.1")
    
        /* Enter an infinite loop. */
        while(1)
        {
        }
    
        #pragma diag_pop
    }
    
    
    /* This is the code that gets called when the processor receives a fault        */
    /* interrupt.  This simply enters an infinite loop, preserving the system state */
    /* for examination by a debugger.                                               */
    static void faultISR(void)
    {
        /* Fault trap exempt from ULP advisor */
        #pragma diag_push
        #pragma CHECK_ULP("-2.1")
    
        /* Enter an infinite loop. */
        while(1)
        {
        }
    
        #pragma diag_pop
    }
    
    
    /* This is the code that gets called when the processor receives an unexpected  */
    /* interrupt.  This simply enters an infinite loop, preserving the system state */
    /* for examination by a debugger.                                               */
    static void defaultISR(void)
    {
        /* Fault trap exempt from ULP advisor */
        #pragma diag_push
        #pragma CHECK_ULP("-2.1")
    
        /* Enter an infinite loop. */
        while(1)
        {
        }
    
        #pragma diag_pop
    }
    
    
    Update: I figured out a basic way to import the entire folder (produced from the SLAA681A zip file) into the TI CCS V8 workspace. But I believe the package needs additional components?

    1) in the modulator source tree, "main.c" and "Hart.c" seem to be missing? yet they are referred to in: msp432p401_bpsk_modulation_linkInfo.xml
    2) if I manually exclude these files from the build, then the linking fails and the reason why it fails is:
    <Linking>

    undefined first referenced
    symbol in file
    --------- ----------------
    PORT1_IRQHandler ./startup_msp432p401r_ccs.obj
    TA1_0_IRQHandler ./startup_msp432p401r_ccs.obj
    TA2_0_IRQHandler ./startup_msp432p401r_ccs.obj


    3) But searching for these 'undefined symbols' results leads me to : startup_msp432p401r_ccs.c, where we find line 57~61

    /* External declarations for the interrupt handlers used by the application. */
    /* To be added by user */
    extern void TA1_0_IRQHandler(void);
    extern void TA2_0_IRQHandler(void);
    extern void PORT1_IRQHandler(void);

    So ... is there a library that is supposed to be linked ? another include file?

  • This example pre-dates the SDK, so the includes are not handled properly.  I would recommend the following:

    (1) Import an existing SDK example which uses the CMSIS DSP.

    (2) Remove the existing main.c file from the example and copy into the project the source and include files.  For simplicity I would recommend keeping them at the project level without sub-directories.  (you can use sub-directories, just be sure to add into compiler)  I renamed the project also.

    (3) update the include to the SDK in the defines.h

    //#include "msp432.h"
    //#include "driverlib.h"
    #include <ti/devices/msp432p4xx/driverlib/driverlib

    (4) Build

    I tested this with the demodulation portion and did not receive any errors.  

    Regards,
    Chris

  • Thank you Chris, I confirm that I am able to compile the sample code of SLAA681A per your instructions. Both modulator and demodulator compile and can be flashed to the target MSP432 board.

    However --- as I am now experimenting with an oscilloscope to trace signals on P2.5 (output) I see at the moment nothing when the program is executing. To confirm the board is working, I wrote a simple LED blinking program that blinked an LED on Red P1.0, and also output a similar signal on P2.5, which worked reliably and can be seen on the oscilloscope output.

    I'll walk through the code to learn how the developers implemented the modulator (a valuable learning experience) but I just noticed right away that the documentation PDF may not be related to the code - but it is early. For example: In the code it is written as in the supplied code fragment fron packet.h, which does not readily match the packet structure of Figure 8. So, I need to look at it more. When I tried to debug the code (run it on the target platform) the compiled and flashed code actually aborted with an error message in my early trials - but during the build stage, there is no error that I can find. ????

    Suggestions welcome.

    /****************************************************************************************
         5B       5B         1B        4B      1B        2B     0-492B      1B
      | Sync | Preamble | Delimiter | Addr | Command | Length |  Data   | Checksum |
    *****************************************************************************************/
    typedef struct _Packet //protocol packet format
    {
        uint_8 delimiter;         // delimiter field
        uint_32 addr;         // address field, 5 byte
        uint_8 command;            // command field
        uint_16 dataLength;    // data length field
        uint_8 *data;           // data field
    } Packet;




  • Try cleaning and then rebuilding the project. Utilize the console as that may identify issues which are not presented as an Error in the problem window.

    Hope that helps.
    Chris
  • I've made progress in reading through the modulator code (that is what I am focusing on, as I have a handy oscilloscope to try to see the traces) but so far I haven't been able to determine if the code actually is producing what the documentation seems to be say it should do. I would like to keep this thread active just in case. But I am using the SDK MSP432 examples to learn about the TIMER_A and also CS (Clock System) and how to manipulate them. If the modulator code is broken severely, I intend to write a new modulator now that I understand the meaning of the OUTx signals from the TIMER_A block and the various ways clocks can be generated. But the original question about why there is a mismatch between the datasheet and the code still is a mystery to me.

  • I do not believe that I will be able to answer any questions about the application note.  If you can ask specific questions about the timer or clock system, then I will be more able to help.

    Regards,
    Chris  

  • Can you share any of your findings with the community?

    e2e.ti.com/.../781008

    Regards,
    Chris

**Attention** This is a public forum