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.

RTOS/MSP430F5528: Errors compiling MSP430 DriverLib SPI parameters

Part Number: MSP430F5528

Tool/software: TI-RTOS

Hi ,  When I clean and build my rtos project I get a failure on all of the param write statements inside this structure.

The first of these is:    #148 Declaration is incompatible with "USCI_B_SPI_initMasterParam  param"

For my rtos project, I have checked my properties / products tab and found a listing that shows "MSP430 DriverLIb 2.70.0.08 "

So I believe that the DriverLib is installed for my MSP430F5xx_6xx Devices.  However, I may be mistaken on this.

Could I be missing another include statement ?

Additionally, could I have a project setting that needs adjustment ?

#include <usci_b_spi.h>

//Initialize Master

USCI_B_SPI_initMasterParam param = {0};

param.selectClockSource = USCI_B_SPI_CLOCKSOURCE_SMCLK;

param.clockSourceFrequency = UCS_getSMCLK();

param.desiredSpiClock = SPICLK;

param.msbFirst = USCI_B_SPI_MSB_FIRST;

param.clockPhase = USCI_B_SPI_PHASE_DATA_CHANGED_ONFIRST_CAPTURED_ON_NEXT;

param.clockPolarity = USCI_B_SPI_CLOCKPOLARITY_INACTIVITY_HIGH;

returnValue = USCI_B_SPI_initMaster(USCI_B0_BASE, &param);

Thank you

Roy

  • Hi Roy,

    Can you provide a copy of the project with the least amount of code possible to recreate the issue. I'd like to take a closer look at your code to try to determine what may be causing the issue.

    Best regards,
    Caleb Overbay
  • F2-1.zipHi Caleb,

    Here is the zip file from my project F2-1.  Before I added the c-file SPI_UCB0.c, I did not have any errors.

    Thank you for your time.

    Roy

  • Hi Roy,

    I'm able to recreate the issue you're observing and I believe it is probably a byproduct of some other error in your code. You seem to be using the USCI_B_SPI_initMasterParam correctly and using the proper include file.

    I haven't been able to identify where the issue is originating from though. Since you have a more in-depth knowledge of the code you've written I recommend excluding certain portions and re-building until you find the culprit. To me this issue seems like it could be some kind of conflicting driverlib versions but that's just speculation at this point.

    I need to run this by our TI-RTOS expert and I'll get back to you. In the meantime, have you made any progress on the issue?

    Best regards,
    Caleb Overbay
  • Hi Caleb,

    I have not made any progress.

    I will take your suggestion, and try looking for the source of a possible conflict.

    I sure hope the RTOS expert can give me some guidance, because right now I am pretty much dead in the water.

    Thank you

    Roy

  • Caleb,

    Just to let you know, I will be out of the office until Monday, Mar 5.

    Roy
  • Roy,

    I still haven't been able to find the cause of the error in your code but I've been able to successfully build the code with the USCI_B_SPI_initMasterParam present. I simply moved it into the I2C_UCB1.c file to test things out. It built successfully and with no errors.

    Most likely, the error you are seeing is due to an undetected error elsewhere in your code. I've noticed that the code you posted is rather messy (e.g. commented code, unnecessary header files, dead code, etc). I think performing a thorough cleaning of the code to only what is necessary for the operation you're trying to achieve will most likely solve your issue.

    Best regards,
    Caleb Overbay

**Attention** This is a public forum