Download STM32 developer`s document

Transcript
www.uTasker.com
µTasker – STM32 Developer’s Document
The STM32 devices work from a supply voltage between 1.8V to 3.6 (F1 2.0V to
3.6V) and have an internal 1.8V regulator for the CPU.
4. Blinking an LED
A useful first step when starting with a new processor is to make a project that
flashes an LED. The µTasker project does this when all major options are disabled*
so that essentially only the watchdog task is active and toggles a chosen port output
at a rate of 2.5Hz (periodically called with 200ms rate).
There are several things that need to be operational for this to take place:
-
The processor must successfully start, initialize system variables and start the
µTasker scheduler.
-
During initialization the system clock must be correctly configured (either from
a direct clock source or from a PLL).
-
The TICK interrupt needs to operate (interrupt configuration and interrupt
handling). Hereby it is important to note that Cortex M3 and Cortex M4
processors have a dedicated SYSTICK periodic timer module which is always
used for this and so have practically identical setups. Since the NVIC (nested
vectored interrupt controller) is also integrated in the core the interrupt
handling is virtually the same in each case.
-
The port needs to have been correctly configured as an output and correctly
toggled each time the watchdog task is executed.
This leads into the next topic of GPIOs since the blinking LED test can only be
successful when the GPIO is correctly controlled. The next section thus introduces
the port control as well as the differences between their implementation in the F1 and
F2/F3 devices.
*Disable USE_MAINTENANCE, SERIAL_INTERFACE, SDCARD_SUPPORT, ETH_INTERFACE and SUPPORT_GLCD
in config.h to obtain a minimum project of this type.
uTaskerV1.4_Developers_Document/0.5
8/46
22.02.2012