We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi! I have a problem receiving (by interrupt) more than a byte from serial port on STM32 project. could you please post an example code?
void USARTx_IRQHANDLER(void) { if (USART_GetITStatus(USART3, USART_IT_RXNE)) { /* Read one byte from the receive data register /*RxBuffer[RxCounter++] = (USART_ReceiveData(USART3) & 0x7F); if(RxBuffer[RxCounter] == '\r') { /* Disable the COM1 Receive interrupt USART_ITConfig(USART3, USART_IT_RXNE, DISABLE); */
t = USART3->DR; // the character from the USART1 data register is saved in t
/* check if the received character is not the LF character (used to determine end of string) * or the if the maximum string length has been been reached */
if (t != '\r') { buff[cnt] = t; cnt++; } else { // otherwise reset the character counter and print the received string cnt = 0; //USART_puts(USART3, received_string); //USART_ITConfig(USART3, USART_IT_RXNE, DISABLE); } }
what's wrong?
I have a problem no, you have two 1) reading and following the instructions in the "Enter Message Details Below" 2) telling WHAT the problem is. With SILabs chips, you have debugging available to state things like e.g. "the ISR does not get called"
downloading some code or throwing it together and then posting it is not an accepted debugging method
Erik
You mean, "With STM32 chips, you have debugging available..."