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.

IAR compilation errors

Hello every one.

I am trying to implement a code for SPI interface using IAR embedded workbench. When I compile the code with CCS I have no problems - everything  works well.

But when press F7 to compile the code I get these error messages:

And this is the complete code:

#include <stdint.h>
#include <stdbool.h>
#include "driverlib/sysctl.h"
#include "driverlib/gpio.h"
#include "driverlib/gpio.c"
#include "driverlib/pin_map.h"
#include "driverlib/ssi.h"
#include "inc/hw_ssi.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "inc/hw_gpio.h"

#define TRUE		1

void SSIInit(void);

int main ()
{
	SysCtlClockSet(SYSCTL_SYSDIV_2_5| SYSCTL_USE_PLL | SYSCTL_OSC_INT | SYSCTL_XTAL_16MHZ);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);

	SSIInit();
	while(TRUE)
	{
        }
}

void SSIInit(void)
{
	SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI0);
	SysCtlDelay(3);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
	SysCtlDelay(3);

	GPIOPinConfigure(GPIO_PA5_SSI0TX);
	GPIOPinConfigure(GPIO_PA2_SSI0CLK);
	GPIOPinConfigure(GPIO_PA3_SSI0FSS);

	GPIOPinTypeSSI(GPIO_PORTA_BASE, GPIO_PIN_5);
	GPIOPinTypeSSI(GPIO_PORTA_BASE, GPIO_PIN_2);
	GPIOPinTypeSSI(GPIO_PORTA_BASE, GPIO_PIN_3);

	SSIIntClear(SSI0_BASE,SSI_TXEOT);
	SSIConfigSetExpClk(SSI0_BASE, 64000000, SSI_FRF_MOTO_MODE_0, SSI_MODE_MASTER, 10000000, 16);
	SSIEnable(SSI0_BASE);
}

I set the include directory in the preprocessors option of the compiler. But the problem is that the functions into ssi.h are only declared but not defined. So may be some link is needed? I don't know. 
Any help would be much appreciated. 

  • We too used that simple, existing "blinky" project as a, "starting point" for a more complex program.

    Suspect this setting - found under: "Project > Options  will resolve:

    We note that you include driver lib's: "gpio.c" - this most always is a bad idea - include of gpio.h should prove sufficient.

    The blinky project is very specialized - was deliberately intended as such - and may not prove "best" as "take off" point for your development...

  • Hi Radoslav,

    I definitely discourage the use of Blinky as a starting point, I think they should add a comment on the top stating clearly "Do not use as a starting point as base for TivaWare driver library based projects" or something well written in those lines. It's not what's intended for.


    Use something like the example "hello".
  • Thank you Guys for the advises. Although my problem is different. I don't want to use an existing project because I don't want to modify the example. When I Add existing project I am actually not making a copy of the project. instead I modify the example itself in its very location. Anyway I found a solution on my problem. It was necessary to  specify the library file into the linker (inside the project options). The library file is located at this directory: TivaWare_C_Series2.1.0.12573\driverlib\ewarm\Exe\driverlib.a. 

    Loading that file into the linker's library solved the problem. 

    I don't find it difficult to create your own project using Tiva Ware libraries. Unlike the CCS, in IAR is pretty simple 

    1 Create a new project.

    2 Select your build directory e.g. C:\TI\TivaWare_C_Series-2.1.0.12573

    3 Select your library file into the linker.

    And that's all (in my case).

    Anyway thank you again guys!

  • Radoslav Marinov said:
    It was necessary to  specify the library file into the linker (inside the project options).

    And why was that?   Look at our settings:

    and

    You'll note that we found NO SUCH NECESSITY to specify the library file into the linker.   Isn't that "special, extra effort specifying" a huge disadvantage - especially when you move to another project - or projects?   (we think so)

    I'm not so sure I'd want to propagate your "methods" - not when more standard and more efficient ones pre-exist...

  • cb1 unfortunately I don't get your idea. The reason I use library file into the linker is that, this was the only approach that made my code work.
  • I took time/effort to provide pertinent screen-caps. You acknowledged none.
    Use of "your approach" forces extra effort - each/every project - and I'd bet will reveal "holes/weaknesses" - if not sooner then later...
  • Thank you cb1 for your "great efforts" but your screen caps shows nothing.

    You either don't want to help me or you can't. Although it is not mandatory to help if you don't want to. 

  • Radoslav Marinov said:
    your screen caps shows [sic] show nothing.

    Really - you don't actually believe that - do you?

    Do they not reveal - in detail - how IAR should (properly) link to this vendor's driver library?

    While your attempt at psycho-analysis is acknowledged - it (too) is incorrect.

    Screen caps I posted enable our firm to successfully run "much modified blinky" - without resort to the "special" methods you offered up to those (unwary) here...

    (attacking those - trying to assist you - may not prove your "best ever" approach.)   (here or in life - in general)