<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Code Warrior 10.2 Structure arrays in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Code-Warrior-10-2-Structure-arrays/m-p/248184#M9557</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;I have a question for whoever can possibly help me. I'm working with an embedded coldfire processor, using Code Warrior 10.2 and MQX RTOS. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt; As I mentioned, I’m using the MQX operating system which Im still very green with. I havnt worked with RTOS's before this project. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;In my project right now I have about 8 different tasks set up including my “main” task. I have a number&lt;BR /&gt;of global variables declared, and each task has a few local variables declared&lt;BR /&gt;as well. Everything has worked fine to this point, but, for the first time, I just tried to declare&lt;BR /&gt;a simple structure array as a global variable: &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;//----------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;typedef&lt;/STRONG&gt; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;struct&lt;/STRONG&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;unsigned&lt;/STRONG&gt; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;int&lt;/STRONG&gt; &lt;SPAN style="color: #0000c0; font-family: 'Courier New'; font-size: 10pt;"&gt;Action&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&amp;nbsp;&amp;nbsp; &lt;BR /&gt; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;unsigned&lt;/STRONG&gt; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;int&lt;/STRONG&gt; &lt;SPAN style="color: #0000c0; font-family: 'Courier New'; font-size: 10pt;"&gt;ActionID&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;char&lt;/STRONG&gt; &lt;SPAN style="color: #0000c0; font-family: 'Courier New'; font-size: 10pt;"&gt;FileName&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;[50];&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;unsigned&lt;/STRONG&gt; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;int&lt;/STRONG&gt; &lt;SPAN style="color: #0000c0; font-family: 'Courier New'; font-size: 10pt;"&gt;Time;&lt;/SPAN&gt; &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #005032; font-family: 'Courier New'; font-size: 10pt;"&gt;sAction&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;sAction Actions[10];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;//-------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;The code compiles, but if I have a line in main that writes to a member of this structure array such as:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="color: #1f497d;"&gt;Actions[0].ActionID = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;My code hangs up somewhere in the operating system kernel and nothing ever runs in any task. I started changing and testing&lt;BR /&gt;every variation that I could and simply got much more confused. For instance:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;The line of code that assigns 0 to a member (above) does not even have to execute. If it is compiled into&lt;BR /&gt;the code, nothing runs. If I comment the line out, everything runs, but with it in, its under an “if” statement that isn’t even true. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;If I change the number of elements in the structure array to be less than 6, My code runs and everything is fine. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;I can take this structure array completely out and instead create a simple array like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;//-------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Unsigned int Test[300];&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Test[0] = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;//-------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;And my code runs fine.. so I don’t think it’s a memory issue.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;if I knock my structure down to simply be:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;//-----------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;typedef&lt;/STRONG&gt; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;struct&lt;/STRONG&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;unsigned&lt;/STRONG&gt; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;int&lt;/STRONG&gt; &lt;SPAN style="color: #0000c0; font-family: 'Courier New'; font-size: 10pt;"&gt;Action&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&amp;nbsp;&amp;nbsp; &lt;BR /&gt; &lt;/SPAN&gt;&amp;nbsp; &lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #005032; font-family: 'Courier New'; font-size: 10pt;"&gt;sAction&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d; font-family: 'Courier New'; font-size: 10pt;"&gt;sAction Actions[30];&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d; font-family: 'Courier New'; font-size: 10pt;"&gt;//---------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d; font-family: 'Courier New'; font-size: 10pt;"&gt;It runs fine. However, if I do this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d; font-family: 'Courier New'; font-size: 10pt;"&gt;//---------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;typedef&lt;/STRONG&gt; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;struct&lt;/STRONG&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;unsigned&lt;/STRONG&gt; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;int&lt;/STRONG&gt; &lt;SPAN style="color: #0000c0; font-family: 'Courier New'; font-size: 10pt;"&gt;Action&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&amp;nbsp;&amp;nbsp; &lt;BR /&gt; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;unsigned&lt;/STRONG&gt; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;int&lt;/STRONG&gt; &lt;SPAN style="color: #0000c0; font-family: 'Courier New'; font-size: 10pt;"&gt;ActionID&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #005032; font-family: 'Courier New'; font-size: 10pt;"&gt;sAction&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;sAction Actions[10];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;//-----------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;it no longer works, unless, as I mentioned, I make the array less than 6 elements.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt; &amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;If I create the structure array &lt;STRONG&gt;inside of a task&lt;/STRONG&gt;, everything is fine. I can make it a structure array of 200&lt;BR /&gt;and its still fine. This is only if I’m trying to make it global.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Any ideas? Could this be an optimization thing or a MQX thing? Am I missing something?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Chris&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Feb 2013 20:51:50 GMT</pubDate>
    <dc:creator>chris2012</dc:creator>
    <dc:date>2013-02-04T20:51:50Z</dc:date>
    <item>
      <title>Code Warrior 10.2 Structure arrays</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Code-Warrior-10-2-Structure-arrays/m-p/248184#M9557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;I have a question for whoever can possibly help me. I'm working with an embedded coldfire processor, using Code Warrior 10.2 and MQX RTOS. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt; As I mentioned, I’m using the MQX operating system which Im still very green with. I havnt worked with RTOS's before this project. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;In my project right now I have about 8 different tasks set up including my “main” task. I have a number&lt;BR /&gt;of global variables declared, and each task has a few local variables declared&lt;BR /&gt;as well. Everything has worked fine to this point, but, for the first time, I just tried to declare&lt;BR /&gt;a simple structure array as a global variable: &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;//----------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;typedef&lt;/STRONG&gt; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;struct&lt;/STRONG&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;unsigned&lt;/STRONG&gt; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;int&lt;/STRONG&gt; &lt;SPAN style="color: #0000c0; font-family: 'Courier New'; font-size: 10pt;"&gt;Action&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&amp;nbsp;&amp;nbsp; &lt;BR /&gt; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;unsigned&lt;/STRONG&gt; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;int&lt;/STRONG&gt; &lt;SPAN style="color: #0000c0; font-family: 'Courier New'; font-size: 10pt;"&gt;ActionID&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;char&lt;/STRONG&gt; &lt;SPAN style="color: #0000c0; font-family: 'Courier New'; font-size: 10pt;"&gt;FileName&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;[50];&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;unsigned&lt;/STRONG&gt; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;int&lt;/STRONG&gt; &lt;SPAN style="color: #0000c0; font-family: 'Courier New'; font-size: 10pt;"&gt;Time;&lt;/SPAN&gt; &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #005032; font-family: 'Courier New'; font-size: 10pt;"&gt;sAction&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;sAction Actions[10];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;//-------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;The code compiles, but if I have a line in main that writes to a member of this structure array such as:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;SPAN style="color: #1f497d;"&gt;Actions[0].ActionID = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;My code hangs up somewhere in the operating system kernel and nothing ever runs in any task. I started changing and testing&lt;BR /&gt;every variation that I could and simply got much more confused. For instance:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;The line of code that assigns 0 to a member (above) does not even have to execute. If it is compiled into&lt;BR /&gt;the code, nothing runs. If I comment the line out, everything runs, but with it in, its under an “if” statement that isn’t even true. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;If I change the number of elements in the structure array to be less than 6, My code runs and everything is fine. &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;I can take this structure array completely out and instead create a simple array like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;//-------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Unsigned int Test[300];&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Test[0] = 0;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;//-------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;And my code runs fine.. so I don’t think it’s a memory issue.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;if I knock my structure down to simply be:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;//-----------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;typedef&lt;/STRONG&gt; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;struct&lt;/STRONG&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;unsigned&lt;/STRONG&gt; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;int&lt;/STRONG&gt; &lt;SPAN style="color: #0000c0; font-family: 'Courier New'; font-size: 10pt;"&gt;Action&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&amp;nbsp;&amp;nbsp; &lt;BR /&gt; &lt;/SPAN&gt;&amp;nbsp; &lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #005032; font-family: 'Courier New'; font-size: 10pt;"&gt;sAction&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d; font-family: 'Courier New'; font-size: 10pt;"&gt;sAction Actions[30];&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d; font-family: 'Courier New'; font-size: 10pt;"&gt;//---------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d; font-family: 'Courier New'; font-size: 10pt;"&gt;It runs fine. However, if I do this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d; font-family: 'Courier New'; font-size: 10pt;"&gt;//---------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;typedef&lt;/STRONG&gt; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;struct&lt;/STRONG&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;unsigned&lt;/STRONG&gt; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;int&lt;/STRONG&gt; &lt;SPAN style="color: #0000c0; font-family: 'Courier New'; font-size: 10pt;"&gt;Action&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&amp;nbsp;&amp;nbsp; &lt;BR /&gt; &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;unsigned&lt;/STRONG&gt; &lt;STRONG style="color: #7f0055; font-family: 'Courier New'; font-size: 10pt;"&gt;int&lt;/STRONG&gt; &lt;SPAN style="color: #0000c0; font-family: 'Courier New'; font-size: 10pt;"&gt;ActionID&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #005032; font-family: 'Courier New'; font-size: 10pt;"&gt;sAction&lt;/SPAN&gt;&lt;SPAN style="color: black; font-family: 'Courier New'; font-size: 10pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;sAction Actions[10];&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;//-----------------------------------------------------------------------------&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;it no longer works, unless, as I mentioned, I make the array less than 6 elements.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt; &amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;If I create the structure array &lt;STRONG&gt;inside of a task&lt;/STRONG&gt;, everything is fine. I can make it a structure array of 200&lt;BR /&gt;and its still fine. This is only if I’m trying to make it global.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Any ideas? Could this be an optimization thing or a MQX thing? Am I missing something?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Chris&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Feb 2013 20:51:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Code-Warrior-10-2-Structure-arrays/m-p/248184#M9557</guid>
      <dc:creator>chris2012</dc:creator>
      <dc:date>2013-02-04T20:51:50Z</dc:date>
    </item>
  </channel>
</rss>

