<?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>LPC MicrocontrollersのトピックRe: No interrupts (systick) on M0??</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/No-interrupts-systick-on-M0/m-p/595508#M22838</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by omegahacker on Sun Jun 15 09:17:29 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;It's mentioned as existing for the M4, and SysTick is not mentioned for any of the M0 cores.&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I do see that, but I don't consider that even remotely sufficient documentation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My take is that while the SysTick is indeed "optional", 99+% of all chips out there implement it because it's such a fundamentally useful feature, and it takes all of a few dozen gates.&amp;nbsp; If NXP is going to neglect to include such a feature, they need to be VERY EXPLICIT about the fact that something that's assumed to exist does not in fact actually exist.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now my next question is: they suggest using the RITimer as a replacement for the M0APP - what about the M0SUB?&amp;nbsp; It can respond to RITimer interrupts as well, but then who's responsible for clearing the interrupt?&amp;nbsp; Is it edge or level triggered (I'm assuming level, since it actually has a "clear" flag).&amp;nbsp; What if you have the RITimer at a lower priority and the M0APP fires and clears before the M0SUB can actually launch it's interrupt?&amp;nbsp; This is &lt;/SPAN&gt;&lt;STRONG&gt;why&lt;/STRONG&gt;&lt;SPAN&gt; SysTick is a per-core component!&amp;nbsp; Now one has to resort to some kind of semaphore BS in order to count who's caught the interrupt and who gets to clear it, etc.&amp;nbsp; LAME!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 19:22:31 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T19:22:31Z</dc:date>
    <item>
      <title>No interrupts (systick) on M0??</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/No-interrupts-systick-on-M0/m-p/595502#M22832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by omegahacker on Thu Jun 12 18:37:06 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;OK, here we go again trying to get this M0 running.&amp;nbsp; I have a &lt;/SPAN&gt;&lt;I&gt;dirt simple&lt;/I&gt;&lt;SPAN&gt; program that starts the systick and loops with an LED output based on a counter the ISR updates:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;volatile uint8_t count = 0;

int main(void) {
&amp;nbsp; LPC_SCU-&amp;gt;SFSPE_5 = 4;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // GPIO
&amp;nbsp; LPC_GPIO_PORT-&amp;gt;DIR[7] |= (1&amp;lt;&amp;lt;5);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // OUT
&amp;nbsp; LPC_GPIO_PORT-&amp;gt;PIN[7] &amp;amp;= ~(1&amp;lt;&amp;lt;5);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // LED ON

&amp;nbsp; SysTick-&amp;gt;LOAD = 100000;
&amp;nbsp; SysTick-&amp;gt;VAL = 0;
&amp;nbsp; SysTick-&amp;gt;CTRL = 0x00000007;

&amp;nbsp; NOPx(10000000);

&amp;nbsp; while (1) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (count == 0) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_GPIO_PORT-&amp;gt;PIN[7] &amp;amp;= ~(1&amp;lt;&amp;lt;5);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // LED on
&amp;nbsp;&amp;nbsp;&amp;nbsp; } else {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_GPIO_PORT-&amp;gt;PIN[7] |= (1&amp;lt;&amp;lt;5);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // LED off
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp; }
}

void xPortSysTickHandler( void ) {
&amp;nbsp; count++;
}&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I run this directly on the M4, I get exactly what I expect: after an initial burst on, an LED that flickers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I load this onto the M0 (see previous threads), I get the LED starting on, a short delay (the NOPx before while()), then it goes off and &lt;/SPAN&gt;&lt;STRONG&gt;stays&lt;/STRONG&gt;&lt;SPAN&gt; off.&amp;nbsp; The fact that the LED goes on then off proves that the code is indeed functioning.&amp;nbsp; The fact that the LED stays dead proves that the interrupt is &lt;/SPAN&gt;&lt;STRONG&gt;not&lt;/STRONG&gt;&lt;SPAN&gt; firing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Clearly I'm missing something, but I have no idea what.&amp;nbsp; Help?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:22:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/No-interrupts-systick-on-M0/m-p/595502#M22832</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: No interrupts (systick) on M0??</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/No-interrupts-systick-on-M0/m-p/595503#M22833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by sundarapandian on Thu Jun 12 19:18:36 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;In LPC43XX, the M0APP &amp;amp; M0SUB cores does not have systick timer. You could use RITimer.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:22:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/No-interrupts-systick-on-M0/m-p/595503#M22833</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: No interrupts (systick) on M0??</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/No-interrupts-systick-on-M0/m-p/595504#M22834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by omegahacker on Thu Jun 12 20:09:42 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Ummmmm, ok.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How would I actually go about finding this minor detail in the documentation?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Given that the SysTick is a) part of the per-core NVIC section, and b) pretty much assumed to exist 100% of the time (I've never seen a chip without it, nor does the book I just bought have any knowledge of a single chip without it), why is this something I have to find out the hard way??&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:22:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/No-interrupts-systick-on-M0/m-p/595504#M22834</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:22:27Z</dc:date>
    </item>
    <item>
      <title>Re: No interrupts (systick) on M0??</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/No-interrupts-systick-on-M0/m-p/595505#M22835</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by JohnR on Fri Jun 13 04:54:47 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;HI Sundarapandian,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That's a very poor reply.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In both M0Sub and M0App code,&amp;nbsp; eg,&amp;nbsp; cr_startup_lpc43xx-m0app.c and cmsis_43xx_m0app.h, SysTick() and its interrupt number are provided.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also got caught by this problem and wasted a lot of time trying to understand why SysTick_Handler() did not seem to work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are there any more similar gotchas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please have the manuals updated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;JohnR.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:22:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/No-interrupts-systick-on-M0/m-p/595505#M22835</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:22:28Z</dc:date>
    </item>
    <item>
      <title>Re: No interrupts (systick) on M0??</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/No-interrupts-systick-on-M0/m-p/595506#M22836</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by omegahacker on Sat Jun 14 08:48:06 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: omegahacker&lt;/STRONG&gt;&lt;BR /&gt;How would I actually go about finding this minor detail in the documentation?&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;{sarcasm}I found it!{/sarcasm}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fdocs.lpcware.com%2Flpcopen%2Fv1.03%2Fgroup__u_cos-_i_i_i__43_x_x___m0___t_i_c_k.html" rel="nofollow" target="_blank"&gt;http://docs.lpcware.com/lpcopen/v1.03/group__u_cos-_i_i_i__43_x_x___m0___t_i_c_k.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:22:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/No-interrupts-systick-on-M0/m-p/595506#M22836</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: No interrupts (systick) on M0??</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/No-interrupts-systick-on-M0/m-p/595507#M22837</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Pacman on Sat Jun 14 11:28:29 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I just looked in UM10503, to see if it said anything about it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The only place it says anything about where SysTick is available, is in sectoin 1.2 "Features"...&lt;/SPAN&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;* Cortex-M4 Processor core&lt;BR /&gt;&amp;nbsp; - ...&lt;BR /&gt;&amp;nbsp; - ...&lt;BR /&gt;&amp;nbsp; - [color=#080]System tick timer.[/color]&lt;BR /&gt;* Cortex-M0 Processor core (all LPC43xx parts)&lt;BR /&gt;&amp;nbsp; - ...&lt;BR /&gt;&amp;nbsp; - ...&lt;BR /&gt;&amp;nbsp; - (nothing)&lt;BR /&gt;* Cortex-M0 Processor susbsystem core (LPC4370 parts only)&lt;BR /&gt;&amp;nbsp; - ...&lt;BR /&gt;&amp;nbsp; - ...&lt;BR /&gt;&amp;nbsp; - (nothing)&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...So: It's mentioned as existing for the M4, and SysTick is not mentioned for any of the M0 cores.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That means that the header files must be incorrect.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have header files that #define M0_SysTick_IRQn too. I believe it should have been marked as "reserved" instead.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:22:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/No-interrupts-systick-on-M0/m-p/595507#M22837</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: No interrupts (systick) on M0??</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/No-interrupts-systick-on-M0/m-p/595508#M22838</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by omegahacker on Sun Jun 15 09:17:29 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;It's mentioned as existing for the M4, and SysTick is not mentioned for any of the M0 cores.&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I do see that, but I don't consider that even remotely sufficient documentation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My take is that while the SysTick is indeed "optional", 99+% of all chips out there implement it because it's such a fundamentally useful feature, and it takes all of a few dozen gates.&amp;nbsp; If NXP is going to neglect to include such a feature, they need to be VERY EXPLICIT about the fact that something that's assumed to exist does not in fact actually exist.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now my next question is: they suggest using the RITimer as a replacement for the M0APP - what about the M0SUB?&amp;nbsp; It can respond to RITimer interrupts as well, but then who's responsible for clearing the interrupt?&amp;nbsp; Is it edge or level triggered (I'm assuming level, since it actually has a "clear" flag).&amp;nbsp; What if you have the RITimer at a lower priority and the M0APP fires and clears before the M0SUB can actually launch it's interrupt?&amp;nbsp; This is &lt;/SPAN&gt;&lt;STRONG&gt;why&lt;/STRONG&gt;&lt;SPAN&gt; SysTick is a per-core component!&amp;nbsp; Now one has to resort to some kind of semaphore BS in order to count who's caught the interrupt and who gets to clear it, etc.&amp;nbsp; LAME!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:22:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/No-interrupts-systick-on-M0/m-p/595508#M22838</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:22:31Z</dc:date>
    </item>
    <item>
      <title>Re: No interrupts (systick) on M0??</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/No-interrupts-systick-on-M0/m-p/595509#M22839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by starblue on Mon Jun 16 05:12:32 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I think the marketeers don't like to put negative information in the features list.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I didn't fall into this trap, but it caused me some extra work to verify that the SysTick doesn't exist, so I would also appreciate if this were spelled out clearly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Similarly, 32 bit multiplication is the slow variant (32 cycles) on the M0 cores of the LPC43xx. It seems these are stripped down to the minimum when they are part of a multicore controller, in contrast to standalone M0 cores.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: omegahacker&lt;/STRONG&gt;&lt;BR /&gt;Now my next question is: they suggest using the RITimer as a replacement for the M0APP - what about the M0SUB?&amp;nbsp; It can respond to RITimer interrupts as well, but then who's responsible for clearing the interrupt?&amp;nbsp; &lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Pick one core. I use RITIMER to fire interrupts both on the M4 and the M0 on an LPC4357.&amp;nbsp; The M4 is responsible for clearing the RITINT flag. Works well so far.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: omegahacker&lt;/STRONG&gt;&lt;BR /&gt;Is it edge or level triggered (I'm assuming level, since it actually has a "clear" flag).&amp;nbsp; What if you have the RITimer at a lower priority and the M0APP fires and clears before the M0SUB can actually launch it's interrupt? &lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think that is OK since each core has its own NVIC. My system wouldn't work otherwise (the interrupt has highest priority on the M4, but a rather low priority causing waits up to several µs on the M0. It fires every 25µs).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jürgen&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:22:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/No-interrupts-systick-on-M0/m-p/595509#M22839</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:22:31Z</dc:date>
    </item>
  </channel>
</rss>

