<?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 Re: LPC1788 USB bootloader - Issue with user program in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1788-USB-bootloader-Issue-with-user-program/m-p/522839#M5475</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;bump&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 19 Jun 2016 01:07:40 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-19T01:07:40Z</dc:date>
    <item>
      <title>LPC1788 USB bootloader - Issue with user program</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1788-USB-bootloader-Issue-with-user-program/m-p/522834#M5470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by zou9a on Thu Apr 07 06:21:50 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Peace be upon all of you,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have recently searched for an USB bootloader for LPC1788 to use it with my application, but I have never found an exemple. Starting from the code Red exemple (1) based on LPC1768, and following the application note (2) and the user manual to well understand what I'm doing, I have write a bootloader for the LPC1788. I can update firmware (user app) and execute some user application like a blinky without any problems. Now, I'm trying to execute my application (LCD+EMC_SDRAM+TS+RS485+GPIO...) and updated if necessary using this boot loader. Briefly: It doesn't work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Last work I have done: I debug (with my firmware on flash starting at sector 16 0x10000) the USB bootloader. The bootloader detect that code is present, and when trying to execute it, I got IntDefaultHandler (pic 1). I have no idea why I get this interrupt, so I thak you for help. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Code that execute firmware and remapp vector table:&lt;/SPAN&gt;&lt;BR /&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca" style="border:1px solid black;background-color:#cacaca;border:1px solid black;background-color:#cacaca;background-color:#cacaca;border:1px solid black;background-color:#cacaca;border:1px solid black;"&gt; &lt;PRE&gt;void execute_user_code(void) {
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
According to UM: 5.4 Vector table remapping */
SCB-&amp;gt;VTOR = USER_FLASH_START;
// 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;
&amp;nbsp;&amp;nbsp;&amp;nbsp; user_code_entry();
}&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;Why to execute user code we must point to the second word of USER_FLASH_START and not the first? Where can I find an explanation of the structuration of a code (the BIN file)?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;When I try to read the firmware.bin (all user memory) with an HEXEditor, last address is 0x60FF and not 0x7FFFF? But windows show that space of flash is 448KB (that correct 0x70000).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;(1). &lt;/SPAN&gt;&lt;A _jive_internal="true" class="" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.support.code-red-tech.com%2FCodeRedWiki%2FRDB1768cmsisExampleProjects" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.support.code-red-tech.com/CodeRedWiki/RDB1768cmsisExampleProjects&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;(2). &lt;/SPAN&gt;&lt;A _jive_internal="true" class="" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.nxp.com%2Fdocuments%2Fapplication_note%2FAN10866.pdf" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.nxp.com/documents/application_note/AN10866.pdf&lt;/A&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:55:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1788-USB-bootloader-Issue-with-user-program/m-p/522834#M5470</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1788 USB bootloader - Issue with user program</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1788-USB-bootloader-Issue-with-user-program/m-p/522835#M5471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by zou9a on Thu Apr 07 06:46:39 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;PS: linkscript of user application&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;MFlash512 (rx) : ORIGIN = 0x10000, LENGTH = 0x70000 /* 512K bytes (alias Flash) */&amp;nbsp; 
&amp;nbsp; RamLoc64 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x10000 /* 64K bytes (alias RAM) */&amp;nbsp; 
&amp;nbsp; RamPeriph32 (rwx) : ORIGIN = 0x20000000, LENGTH = 0x8000 /* 32K bytes (alias RAM2) */&amp;nbsp; 
&amp;nbsp; extSDRAM32768 (rwx) : ORIGIN = 0xa0000000, LENGTH = 0x2000000 /* 32M bytes (alias RAM3) */&amp;nbsp; &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 17:55:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1788-USB-bootloader-Issue-with-user-program/m-p/522835#M5471</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1788 USB bootloader - Issue with user program</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1788-USB-bootloader-Issue-with-user-program/m-p/522836#M5472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by R2D2 on Thu Apr 07 07:05:01 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: zou9a&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;Why to execute user code we must point to the second word of USER_FLASH_START and not the first? Where can I find an explanation of the structuration of a code (the BIN file)?&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Because that's the vector table&amp;nbsp; :) &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;As explained in #1 of &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fwww.lpcware.com%2Fcontent%2Fforum%2Fjump-bootloader-actual-firmware" rel="nofollow" target="_blank"&gt;https://www.lpcware.com/content/forum/jump-bootloader-actual-firmware&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;...and your User manual... &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:55:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1788-USB-bootloader-Issue-with-user-program/m-p/522836#M5472</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1788 USB bootloader - Issue with user program</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1788-USB-bootloader-Issue-with-user-program/m-p/522837#M5473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by zou9a on Mon Apr 11 03:43:06 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I cant make my user program RUN. I have tried anything, what could be the problem&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thx&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:55:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1788-USB-bootloader-Issue-with-user-program/m-p/522837#M5473</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1788 USB bootloader - Issue with user program</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1788-USB-bootloader-Issue-with-user-program/m-p/522838#M5474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by zou9a on Mon Apr 11 04:41:19 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Finally, I have a better result. I disable all IRQ (__diseable_irq()) before jumping to the user app. My application run but the problem is I cant use interrupts like touching screen... when I tried to enable IRQ in my user code, I get hardfault_interrupt. Am I doing somthing wrong?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:55:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1788-USB-bootloader-Issue-with-user-program/m-p/522838#M5474</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1788 USB bootloader - Issue with user program</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1788-USB-bootloader-Issue-with-user-program/m-p/522839#M5475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;bump&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Jun 2016 01:07:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1788-USB-bootloader-Issue-with-user-program/m-p/522839#M5475</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-19T01:07:40Z</dc:date>
    </item>
  </channel>
</rss>

