2023-12-12 06:35 PM
I generated some code with the default "Electronic speed control on B-G431B-ESC1 kit" project in Motor Control WorkBench. Then when I flash the default code I get a HardFault when calling `__HAL_FLASH_PREFETCH_BUFFER_ENABLE()` in `HAL_Init()`:
int main(void)
{
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
...
HAL_StatusTypeDef HAL_Init(void)...
#if (PREFETCH_ENABLE != 0U)
__HAL_FLASH_PREFETCH_BUFFER_ENABLE();
#endif /* PREFETCH_ENABLE */
MC Workbench v6.2
CubeMX version 6.9.2
CubeIDE version 1.14.0
Solved! Go to Solution.
2023-12-13 06:14 AM
Hello,
I was able to pass the HAL_init step on "ElectronicSpeedControl_ESC-G4" example with MC Workbench v6.2, CubeMX version 6.9.2, CubeIDE version 1.14.0, (Firmware Package Version STM32 FW V1.5.1) and Drive Type LL or HAL.
Could you please check that via IDE you have access to FLASH registers as below?
2023-12-13 06:14 AM
Hello,
I was able to pass the HAL_init step on "ElectronicSpeedControl_ESC-G4" example with MC Workbench v6.2, CubeMX version 6.9.2, CubeIDE version 1.14.0, (Firmware Package Version STM32 FW V1.5.1) and Drive Type LL or HAL.
Could you please check that via IDE you have access to FLASH registers as below?
2023-12-13 08:30 AM
I tried regenerating the project and was able to pass this init step without hardfault. The only other thing I did was update STLink. Not sure why the problem went away but thank you.
2023-12-13 11:17 PM
Hello,
Thank you for your feedback!