2023-06-19 02:44 AM
To,
Sir or Madam
I am making a embedded system with MCU STM32F103RETxLQFP64. In this MCU pin PC10 and PC11 is multipurpose pin. I use it for UART.
In project, PC10 and PC11 is used as GPIOs. I change functionality of pin. I used pin PC10 for UART4_TX and pin PC11 for UART4_RX. In cubeMX, I change functionality of pin and enable interrupt for reception. I generate code from cubeMX. In program I found UART4 initialization, transmission and reception function. I wrote program for UART communication.
System do not start after change of PC10 and PC11 functionality. On power on of system, program flow do not go to main() function.
Please give guidance to implement UART4 in this MCU.
2023-06-19 11:04 PM
And where does it go?
In disassembly view in debugger, where does PC (program counter) point?
JW
2023-06-20 05:06 AM - edited 2023-06-20 05:06 AM
stm32f1xx_it.h
+ Interrupt handler declare
main.c
+ UART4 intilization (baudrate)
stm32f1xx_hal_msp.c
+ UART4 hardware initilizaiton (pin)
+ UART4 hardware deinitialization
stm32f1xx_it.c
+ UART4 interrupt function
stm32f1xx_hal_uart.h
+ UART reception callback funtion decleartion
stm32f1xx_hal.c
+ HARL version update from 1.7 to 1.8
stm32f1xx_hal_adc.c , stm32f1xx_hal_adc_ex.c
+ ADC time detection program
stm32f1xx_hal_uart.c
+ function to receive data in blocking mode and non blocking mode
+ function to receive data in interrupt mode and DMA mode
Please give guidance to use UART 4.
2023-06-21 09:57 AM
From this description it's hard to judge where's the problem. It may be RCC_Delay() (? look into that function) or it may be any interrupt - check if VTOR is set properly and if you have the proper interrupt table. Alternatively try to disable all interrupts as a test.
JW
2023-06-21 09:11 PM
Watch the interrupt priorities, and avoid using delays in interrupts and call-backs.