<?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 Combining ARM and Thumb not possible? in LPCXpresso IDE</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/Combining-ARM-and-Thumb-not-possible/m-p/566937#M18665</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Felix G on Mon Oct 26 07:13:20 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i am currently in the process of evaluating LPCXpresso (as a µVision 3 replacement for future projects), but i seem to have hit a major problem regarding interrupts.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;First a quick overview of the architecture...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The firmware is divided into several parts, some of which are used in multiple projects:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. The application project itself, which consists of platform- and compiler-specific code&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. A static library which implements several low-level drivers for the µC and acts as a hardware abstraction layer (again, platform and compiler-specific code)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. Several static libraries for communication protocols and other general purpose code. These are writen in pure C99, so they can be used without changes on any platform and compiler&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Since we are using an LPC2366 microcontroller which doesn't have a lot of memory, i would like to use the Thumb instruction set for increased code density. However, when i first tried to compile a simple test project (which would later become the HAL library), i got the following error message:&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;interrupt Service Routines cannot be coded in Thumb mode&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That's unfortunate, but not a big deal if i can use ARM for my interrupts and Thumb for everything else, so i tried this:&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;__attribute__ ((target ("arm"), interrupt ("IRQ"))) static void Timer_ISR(void)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; ...
}&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But the compiler informed me, that the target attribute is not supported. I figured the next best thing would be to use ARM for all files containing interrupts, and Thumb for everything else. So i tried that, and the library itself compiled just fine, but the application project (which uses that library) didn't.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I got the same error as before, but this time it was thrown by the linker.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If it's not possible to combine ARM and Thumb like that, then what's the point of the "Enable Thumb interworking" option?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Jun 2016 02:19:22 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-16T02:19:22Z</dc:date>
    <item>
      <title>Combining ARM and Thumb not possible?</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Combining-ARM-and-Thumb-not-possible/m-p/566937#M18665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Felix G on Mon Oct 26 07:13:20 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i am currently in the process of evaluating LPCXpresso (as a µVision 3 replacement for future projects), but i seem to have hit a major problem regarding interrupts.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;First a quick overview of the architecture...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The firmware is divided into several parts, some of which are used in multiple projects:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. The application project itself, which consists of platform- and compiler-specific code&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. A static library which implements several low-level drivers for the µC and acts as a hardware abstraction layer (again, platform and compiler-specific code)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. Several static libraries for communication protocols and other general purpose code. These are writen in pure C99, so they can be used without changes on any platform and compiler&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Since we are using an LPC2366 microcontroller which doesn't have a lot of memory, i would like to use the Thumb instruction set for increased code density. However, when i first tried to compile a simple test project (which would later become the HAL library), i got the following error message:&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;interrupt Service Routines cannot be coded in Thumb mode&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That's unfortunate, but not a big deal if i can use ARM for my interrupts and Thumb for everything else, so i tried this:&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;__attribute__ ((target ("arm"), interrupt ("IRQ"))) static void Timer_ISR(void)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; ...
}&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But the compiler informed me, that the target attribute is not supported. I figured the next best thing would be to use ARM for all files containing interrupts, and Thumb for everything else. So i tried that, and the library itself compiled just fine, but the application project (which uses that library) didn't.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I got the same error as before, but this time it was thrown by the linker.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If it's not possible to combine ARM and Thumb like that, then what's the point of the "Enable Thumb interworking" option?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:19:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Combining-ARM-and-Thumb-not-possible/m-p/566937#M18665</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: Combining ARM and Thumb not possible?</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Combining-ARM-and-Thumb-not-possible/m-p/566938#M18666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by vtw.433e on Mon Oct 26 11:32:37 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Of course it is possible. Exactly which options are you using for the compiler and the linker? Are you using -mthumb and -mthumb-interwork? Suggest you search for arm/thumb interworking with gcc to work out what you are doing wrong.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:19:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Combining-ARM-and-Thumb-not-possible/m-p/566938#M18666</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: Combining ARM and Thumb not possible?</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Combining-ARM-and-Thumb-not-possible/m-p/566939#M18667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Felix G on Tue Oct 27 03:49:50 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Problem solved!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It actually was caused by one of the options i had selected, however it had nothing to do with the interworking itself...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The culprit is the link-time optimization option (-flto), which apparently doesn't work correctly in this particular combination (ARM library with interrupt, used in a Thumb project with -flto).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 02:19:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Combining-ARM-and-Thumb-not-possible/m-p/566939#M18667</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T02:19:24Z</dc:date>
    </item>
  </channel>
</rss>

