Next, we select which pins on that port we want to enable - in this case the full 8 bits for this port, pin 0 to 7. This sets bit 1 in the RCC AHB1 peripheral clock register ( RCC_AHB1ENR). So, the first call to RCC_AHB1PeriphClockCmd enables the peripheral clock for GPIO on the B port. Setting the STM32 F4 Discovery up without using librariesįor power consumption efficiency the peripheral clock is gated for most peripherals on the device. So I'm going to explain what each part of this code snippet does and show you how to achieve the same thing manually without the ST libraries. This is fairly simple, but relies entirely on the firmware Libraries for the board, which can be downloaded from the ST website. GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_DOWN GPIO_InitStructure.GPIO_OType = GPIO_OType_PP GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOB, ENABLE) Here is an example implementation for setting the first 8 pins of port B as outputs: We want to set up the output port so we have strong signals on output pins. The RTBx provides an efficient method to collect RVS data, and as such we'll discuss how to set the STM32 F4 Discovery board up to write data suitable for collection by the RTBx. How we use the STM32 F4 DiscoveryĪt Rapita, our main interest in writing to output ports of microcontrollers is to collect structural coverage or execution time data from code that has been instrumented by our RVS tools. It has a suitable amount of constraints to enable us to show how we get round some of the problems of on-target verification on embedded systems, without being too tricky and at a very agreeable price. Here I will explain why we chose it and demonstrate how to set the STM32 F4 Discovery up as an output port without using ST libraries. The STM32 F4 Discovery board is currently our board of choice for demonstrations and training at Rapita Systems.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |