Skip to main content
AK V
Associate II
January 4, 2019
Solved

Timer initialization prompts build error SPC560 test program

  • January 4, 2019
  • 4 replies
  • 2804 views

Hello,

I have built LED blinky test program in SPC560B-DIS eval, I am setting and clearing LEDs in eval bord. I have introduced delay "osalThreadDelayMilliseconds(500);" between set and clear.

I have used below code for my application, but it throws build error please find attached build error. Please guide to fix the error,

Note if I am commenting line "stm_lld_start(&STMD1,stm0_config);" starts working. but if including throws build error

#include "components.h"

#include "stm_lld_cfg.h"

int main(void)

{

componentsInit();

/* Enable Interrupts */

 irqIsrEnable();

 /* Activates STM0 Driver */

 stm_lld_start(&STMD1,stm0_config);

 /* Enable channels and start global counter */

 stm_lld_enable(&STMD1);

for (;;)

{

pal_lld_setpad(PORT_C, PIN_GPIO34_LED);

osalThreadDelayMilliseconds(500); // Delay 500 ms

pal_lld_clearpad(PORT_C, PIN_GPIO34_LED);

osalThreadDelayMilliseconds(500); // Delay 500 ms

}

}

    This topic has been closed for replies.
    Best answer by Erwan YVIN

    Hello Nanda ,

    You have forgotten to put the call back associated (Cf Demos)

    in your main.c

    /*stm0 channel 0 callback*/
    void cb_stm0_ch0 (void){
     uint8_t message[]= "STM0 Channel 0 expired!\r\n";
     while (sd_lld_write(&SD1,message,(uint16_t)(sizeof(message)/sizeof(message[0]))) == SERIAL_MSG_WAIT){}
    }
     
    /*stm0 channel 1 callback*/
    void cb_stm0_ch1 (void){
     uint8_t message[]= "STM0 Channel 1 expired!\r\n";
     while (sd_lld_write(&SD1,message,(uint16_t)(sizeof(message)/sizeof(message[0]))) == SERIAL_MSG_WAIT){}
    }
     
    /*stm0 channel 2 callback*/
    void cb_stm0_ch2 (void){
     uint8_t message[]= "STM0 Channel 2 expired!\r\n";
     while (sd_lld_write(&SD1,message,(uint16_t)(sizeof(message)/sizeof(message[0]))) == SERIAL_MSG_WAIT){}
    }
     
    /*stm0 channel 3 callback*/
    void cb_stm0_ch3 (void){
     uint8_t message[]= "STM0 Channel 3 expired!\r\n";
     while (sd_lld_write(&SD1,message,(uint16_t)(sizeof(message)/sizeof(message[0]))) == SERIAL_MSG_WAIT){}
    }

    Best regards

    Erwan

    4 replies

    Erwan YVIN
    ST Employee
    January 10, 2019

    Hello ,

    1) you have to configure the components like the application

    SPC560BCxx_RLA STM Test Application

    2) Put the good clock for B Discovery

    3) Regenerate

    4) Compile

    Best regards

    Erwan

    AK V
    AK VAuthor
    Associate II
    January 11, 2019

    Hello Erwan,

    Thanks for you reply,

    I had closely followed the example, i.e. the SPC560BCxx_RLA STM Test Application, I couldn't find anything, I have generated the files successfully but compiling the files gives the error especially object file linking step step.

    Thanks,

    Anand

    Erwan YVIN
    ST Employee
    January 11, 2019

    Hello Nandan ,

    Could you send me your installation details ?

    Best regards

    Erwan

    AK V
    AK VAuthor
    Associate II
    January 16, 2019

    Dear Erwan,

    Thanks for your prompt reply ,

    Please see attached installation details for your reference. hope you can help me out with the problem.

    please guide if anything more to be installed.

    Thanks in Advance

    Anand

    Erwan YVIN
    Erwan YVINBest answer
    ST Employee
    February 7, 2019

    Hello Nanda ,

    You have forgotten to put the call back associated (Cf Demos)

    in your main.c

    /*stm0 channel 0 callback*/
    void cb_stm0_ch0 (void){
     uint8_t message[]= "STM0 Channel 0 expired!\r\n";
     while (sd_lld_write(&SD1,message,(uint16_t)(sizeof(message)/sizeof(message[0]))) == SERIAL_MSG_WAIT){}
    }
     
    /*stm0 channel 1 callback*/
    void cb_stm0_ch1 (void){
     uint8_t message[]= "STM0 Channel 1 expired!\r\n";
     while (sd_lld_write(&SD1,message,(uint16_t)(sizeof(message)/sizeof(message[0]))) == SERIAL_MSG_WAIT){}
    }
     
    /*stm0 channel 2 callback*/
    void cb_stm0_ch2 (void){
     uint8_t message[]= "STM0 Channel 2 expired!\r\n";
     while (sd_lld_write(&SD1,message,(uint16_t)(sizeof(message)/sizeof(message[0]))) == SERIAL_MSG_WAIT){}
    }
     
    /*stm0 channel 3 callback*/
    void cb_stm0_ch3 (void){
     uint8_t message[]= "STM0 Channel 3 expired!\r\n";
     while (sd_lld_write(&SD1,message,(uint16_t)(sizeof(message)/sizeof(message[0]))) == SERIAL_MSG_WAIT){}
    }

    Best regards

    Erwan