<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>RyanDuran's Groups Activities</title><link>https://community.arm.com/members/ryanduran</link><description>Recent activity for people in RyanDuran's group</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>Trouble With the System Clock</title><link>https://community.arm.com/developer/ip-products/processors/f/cortex-m-forum/47619/trouble-with-the-system-clock</link><pubDate>Fri, 11 Sep 2020 21:00:27 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:bb6024a0-4d75-4882-a49e-39cdbf93ab73</guid><dc:creator>RyanDuran</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m new to embedded systems programming, with plenty of previous experience working with Programmable Logic Controllers and I&amp;#39;m trying to branch out. I recently acquired an STM32F407 discovery board and have been trying to work with it in an attempt to learn something about embedded system development.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m&amp;nbsp;currently working to set up a simple blinking light program but I keep running into trouble setting up a delay timer, every time I run the program I get a Systick_Handler interrupt and with my limited knowledge base I&amp;#39;m having trouble pinpointing what is causing the problem and I&amp;#39;ve been knocking my head against this problem for a while. Admittedly a large chunk of my program was copied from other sources and scanned through it to at least try to understand that is happening.&lt;/p&gt;
&lt;p&gt;Here is the current code of the project.&lt;br /&gt;*********************************************************&lt;/p&gt;
&lt;p&gt;#include &amp;quot;stm32f4xx.h&amp;quot;&lt;br /&gt;#include &amp;quot;stm32f4xx_hal.h&amp;quot;&lt;br /&gt;#include &amp;quot;stm32f4_discovery.h&amp;quot;&lt;br /&gt;// New Libraries here&lt;/p&gt;
&lt;p&gt;void ConfigureLEDpins(void);&lt;br /&gt;static void SystemClock_Config(void);&lt;/p&gt;
&lt;p&gt;int main(void)&lt;br /&gt;{&lt;br /&gt; HAL_Init();&lt;br /&gt; SystemClock_Config();&lt;br /&gt; ConfigureLEDpins();&lt;br /&gt; SystemCoreClock = HAL_RCC_GetHCLKFreq();&lt;br /&gt; SysTick_Config(SystemCoreClock / 100); &lt;br /&gt; while(1)&lt;br /&gt; {&lt;br /&gt; HAL_GPIO_TogglePin(GPIOD, GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15);&lt;br /&gt; HAL_Delay(1000);&lt;br /&gt; }&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;void ConfigureLEDpins(void)&lt;br /&gt;{&lt;br /&gt; __HAL_RCC_GPIOD_CLK_ENABLE();&lt;br /&gt; GPIO_InitTypeDef LEDConfigData;&lt;br /&gt; LEDConfigData.Mode = GPIO_MODE_OUTPUT_PP;&lt;br /&gt; LEDConfigData.Pin = GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15;&lt;br /&gt; HAL_GPIO_Init(GPIOD, &amp;amp;LEDConfigData);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;void SystemClock_Config(void) // Copied from the Demostration program from STM&lt;br /&gt;{&lt;br /&gt; RCC_ClkInitTypeDef RCC_ClkInitStruct;&lt;br /&gt; RCC_OscInitTypeDef RCC_OscInitStruct;&lt;/p&gt;
&lt;p&gt;/* Enable Power Control clock */&lt;br /&gt; __HAL_RCC_PWR_CLK_ENABLE();&lt;br /&gt; &lt;br /&gt; /* The voltage scaling allows optimizing the power consumption when the device is &lt;br /&gt; clocked below the maximum system frequency, to update the voltage scaling value &lt;br /&gt; regarding system frequency refer to product datasheet. */&lt;br /&gt; __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);&lt;br /&gt; &lt;br /&gt; /* Enable HSE Oscillator and activate PLL with HSE as source */&lt;br /&gt; RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;&lt;br /&gt; RCC_OscInitStruct.HSEState = RCC_HSE_ON;&lt;br /&gt; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;&lt;br /&gt; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;&lt;br /&gt; RCC_OscInitStruct.PLL.PLLM = 8;&lt;br /&gt; RCC_OscInitStruct.PLL.PLLN = 336;&lt;br /&gt; RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;&lt;br /&gt; RCC_OscInitStruct.PLL.PLLQ = 7;&lt;br /&gt; HAL_RCC_OscConfig(&amp;amp;RCC_OscInitStruct);&lt;br /&gt; &lt;br /&gt; /* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2 &lt;br /&gt; clocks dividers */&lt;br /&gt; RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2);&lt;br /&gt; RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;&lt;br /&gt; RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;&lt;br /&gt; RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; &lt;br /&gt; RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; &lt;br /&gt; HAL_RCC_ClockConfig(&amp;amp;RCC_ClkInitStruct, FLASH_LATENCY_5);&lt;/p&gt;
&lt;p&gt;/* STM32F405x/407x/415x/417x Revision Z devices: prefetch is supported */&lt;br /&gt; if (HAL_GetREVID() == 0x1001)&lt;br /&gt; {&lt;br /&gt; /* Enable the Flash prefetch */&lt;br /&gt; __HAL_FLASH_PREFETCH_BUFFER_ENABLE();&lt;br /&gt; }&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;*********************************************&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve read through a few online tutorials but I can&amp;#39;t seem to find what I&amp;#39;m missing. Chances are as a beginner I am forgetting something likely basic but I can&amp;#39;t figure out what&amp;#39;s wrong with it.&lt;/p&gt;
&lt;p&gt;Any help would be appreciated.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Ask A Question I</title><link>https://community.arm.com/achievements/460ac7df-7ccc-4c42-a204-9e05eef3be09</link><pubDate>Fri, 11 Sep 2020 08:38:20 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:bed2e3d1-c542-44aa-9c6c-5c5f19f9e29c</guid><dc:creator /><description>Ask a question in a forum.</description></item></channel></rss>