Enabling SBSFU security flags cripples my code
I've ported the SBSFU package for my user app. It works great when only read out protection is enabled. Everything works as it supposed to. However, when I activate other security flags random errors/problems arise in the code. For example, when I activate the PCROP, a timer based PWM stops working. I'm using HAL library for this PWM so I'm not sure how the error might come from my code.
TIM_OC_InitTypeDef sConfigOC;
sConfigOC.OCMode = TIM_OCMODE_PWM1;
sConfigOC.Pulse = (uint32_t)dCycle*10; // 1000 count PWM timer
sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH;
sConfigOC.OCFastMode = TIM_OCFAST_DISABLE;
HAL_TIM_PWM_ConfigChannel(hboard.release_tim, &sConfigOC, TIM_CHANNEL_1);
HAL_TIM_PWM_Start(hboard.release_tim, TIM_CHANNEL_1);I've had trouble with other security flags too. For example when I activated MPU_USERAPP my user app starts started to consistently crash with hard faults in a module so I deactivated it. The funny thing is that after some development on other parts of my code, I can activate this flag now without any hard faults.
I am not sure what is the source of these problems but I sure want to take care of them. I would appreciate any guidance.
