Description
The goals for the assignment this week:
- Practice setting up a user-defined vector table.
- Practice dealing with interrupts and the use of the SysTick timer.
Problems:
- Starting from the blinking LED code that you created using the GPIO registers:
- Define your own vector table.
- Enable use of CMSIS in project options settings.
- Add the files “h” & “system_stm32f4xx.h” to the folder where “main.c” is saved. You should be able to get these files thru STM32CubeMX. You could also get them by downloading the zip file “CMSIS_STM32_Device_Specific_Files.zip” from canvas site under the link Assignment\A06 folder
- Enable the use of the SysTick timer and its interrupt.
- Replace the delay() function with the use of the SysTick timer to blink the user LED.
- Set a break point inside the SysTick_Handler interrupt and capture a snapshot of the stack once inside the interrupt and LR value. Explain what are the values stored on the stack at the moment the Handler gets invoked.
- Bonus: Improve your delay function to rely on the use of the SysTick timer instead of the busywait loop.
- Function prototype: void delay(uint32_t delayInMilliseconds)
- Use the function in your main.c file to blink the LED every 2 seconds.
- Hint: Setup the SysTick timer to trigger an interrupt every 1ms.