STM32G491KEU6 - booting problem
Hello,
I need to use a nRST pin as MCO in my aplication and programm my STM with STlink v3-set. I set up a MCO to output 8MHz signal and set nRST pin to GPIO with code you can see bellow. Now I have a problem with booting - I cannot connect to STM, CubeProgrammer have a error: 10:00:55 : Error: Data read failed
Can you please help me, how to fix that? I tried to used software reset, which does not help.
btw I can connect to STM only via STlink - I made a custom PCB for my application
Thank you
HAL_FLASH_Unlock();
HAL_FLASH_OB_Unlock();
OBInit.OptionType = OPTIONBYTE_USER;
OBInit.USERType = OB_USER_NRST_MODE;
OBInit.USERConfig = FLASH_OPTR_NRST_MODE_1;
HAL_FLASHEx_OBProgram(&OBInit);
HAL_FLASH_OB_Launch();
HAL_FLASH_OB_Lock();
HAL_FLASH_Lock();
