2019-08-09 12:34 PM
Using a STM32F0 discovery board, I have this function:
void BlinkBlue(void)
{
for (int i=0; i<20; i++)
{
HAL_GPIO_WritePin(LD4_GPIO_Port, LD4_Pin, GPIO_PIN_SET);
HAL_Delay(50);
HAL_GPIO_WritePin(LD4_GPIO_Port, LD4_Pin, GPIO_PIN_RESET);
HAL_Delay(50);
}
}
and I can call it in code by using:
BlinkBlue();
All good.
The .map file says it's location at address 0x8000a9c . But it doesn't work if I instead call it using:
((void (*)(void))0x8000A9C)();
Any idea why this wouldn't work? Thanks.
Solved! Go to Solution.
2019-08-09 01:36 PM
>>Any idea why this wouldn't work?
Thumb code uses an ODD address, ie 0x08000A9D
Perhaps try printf("%p\n",&BlinkBlue);
2019-08-09 01:36 PM
>>Any idea why this wouldn't work?
Thumb code uses an ODD address, ie 0x08000A9D
Perhaps try printf("%p\n",&BlinkBlue);
2019-08-09 08:28 PM
This solved it. Thanks!