2021-03-22 02:17 AM
I am working on a project where I have managed to detect any printer using USB driver provided by STM-HAL.
All this code is developed on STM32F407VG MUC Discovery Board. Which is working fine and I am able to print the labels as i want without any error.
But Now I need to run this code on STM32F405RG MCU for this I made my custom PCB. When I run this code I got HARD Fault.
Although my code is able to detect my attached printer.
So when Ever my HOST detect it prints on my serial port using UART2.
After printing interrupt occures and control goes to hard fault.
Q.1 : When I am running STM32F407VG code on this F405 MCU. It directly running without any error. Why we don't required any change i.e MACRO or include file include ????
Q.2 I am using another printer where I am not able to get printer ID.
All this is happening on F405 MCU(custom board ) but not on F407 MCU.
2022-08-10 07:47 AM
Looking at the code in UART_WaitOnFlagUntilTimeout() will not help. That is NOT where the fault occurred. Look at HAL_HDC_IRQHandler() (the function just before fault handler was called). Also, CubeIDE has a built-in fault analyzer. What it that telling you about the fault?