<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: External interrupt with STM32F100 Discovery board</title>
		<link>http://forums.leaflabs.com/topic.php?id=74263</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:23:42 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=74263" rel="self" type="application/rss+xml" />

		<item>
			<title>gbulmer on "External interrupt with STM32F100 Discovery board"</title>
			<link>http://forums.leaflabs.com/topic.php?id=74263#post-105188</link>
			<pubDate>Sun, 19 Jan 2014 06:16:21 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">105188@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;ehobby - are you using an &#60;a href=&#34;http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1199/PF250863&#34;&#62;STM32VLDISCOVERY&#60;/a&#62;?&#60;/p&#62;
&#60;p&#62;There are a lot of things that might go wrong. IMHO start very simple.&#60;br /&#62;
What toolchain are you using?&#60;/p&#62;
&#60;p&#62;What does &#60;em&#62;&#34;it doesn't seem to work&#34;&#60;/em&#62; mean?&#60;br /&#62;
Does the PC8 LED not come on? Is it ever on?&#60;/p&#62;
&#60;p&#62;Please post the code of working programs which:&#60;br /&#62;
1.  turns the PC8 LED on (ideally make it blink), and&#60;br /&#62;
2.  repeatedly checks (polls) pin PC0, and when it goes high (or changes, or low) turns the PC8 LED on (ideally make it blink).&#60;/p&#62;
&#60;p&#62;What code is being compiled (os assembled) and linked into the program to ensure the EXT10 interrupt vector is set to EXTI0_IRQHandler? You might post that as pastebin or gist to avoid making this thread hard to read.&#60;/p&#62;
&#60;p&#62;Have you done an objdump (or equivalent) to see that the interrupt vector is initialised to the start address of EXTI0_IRQHandler?&#60;/p&#62;
&#60;p&#62;Are any other interrupts working? For example, have you had the SysTick timer interrupt working? Have you a program which toggles the value of PC8 on each SysTick interrupt? IIRC the values used for SysTick code be set to be so slow that you could see the PC8 LED blink.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ehobby on "External interrupt with STM32F100 Discovery board"</title>
			<link>http://forums.leaflabs.com/topic.php?id=74263#post-105187</link>
			<pubDate>Sat, 18 Jan 2014 22:39:28 +0000</pubDate>
			<dc:creator>ehobby</dc:creator>
			<guid isPermaLink="false">105187@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Thanks gbulmer for trying to help me.&#60;/p&#62;
&#60;p&#62;I am learning to use the interrupt functions on the STM32F100, and what I was trying to do is to get the interrupt to work. I thought the simplest thing might be to use a trigger signal from PA0 as interrupt to turn the PC8 ON and OFF (for this program, I am actually only try to turn it ON). &#60;/p&#62;
&#60;p&#62;I will add other functions when this simple goal is achieved.&#60;/p&#62;
&#60;p&#62;But for now, it doesn't seem to work, even after I delete the while(1) in the EXTI0_IRQHandler. Something must be missing, and I would appreciate it very much if you can kindly help me to figured it out.&#60;/p&#62;
&#60;p&#62;Thank you!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>gbulmer on "External interrupt with STM32F100 Discovery board"</title>
			<link>http://forums.leaflabs.com/topic.php?id=74263#post-105184</link>
			<pubDate>Fri, 17 Jan 2014 18:13:23 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">105184@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;ehobby - If you tell us what it is the code is intended to do, we might be able to help more.&#60;/p&#62;
&#60;p&#62;What does &#60;em&#62;&#34;... somehow the program doesn't work&#34;&#60;/em&#62; mean?&#60;/p&#62;
&#60;p&#62;I've only skimmed your code, so I have not fully understood it.&#60;/p&#62;
&#60;p&#62;However, I would never expect an interrupt handler to have an infinite loop in it unless ...&#60;br /&#62;
If an interrupt handler really is an infinite loop, then IMHO it pretty much only makes sense as an error or exception trap. It is the 'backstop' that stops the processor executing random memory. That doesn't sound like what you are trying to do.&#60;/p&#62;
&#60;p&#62;The issues with an interrupt handler which is an infinite loop are:&#60;br /&#62;
0. How will it ever get called a second time? The infinite loop is blocking calls to itself (see point 0 :-)&#60;br /&#62;
1. How will 'main()' and its functions ever run? See point 0. (Do you see what I've done here ;-)&#60;br /&#62;
2. How will anything else interrupt? It would kill the clock, USB, and everything else where it has a higher priority.&#60;/p&#62;
&#60;p&#62;So I suggest that:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;void EXTI0_IRQHandler(void)
{
    while(1)
    {
        GPIOC -&#38;gt; ODR = 0x0100;

    }
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;should not have &#60;code&#62;while(1)&#60;/code&#62; in it.&#60;/p&#62;
&#60;p&#62;Further, once the LED is turned on, that's it, the LED is on forever.&#60;br /&#62;
So if the infinite loop is removed, it still only indicates that the interrupt has happened once.&#60;/p&#62;
&#60;p&#62;There may be other errors; as I wrote, I've only skimmed the code.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ehobby on "External interrupt with STM32F100 Discovery board"</title>
			<link>http://forums.leaflabs.com/topic.php?id=74263#post-105183</link>
			<pubDate>Thu, 16 Jan 2014 23:04:52 +0000</pubDate>
			<dc:creator>ehobby</dc:creator>
			<guid isPermaLink="false">105183@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hello there,&#60;/p&#62;
&#60;p&#62;I am trying to build a test program which uses the PB0 as an external interrupt line to turn the LED connected to PC8 ON. Here is my simple program.&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;int main (void){
	RCC-&#38;gt;APB2ENR &#124;= RCC_APB2ENR_IOPAEN &#124; RCC_APB2ENR_IOPBEN&#124; RCC_APB2ENR_IOPCEN &#124; RCC_APB2ENR_AFIOEN;	  // enable the PortA, PortC
	RCC-&#38;gt;APB1ENR &#124;= RCC_APB1ENR_DACEN;		// enable DAC and TIM3 clock
	GPIOC-&#38;gt;CRH =0x0002; 			// configure PC8 as output
	EXTI-&#38;gt;IMR = EXTI_IMR_MR0;
	EXTI-&#38;gt;RTSR = EXTI_RTSR_TR0;
	EXTI-&#38;gt;FTSR = EXTI_FTSR_TR0;
	AFIO -&#38;gt;EXTICR[1] = AFIO_EXTICR1_EXTI0_PB;
	NVIC_EnableIRQ(EXTI0_IRQn);
	while(1){
	}
}
void EXTI0_IRQHandler(void)
{
	while(1)
	{
		GPIOC -&#38;gt; ODR = 0x0100;
	}
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I am not sure what I did wrong, but somehow the program doesn't work.&#60;br /&#62;
Any suggestions?&#60;/p&#62;
&#60;p&#62;Thanks!&#60;/p&#62;
&#60;p&#62;[ADMIN ED: code formatting]
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
