<?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: Application hangs when runs from 0x10000</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Application-hangs-when-runs-from-0x10000/m-p/524056#M6692</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by wmues on Mon Aug 11 13:42:02 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;At which address is your interrupt vector table?&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 18:04:29 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T18:04:29Z</dc:date>
    <item>
      <title>Application hangs when runs from 0x10000</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Application-hangs-when-runs-from-0x10000/m-p/524055#M6691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by kabriolin on Mon Aug 11 12:53:19 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'am currently working on a robotics system running on some custom 1769 boards.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The system is stable and running during developpment for months now. And a new step is comming: uploading new releases by bootloader.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So the bootloader is working fine from USB and from RS485 bus. A simple application can be uploaded and lunched by the bootloader very well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But the real one (and bigger, about 50ko) can be uploaded, but hangs when running, when the same code running from 0x0 runs very well.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So i've commented some parts of the code, is runs (from 0x10000), un-commented them, its hangs, commented some other, it's runs....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So i've uploaded the code (that hangs) with the lpc-link from 0x10000 to see what happens, and it goes to the hardfault handler with differents errors and from differents parts of the code, with corrupted registers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does anyone have any idea?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:04:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Application-hangs-when-runs-from-0x10000/m-p/524055#M6691</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: Application hangs when runs from 0x10000</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Application-hangs-when-runs-from-0x10000/m-p/524056#M6692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by wmues on Mon Aug 11 13:42:02 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;At which address is your interrupt vector table?&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:04:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Application-hangs-when-runs-from-0x10000/m-p/524056#M6692</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: Application hangs when runs from 0x10000</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Application-hangs-when-runs-from-0x10000/m-p/524057#M6693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by kabriolin on Mon Aug 11 23:37:19 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It's at its initial position, i hadn't change it. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Bootloader is using interrupts and runs.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:04:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Application-hangs-when-runs-from-0x10000/m-p/524057#M6693</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: Application hangs when runs from 0x10000</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Application-hangs-when-runs-from-0x10000/m-p/524058#M6694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by kabikov on Tue Aug 12 04:25:10 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I assume that you correctly do remap of interrupts. In this case you should carefully reset to default all devices on chip, turn off IRQ that you used in your bootloader and so on. Other reason for hardfault may be optimization at link time, -fPIC and all other optimization settings.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:04:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Application-hangs-when-runs-from-0x10000/m-p/524058#M6694</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: Application hangs when runs from 0x10000</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Application-hangs-when-runs-from-0x10000/m-p/524059#M6695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by kabriolin on Tue Aug 12 10:01:34 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using this part of code to jump to user application, with the "VTOR" register initialized to the vector table offset:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
void (*user_code_entry)(void);

unsigned *p;// used for loading address of reset handler from user flash

/* Change the Vector Table to the USER_FLASH_START 
in case the user application uses interrupts */
SCB-&amp;gt;VTOR = (USER_FLASH_START &amp;amp; 0x1FFFFF80);

// Load contents of second word of user flash - the reset handler address
// in the applications vector table
p = (unsigned *)(USER_FLASH_START +4);

// Set user_code_entry to be the address contained in that second word
// of user flash
user_code_entry = (void *) *p;

// Jump to user application
user_code_entry();
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:04:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Application-hangs-when-runs-from-0x10000/m-p/524059#M6695</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: Application hangs when runs from 0x10000</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Application-hangs-when-runs-from-0x10000/m-p/524060#M6696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by lpcxpresso-support on Wed Aug 13 00:02:16 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Check your stack pointer…&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%2Fwww.lpcware.com%2Fcontent%2Fforum%2Flpc1768-secondary-usb-bootloader-lock%23comment-1133905" rel="nofollow" target="_blank"&gt;http://www.lpcware.com/content/forum/lpc1768-secondary-usb-bootloader-lock#comment-1133905&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPCXpresso Support&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:04:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Application-hangs-when-runs-from-0x10000/m-p/524060#M6696</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: Application hangs when runs from 0x10000</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Application-hangs-when-runs-from-0x10000/m-p/524061#M6697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by kabriolin on Wed Aug 13 09:56:37 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your time you spend on this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But nothing has change&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I've added this to the start_user_code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
__disable_irq();

unsigned int stackadr = USER_FLASH_START;
stackadr = *(unsigned int*)stackadr;
__set_MSP(stackadr);
&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 still in hardfault:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
Faults&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = ImpreciseErr
Fault PC&amp;nbsp;&amp;nbsp; = 0x000166D2
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = prvInsertBlockIntoFreeList + 166 in section .text
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = File: ../FreeRTOS_portable/MemMang/heap_4.c&amp;nbsp; Line: 454

Fault status registers:
IPSR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x1000003: 3&amp;nbsp; (HardFault)
CFSR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 00000400 (Configurable Fault Status Register)
HFSR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 40000000 (Hard Fault Status Register)
DFSR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 00000000 (Debug Fault Status Register)
MMAR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = e000edf8 [INVALID] (MemManage Fault Address Register)
BFAR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = e000edf8 [INVALID] (Bus Fault Address Register)
AFSR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 00000000 (Auxiliary Fault Status Register)

Stacked registers:
R0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 10003cf8
R1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 00000000
R2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 10003cf8
R3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 00000000
R12&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 10002a98
LR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 000164d3
PC&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 000166d2
PSR&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 01000000
SP&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 10003c40
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:04:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Application-hangs-when-runs-from-0x10000/m-p/524061#M6697</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:04:32Z</dc:date>
    </item>
  </channel>
</rss>

