cancel
Showing results for 
Search instead for 
Did you mean: 

UART Rx Interrupt never get in to a HAL_UART_RxCpltCallback for CM4

PNaro.1
Associate II

Dear all,

I am using NUCLEO-H745ZIQ for the UART communication.

I try to use the UART RX Interrupt to get the data from PC. I set the UART parameters as same as I was use for the STM32F4 which work fine. Currently, I would like to use both of CM4 and CM7, CM4 used UART1 and CM7 used UART3.

My problem is the UART Rx interrupt is go to HAL_UART_RxCpltCallback only in the CM7, but for the CM4, it never go to the HAL_UART_RxCpltCallback function.

However, for the other interrupts are work find for both CM4 and CM7 such as timer interrupts.

Could you please help me, may be I did some miss configuration.

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions

Thank you for reporting this issue. I escalated the issue internally about UART1 as it fails. Could you please try other instances of UART? We will get back to you as soon as possible.

Internal ticket number: 146554 (This is an internal tracking number and is not accessible or usable by customers).

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

9 REPLIES 9
FBL
ST Employee

Hello @PNaro.1​ ,

Would you share your UART1 configuration please?

This issue may occur if the Interrupt is disabled. Could you ensure that the UART1 interrupt is enabled on the CM4 core. Also, you may need to check the UART1 interrupt priority. You may need to check the NVIC configuration.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi @F.Belaid​ 

Thanks for replying me.

This is my UART1 configuration.

I tried both enable and disable the UART1 global interrupt but it is not work.

I already checked the NVIC2 which control the interrupt for CM4 to make sure that the UART1 global interrupt and DMA interrupt are enabled.

What about the interrupt priority? Which priority should I set?

Thank you

0693W00000aHWscQAG.png 

You should enable USART1 global interrupt.

It is important to consider the priorities of the interrupts. Depending on your application, while the processor running in the handler mode multiple interrupts, you can set the priority of each peripheral to preempt or be preempted.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

I already enable USART1 global interrupt but result still the same.

And I got another problem, even the CM7 UART3 get into the HAL_UART_RxCpltCallback, but the DMA variable get nothing.

uint8_t UART3_rxBuffer[1];
void main() {
      HAL_UART_Receive_DMA(&huart3, UART3_rxBuffer, 1);
}
 
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) {
      printf("%c\n", UART3_rxBuffer[0]);
      HAL_UART_Receive_DMA(&huart3, UART3_rxBuffer, 1);
}

Could you check DMA configuration for UART3 on the CM7 core is set up correctly?

DMA transfers are properly managed and do not interfere with each other.

If the memory used for DMA transfers is not properly managed and interfere with each other, it can result in unexpected behavior in your code.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

This is my UART3 configuration. I still cannot get the correct data.

0693W00000aHevjQAC.png 

For UART1, after I changed from the CM4 to CM7, it can get into the HAL_UART_RxCpltCallback function. But the data from DMA is wrong same as UART3.

Why UART1 cannot work with CM4 but work for CM7 even the data is wrong but at least the interrupt is handled.

Thank you for reporting this issue. I escalated the issue internally about UART1 as it fails. Could you please try other instances of UART? We will get back to you as soon as possible.

Internal ticket number: 146554 (This is an internal tracking number and is not accessible or usable by customers).

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Dear @F.Belaid​ 

After I tested all I can, it came up with all UART fail to get into the HAL_UART_RxCpltCallback function for the CM4. However, for the CM7, they are all good.

In addition, the CM7 also had a problem with the DMA. As I mentioned about DMA cannot retrieve the correct data from UART (this configuration and code are work perfectly for the other STM32). My solution for now is to use the HAL_UART_Receive_IT function instead of HAL_UART_Receive_DMA which is work fine.

Hopefully, I can use the UART interrupt for CM4 and DMA for both CM4 and CM7.

Thanks in advance.

Regards,

Hello @PNaro.1 ,

Here is an example project to run it.

https://github.com/FirasST/H745_UART_IT_CM4

Unfortunately, the project exceeds the maximum file size allowed on community. This setup has been tested and works perfectly fine.
I hope the issue is solved for good.

Firas

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.