Question
How can I read and write simultaneously on specific SRAM address STM32.
Hi,
In the cases below I try to read value of an SRAM address which is in TIM2_IRQHandler(), from main() function or user Program() function, but no result!
anyone who is experienced or has idea?
void Program();
void TIM2_IRQHandler()
{
if(__HAL_TIM_GET_ITSTATUS(&TIM2_HandleStruct, TIM_IT_UPDATE) !=RESET)
__HAL_TIM_CLEAR_IT(&TIM2_HandleStruct, TIM_IT_UPDATE);
*(__IO uint32_t *) 0x20020000 = Write1++;
if(Write1 == 1000)
Write1 = 0;
}
int main()
{
HAL_Init();
SystemClock_Config();
...
...
...
...
...
Program();
if(*(__IO uint32_t *) 0x20020000 == 10) // Does not work!!!
{
HAL_GPIO_TogglePin(GPIOB, GPIO_PIN_14);
}
for(;;)
{
if(*(__IO uint32_t *) 0x20020000 == 10) // Does not work!!!
{
HAL_GPIO_TogglePin(GPIOB, GPIO_PIN_14);
}
}
}
void Program()
{
if(*(__IO uint32_t *) 0x20020000 == 10) // Does not work!!!
{
HAL_GPIO_TogglePin(GPIOB, GPIO_PIN_14);
}
}