cancel
Showing results for 
Search instead for 
Did you mean: 

Timer initialization prompts build error SPC560 test program

AK V
Associate II

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 discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
1 ACCEPTED SOLUTION

Accepted Solutions
Erwan YVIN
ST Employee

Hello nanda ,

you have forgotten to put the callback associated in your main.c

i miss the point

/*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){}
}

View solution in original post

2 REPLIES 2
AK V
Associate II

can any one support on this please

Erwan YVIN
ST Employee

Hello nanda ,

you have forgotten to put the callback associated in your main.c

i miss the point

/*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){}
}