<?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: cant run freertos demo</title>
		<link>http://forums.leaflabs.com/topic.php?id=74266</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:04:45 +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=74266" rel="self" type="application/rss+xml" />

		<item>
			<title>breadbread1984 on "cant run freertos demo"</title>
			<link>http://forums.leaflabs.com/topic.php?id=74266#post-105202</link>
			<pubDate>Tue, 28 Jan 2014 04:13:05 +0000</pubDate>
			<dc:creator>breadbread1984</dc:creator>
			<guid isPermaLink="false">105202@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;running unproperly means the same problem I mentioned in the first post.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>breadbread1984 on "cant run freertos demo"</title>
			<link>http://forums.leaflabs.com/topic.php?id=74266#post-105201</link>
			<pubDate>Tue, 28 Jan 2014 04:07:29 +0000</pubDate>
			<dc:creator>breadbread1984</dc:creator>
			<guid isPermaLink="false">105201@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I modified the code as you recommended and compiled the code with cross-compiler downloaded from &#60;a href=&#34;http://static.leaflabs.com/pub/codesourcery/&#34; rel=&#34;nofollow&#34;&#62;http://static.leaflabs.com/pub/codesourcery/&#60;/a&#62; . I compiled the code with  2010q1-188 version compiler without IDE. The firmware still cant run properly. Then I tried the code with main function commented in the IDE and found out the firmware generated by IDE can run properly. What may cause the difference. The modified code is pasted below.&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;#include &#38;quot;wirish.h&#38;quot;
#include &#38;quot;MapleFreeRTOS.h&#38;quot;

#define PWM_PIN 2

void setup()
{
    /* Set up the LED to blink  */
    pinMode(BOARD_LED_PIN, OUTPUT);

    /* Turn on PWM on pin PWM_PIN */
    pinMode(PWM_PIN, PWM);
    pwmWrite(PWM_PIN, 0x8000);

    /* Send a message out USART2  */
    Serial2.begin(9600);
}

/*  Multi-task example */
void vTaskCodePing( void * pvParameters )
{
	while(1) {
		SerialUSB.print(&#38;quot;Ping\n&#38;quot;);
		vTaskDelay(900);
	}
}

void vTaskCodePang( void * pvParameters )
{
	while(1) {
		SerialUSB.print(&#38;quot;PANG\n&#38;quot;);
		vTaskDelay(900);
	}
}

#define STACK_SIZE 200
/* Please Do Not Remove &#38;amp; Edit Following Code */
void loop() {

	/* Create two tasks Ping and Pang */
	xTaskCreate(vTaskCodePing, (const signed char*)&#38;quot;Ping&#38;quot;, STACK_SIZE, NULL, 1, NULL);
	xTaskCreate(vTaskCodePang, (const signed char*)&#38;quot;Pang&#38;quot;, STACK_SIZE, NULL, 1, NULL);

	vTaskStartScheduler();
}

#if 1
int main(void) {
    setup();
	   while(1) {
		     loop();
	   }
    return 0;
}
#endif&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>hihohoho on "cant run freertos demo"</title>
			<link>http://forums.leaflabs.com/topic.php?id=74266#post-105200</link>
			<pubDate>Mon, 27 Jan 2014 09:15:31 +0000</pubDate>
			<dc:creator>hihohoho</dc:creator>
			<guid isPermaLink="false">105200@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Have you tried &#34;MapleFreeRTOS.h&#34; ? The above code works fine in MapleFreeRTOS. You'll have to rewrite it to get rid of main() and put in loop() . Also replace delay() with vTaskDelay() as your just wasting processing cycles otherwise.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>breadbread1984 on "cant run freertos demo"</title>
			<link>http://forums.leaflabs.com/topic.php?id=74266#post-105199</link>
			<pubDate>Mon, 27 Jan 2014 07:25:09 +0000</pubDate>
			<dc:creator>breadbread1984</dc:creator>
			<guid isPermaLink="false">105199@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I try to run a freertos demo on maple. After I upload the firmware, the /dev/ttyACM0 disappear as soon as the maple completes booting. I think there should be some problem with the firmware. There is the source of the firmware. Could someone find the problem of the source for me. thanks in advance.&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;#include &#38;quot;wirish.h&#38;quot;
#include &#38;quot;FreeRTOS.h&#38;quot;
#include &#38;quot;task.h&#38;quot;

#define PWM_PIN 2

void setup()
{
    /* Set up the LED to blink  */
    pinMode(BOARD_LED_PIN, OUTPUT);

    /* Turn on PWM on pin PWM_PIN */
    pinMode(PWM_PIN, PWM);
    pwmWrite(PWM_PIN, 0x8000);

    /* Send a message out USART2  */
    Serial2.begin(9600);
}

/*  Multi-task example */

void vTaskCodePing( void * pvParameters )
{
	while(1) {
		SerialUSB.print(&#38;quot;Ping\n&#38;quot;);
		delay(900);
	}
}

void vTaskCodePang( void * pvParameters )
{
	while(1) {
		SerialUSB.print(&#38;quot;PANG\n&#38;quot;);
		delay(900);
	}
}

#define STACK_SIZE 200
/* Please Do Not Remove &#38;amp; Edit Following Code */
int main(void) {

    setup();

	/* Create two tasks Ping and Pang */
	xTaskCreate(vTaskCodePing, (const signed char*)&#38;quot;Ping&#38;quot;, STACK_SIZE, NULL, 1, NULL);
	xTaskCreate(vTaskCodePang, (const signed char*)&#38;quot;Pang&#38;quot;, STACK_SIZE, NULL, 1, NULL);

	vTaskStartScheduler();

    return 0;
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>
