I have Hard fault when USB device Attached to my STM32F407.
STM32CubeMX makes rtos STACK SIZE default to 128 bytes.
It is too small.
You can increase stack size.
Filename : USB_HOST/Target/usbh_config.h
Original (ERROR case)
#if (USBH_USE_OS == 1)
#include "cmsis_os.h"
#define USBH_PROCESS_PRIO osPriorityNormal
#define USBH_PROCESS_STACK_SIZE ((uint16_t)128)
#endif /* (USBH_USE_OS == 1) */
Fix (ERROR case)
#if (USBH_USE_OS == 1)
#include "cmsis_os.h"
#define USBH_PROCESS_PRIO osPriorityNormal
#define USBH_PROCESS_STACK_SIZE ((uint16_t)2048)
#endif /* (USBH_USE_OS == 1) */
No comments:
Post a Comment