Associate II
June 1, 2021
Solved
Hard_Fault handler error on API call for basic UART driver for Nucleo-F303RE
- June 1, 2021
- 2 replies
- 1080 views
I was trying to write a simple UART driver using polling method to run on my Nucleo-F303RE. I tried 2 different approaches:
- I wrote the function intpolldriver() to write an integer value between UART4 and UART5 in the main.c, called it in main() and compiled the code. It was built and ran successfully, passing values b/w both UARTs verified by TDR value of UART4 and RDR value of UART5.
- I wrote another function uartintpolldriver(), which accepts the UART handlers for UART4 and UART5, as an API and called it in main(). Though it compiled without errors and was expected to run exactly as above (the function code is exactly the same), it instead branched into hard_fault_handler.
It seems to me like more should be passed to the API function uartintpolldriver() rather than just the UART handlers. Or am I missing something more here?
What could be wrong here? How do I fix it? It would be helpful if someone could give a pointer on how to do this. Attached below is a zip of my log and source code.
