Arrrrgh it's all Eclipse. Where's that spoon so I can gouge my own eyes out
Edit: ok not too painful. I used STM32CubeMX to generate the project template because I'm a lazy fucker and it's running with debugger attached!
Now to make it do something...
Edit: 25 minutes later ... Victory. Some annoying discrepancies between pin naming on the datasheet as it's tarduino compatible so actually you need to connect it to A2 if you set GPIO_PIN_3.
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_3, GPIO_PIN_SET);
HAL_Delay(100);
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_3, GPIO_PIN_RESET);
HAL_Delay(100);
Siglent for tautech
Next step ... RTOS!
Edit: RTOS done after another 20 minutes. This is too easy. STM32, select middleware FreeRTOS. Add two tasks using wizard (wizards FTW), generate code, fill in the gubbins using the osDelay so the scheduler can preempt things and sorted
void StartBlinkLED(void *argument) {
for(;;) {
HAL_GPIO_WritePin(LD3_GPIO_Port, LD3_Pin, GPIO_PIN_SET);
osDelay(500);
HAL_GPIO_WritePin(LD3_GPIO_Port, LD3_Pin, GPIO_PIN_RESET);
osDelay(500);
}
}
void StartBlinkScope(void *argument) {
for(;;) {
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_3, GPIO_PIN_SET);
osDelay(28);
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_3, GPIO_PIN_RESET);
osDelay(50);
}
}
Trivial stuff sorted. Not scared of STM32 now. Will look at queues and interrupt handling etc another day.
Thanks mnem for the motivation on this one a few months back
And that concludes my spam tonight. Now off to ebay to look for toys