So the LED works: I have been playing with Tasking’s VX-toolset for some time now.
And I have been posting some findings in the blog. Since I got porting some old code to new 5.1 version covered I thought to play with LEDs on the board now.
But first – let’s create a new environment to work in. The task is rather simple: File | New | Tasking ARM C/C++ Project. Write in the name of the project and you can now select Empty Project under TASKING ARM Application.
Click Next and since you are using stm32f4-discovery board you have to expand STMicroelectronics and select STM32F439 and click on the STM32F439ZI. Click on Finish.
We have to write in the code now so let’s create and empty C source file by: File | New | Source File. Name the file as you like and finish it with .c
To get the LEDs on the board to turn on we need to use RCC (Reset and Clock ) with Tasking Software Platform (right click on the title of the project and select)
Since we’ll be using RCC and GPIO let’s select them both from the right list (Peripherals) – so STM32F4XX RCC. We also need GPIO access, but since we are accessing only PG13 and PG14 let’s select only GPIOG – by expanding STM32F4XX GPIO and selecting STM32F4XX_GPIOG. Finish with OK and generate the code (check previous post for exact details).
We also need to create a PinMapper map and again use previous post for exact details. Additionally to creating a PinMapper we also need to select proper port under Ports – expand it, and under PG click on the PG13 and select GPIO under Chip input/output.
Repeat the procedure for PG14, too.
And since we are using RCC we also need to work on that. Search for RCC under Peripherals and select Crystal/Ceramic Resonator under Low Speed Clock.
Don’t forget to generate the code.
You can then use the following code to light the LEDs on the board: