We were able to create an open loop speed controller for the BLDC motor, for this we used the libopencm3 firmware library for ARM Cortex-M4 controllers and the ST-LINK debugger and programmer for the STM32 microcontrollers.
We used the user's button of the stm32f4-discovery as the external interruption, so if it is pressed an interruption is activated and it increases or decreases the frequency of the sine wave.