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.

PGA460PSM-EVM: Energia code does not compile.

Part Number: PGA460PSM-EVM
Other Parts Discussed in Thread: ENERGIA, MSP-EXP430F5529LP, PGA460

I downloaded " PGA460 Energia Library and Code Example (Version 1.0.9) (Rev. I)" and I tried to compile the code but it gives error. I have not changed anything in this code. I copied the codes in Energia, pasted them below.

Energia: 1.8.11E23 (Windows 10), Kart:"MSP-EXP430F5529LP"

C:\Users\Laçin Tuncer\Downloads\energia-1.8.10E23-windows\energia-1.8.10E23\hardware\energia\msp430\cores\msp430\atof.c: In function 'atof':

C:\Users\Laçin Tuncer\Downloads\energia-1.8.10E23-windows\energia-1.8.10E23\hardware\energia\msp430\cores\msp430\atof.c:71:9: warning: floating constant exceeds range of 'double' [-Woverflow]

sketch\PGA460_USSC.cpp.o: In function `pga460::initBoostXLPGA460(unsigned char, unsigned long, unsigned char)':

PGA460_USSC.cpp:(.text._ZN6pga46017initBoostXLPGA460Ehmh+0x248): undefined reference to `spi_initialize_pga460()'

PGA460_USSC.cpp:(.text._ZN6pga46017initBoostXLPGA460Ehmh+0x24e): undefined reference to `spi_set_bitorder_pga460(unsigned char)'

PGA460_USSC.cpp:(.text._ZN6pga46017initBoostXLPGA460Ehmh+0x254): undefined reference to `spi_set_datamode_pga460(unsigned char)'

PGA460_USSC.cpp:(.text._ZN6pga46017initBoostXLPGA460Ehmh+0x25a): undefined reference to `spi_set_divisor_pga460(unsigned int)'

sketch\PGA460_USSC.cpp.o: In function `pga460::spiTransfer(unsigned char*, unsigned char)':

PGA460_USSC.cpp:(.text._ZN6pga46011spiTransferEPhh+0x2c): undefined reference to `spi_send_pga460(unsigned char)'

sketch\PGA460_USSC.cpp.o: In function `pga460::spiMosiIdle(unsigned char)':

PGA460_USSC.cpp:(.text._ZN6pga46011spiMosiIdleEh+0x24): undefined reference to `spi_send_pga460(unsigned char)'

collect2: ld returned 1 exit status

exit status 1
MSP-EXP430F5529LP kartı için derleme hatası.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Why couldn't I compile the code? With this code I just want to test the PGA460EVM module. Please help me. If it is possible, could you simplify the code according to a communication protocol only (preferably SPI)? 

  • Hi Lacin,

    I just confirmed on a fresh PC that the latest PGA460 Energia project and library files can run successfully on the latest version of Energia.

    Can you confirm you applied the following steps?:

    1. Import the PGA460 library by navigating to "Sketch --> Include Library --> Add .ZIP Library..."
    2. Select the slac741i.zip (PGA460 Energia Library and Code Example) downloaded from TI.com.
    3. To open the default PGA460 sketch, navigate to "Examples --> PGA460_USCC --> GetDistance"
    4. The GetDistance.ino sketch will open in a new window.
    5. Be sure the MSP-EXP430F5529LP board is selected from "Tools --> Board"
    6. Click the Verify and Upload buttons to compile and program the LaunchPad

    These are the steps I followed for a successful compile and upload without changing anything in the sketch or library files.

    Did you install the MSP430 USB drivers and debug stack as specified on the "Installing the LaunchPad drivers" page of Energia's site?: https://energia.nu/guide/install/windows/

  • I already done all the steps. I installed "Energia Driver Package" like told in the site that "https://energia.nu/guide/install/windows/". I installed the "Energia Driver Package" on "energia.nu/.../". But it still gives error as follows.

    Energia: 1.8.11E23 (Windows 10), Kart:"MSP-EXP430F5529LP"

    In file included from D:\Geri Gorus Lambasi\Arduino\examples\GetDistance\GetDistance.ino:14:0:

    PGA460_USSC.h:39:7: error: redefinition of 'class pga460'

    C:\Users\Laçin Tuncer\Documents\Energia\libraries\PGA460EnergiaLibrary-G2553-SPI_v1.0.9/PGA460_USSC_G2553.h:39:7: error: previous definition of 'class pga460'

    D:\Geri Gorus Lambasi\Arduino\examples\GetDistance\GetDistance.ino: In function 'void initPGA460()':

    GetDistance:290:25: error: 'class pga460' has no member named 'pullEchoDataDumpBulk'

    Multiple libraries found for "PGA460_SPI_G2553.h"

    Kullanılıyor: C:\Users\Laçin
    exit status 1
    redefinition of 'class pga460'

    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.


    I think, I have trouble with this item.

    Import the PGA460 library by navigating to "Sketch --> Include Library --> Add .ZIP Library..."

    Could you send me PGA460 Library ZIP file? I included "PGA460EnergiaLibrary-G2553-SPI_v1.0.9.zip" file.

  • Hi Lacin,

    If you are using the default/recommended MSP-EXP430F5529LP, you do not need to unzip the "PGA460EnergiaLibrary-G2553-SPI_v1.0.9.zip" file.

    If you have unzipped this file within the slac741i.zip folder, then Energia will throw errors. Try removing the extracted contents from the "PGA460EnergiaLibrary-G2553-SPI_v1.0.9.zip", and rerun the Verify.

  • Hi,

    I don't use  MSP-EXP430F5529LP, I mean, I didn't use yet any card. I want to only compile the code. I don't understand what you said about library. Please could you explain more clearly?

  • Lacin,

    Please repeat the following steps and take note of the clarifying details in red:

    1. Import the PGA460 library by navigating to "Sketch --> Include Library --> Add .ZIP Library..."
      1. Before doing this, check what libraries you have listed in the "C:\Users\(user_name)\Documents\Energia\libraries" directory. You should see "PGA460EnergiaLibrary_v1.0.9" listed if you imported the correct zip file. If you see "PGA460EnergiaLibrary-G2553-SPI_v1.0.9", you imported the incorrect file. See step 2 for details.
    2. Select the slac741i.zip (PGA460 Energia Library and Code Example) downloaded from TI.com.
      1. You are selecting and importing the "slac741i.zip", not the "PGA460EnergiaLibrary-G2553-SPI_v1.0.9.zip". To avoid confusion, delete the "PGA460EnergiaLibrary-G2553-SPI_v1.0.9.zip" inside the "slac741i.zip" so that the "slac741i.zip" contents look like:   Notice, in the snapshot, there is no longer a "PGA460EnergiaLibrary-G2553-SPI_v1.0.9.zip" file. I make this point because your error message indicates the compiler is searching through files containing "_G2553", which is why I suspect you imported the wrong zip file.

    3. To open the default PGA460 sketch, navigate to "Examples --> PGA460_USCC --> GetDistance"
    4. The GetDistance.ino sketch will open in a new window.
    5. Be sure the MSP-EXP430F5529LP board is selected from "Tools --> Board"
      1. Even though you don't have any hardware connected, you still need to select the correct board to get the code to compile. The F5529 is different from the G2553 board, which is another conflict your error message shows. You did and probably do have the correct F5529 board selected, but your error message shows, for example, "Multiple libraries found for "PGA460_SPI_G2553.h"". These are the types of clues I look for when debugging.
    6. Click the Verify and Upload buttons to compile and program the LaunchPad

  • Energia: 1.8.11E23 (Windows 10), Board: "MSP-EXP430F5529LP"

    libraries\slac741i\PGA460_USSC.cpp.o: In function `pga460::initBoostXLPGA460(unsigned char, unsigned long, unsigned char)':

    PGA460_USSC.cpp:(.text._ZN6pga46017initBoostXLPGA460Ehmh+0x1e4): undefined reference to `Serial1'

    PGA460_USSC.cpp:(.text._ZN6pga46017initBoostXLPGA460Ehmh+0x1f2): undefined reference to `Serial1'

    PGA460_USSC.cpp:(.text._ZN6pga46017initBoostXLPGA460Ehmh+0x238): undefined reference to `Serial1'

    PGA460_USSC.cpp:(.text._ZN6pga46017initBoostXLPGA460Ehmh+0x2ae): undefined reference to `Serial1'

    libraries\slac741i\PGA460_USSC.cpp.o: In function `pga460::ultrasonicCmd(unsigned char, unsigned char)':

    PGA460_USSC.cpp:(.text._ZN6pga46013ultrasonicCmdEhh+0x8e): undefined reference to `Serial1'

    libraries\slac741i\PGA460_USSC.cpp.o:PGA460_USSC.cpp:(.text._ZN6pga4607initTVGEhh+0x6c): more undefined references to `Serial1' follow

    collect2: ld returned 1 exit status

    Multiple libraries were found for "PGA460_USSC.h"
    Used: C:\Users\Laçin
    exit status 1
    Error compiling for board MSP-EXP430F5529LP.

    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.

    I did all step by step you told. This is my new error... 

  • Hi Lacin,

    How many instances of the "PGA460_USSC.h" file do you have in your Energia folder?

    Your error report indicates you have more than one: "Multiple libraries were found for "PGA460_USSC.h"".

    Be sure that you only have one PGA460 library folder.

  • Only one PGA460_USSC.h file was included. The problem is only Energia, I deleted the program and reinstalled it. Fixed