cancel
Showing results for 
Search instead for 
Did you mean: 

UART transmit reacive is not working

Ajadh.1
Associate II

Hi,

I am using stm8s105c6 for UART transmit receive program. I am using Eclipse with SDCC compiler.

I am getting error as

?ASlink-Warning-Undefined Global '_TIM3_CAP_COM_IRQHandler' referenced by module 'main'

make: *** [main] Error 1

Hope someone will guide me.

Thanks in advance

3 REPLIES 3
Ozone
Lead

You seem to call a function that does not exist in your project.

Ajadh.1
Associate II

Thanks Ozone.

Please see program,

#include "stm8s.h"

#include <stdio.h>

#include "stm8s_uart2.h"

#include "gpio.h"

#include "stm8s_gpio.h"

#include "stm8s_clk.h"

#include "stm8s_it.h"

void main(void){

CLK_HSIPrescalerConfig(CLK_PRESCALER_HSIDIV1);

GPIO_DeInit(GPIOD);

/* Configure PD5/6 */

GPIO_Init (UART2_TX__PORT, UART2_TX__PIN, GPIO_MODE_OUT_PP_HIGH_FAST); // send data IO

GPIO_Init (UART2_RX__PORT, UART2_RX__PIN, GPIO_MODE_IN_FL_NO_IT); // accept data IO

UART2_DeInit();

UART2_Init((uint32_t)115200,UART2_WORDLENGTH_8D,UART2_STOPBITS_1,UART2_PARITY_NO,UART2_SYNCMODE_CLOCK_DISABLE,UART2_MODE_TXRX_ENABLE); //Baud rate 2400 8-bit data

UART2_ITConfig (UART2_IT_RXNE_OR, ENABLE); // agree to accept the interrupt

UART2_ITConfig(UART2_IT_TXE, ENABLE);

UART2_Cmd (ENABLE); // enable serial port

enableInterrupts();   //Open total interrupt

while(1){

}

}

and I am getting errors are:

?ASlink-Warning-Undefined Global '_CLK_IRQHandler' referenced by module 'main'

?ASlink-Warning-Undefined Global '_EXTI_PORTA_IRQHandler' referenced by module 'main'

?ASlink-Warning-Undefined Global '_EXTI_PORTB_IRQHandler' referenced by module 'main'

?ASlink-Warning-Undefined Global '_EXTI_PORTC_IRQHandler' referenced by module 'main'

?ASlink-Warning-Undefined Global '_EXTI_PORTD_IRQHandler' referenced by module 'main'

?ASlink-Warning-Undefined Global '_EXTI_PORTE_IRQHandler' referenced by module 'main'

?ASlink-Warning-Undefined Global '_TLI_IRQHandler' referenced by module 'main'

?ASlink-Warning-Undefined Global '_SPI_IRQHandler' referenced by module 'main'

?ASlink-Warning-Undefined Global '_TIM2_UPD_OVF_BRK_IRQHandler' referenced by module 'main'

?ASlink-Warning-Undefined Global '_AWU_IRQHandler' referenced by module 'main'

?ASlink-Warning-Undefined Global '_TIM3_UPD_OVF_BRK_IRQHandler' referenced by module 'main'

?ASlink-Warning-Undefined Global '_TIM4_UPD_OVF_IRQHandler' referenced by module 'main'

?ASlink-Warning-Undefined Global '_EEPROM_EEC_IRQHandler' referenced by module 'main'

?ASlink-Warning-Undefined Global '_TRAP_IRQHandler' referenced by module 'main'

?ASlink-Warning-Undefined Global '_TIM1_UPD_OVF_TRG_BRK_IRQHandler' referenced by module 'main'

?ASlink-Warning-Undefined Global '_UART2_RX_IRQHandler' referenced by module 'main'

?ASlink-Warning-Undefined Global '_UART2_TX_IRQHandler' referenced by module 'main'

?ASlink-Warning-Undefined Global '_ADC1_IRQHandler' referenced by module 'main'

?ASlink-Warning-Undefined Global '_I2C_IRQHandler' referenced by module 'main'

?ASlink-Warning-Undefined Global '_TIM1_CAP_COM_IRQHandler' referenced by module 'main'

?ASlink-Warning-Undefined Global '_TIM2_CAP_COM_IRQHandler' referenced by module 'main'

?ASlink-Warning-Undefined Global '_TIM3_CAP_COM_IRQHandler' referenced by module 'main'

make: *** [main] Error 1

D:\ash_eclipse_workspace_2\uart>ren main.ihx main.hex 

I hope you could guide me further.

Philipp Krause
Senior II

Looks like you are using some library (SPL, I guess), and including the header files for it, but not linking the library into your binary. I think you are just missing some -l option to your linker command.