<?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: Entry and Exit of ROM Bootloader, MKE18F + MCUXpresso in MCU Bootloader</title>
    <link>https://community.nxp.com/t5/MCU-Bootloader/Entry-and-Exit-of-ROM-Bootloader-MKE18F-MCUXpresso/m-p/905910#M954</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alexis,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the fast&amp;nbsp;reply!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In our case we can not use the solution that you propose, because as it seems the bootloader called from API doesn't have enable timeout detection. Is this correct?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Source by Erich Styger:&amp;nbsp;&lt;A _jive_internal="true" class="link-titled" href="https://community.nxp.com/thread/456739#comment-928098" title="https://community.nxp.com/thread/456739#comment-928098"&gt;https://community.nxp.com/thread/456739#comment-928098&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, is there any errata in Kinetis ROM Bootloader (Chapter 23) section from&amp;nbsp;&lt;A href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Freference-manual%2FKE1xFP100M168SF0RM.pdf%23%255B%257B%2522num%2522%253A291%252C%2522gen%2522%253A0%257D%252C%257B%2522name%2522%253A%2522FitH%2522%257D%252C780%255D" rel="nofollow" target="_blank"&gt;KE1xFP100M168SF0RM&amp;nbsp;&lt;/A&gt;document or in the datasheet?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_5.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/84296iCEA7244075C2331A/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_5.png" alt="pastedImage_5.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_4.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/84297i3D824A3F035BD8B5/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_4.png" alt="pastedImage_4.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When we enter into the bootloader with FOTP[BOOTSRC_SEL]== 11, it doesn't exit with the timeout detection.&amp;nbsp;Could the&amp;nbsp;issue be related with "Is user valid application?" block (1)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If we enter&amp;nbsp;&lt;SPAN&gt;the bootloader with the API (&lt;A href="https://www.nxp.com/docs/en/reference-manual/MCUBOOTRM.pdf#d29e6a1310_d21e18"&gt;2.6 Bootloader entry point&lt;/A&gt;) and then do a reset pulling the Reset_b pin to GND, only then, it enters&amp;nbsp;the bootloader and then &lt;STRONG&gt;exits with the timeout successfully &lt;/STRONG&gt;and returns to the user application. Maybe this means that the user application is valid?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you Alexis! :smileyhappy:&lt;/P&gt;&lt;P&gt;Jan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 May 2019 09:45:23 GMT</pubDate>
    <dc:creator>scutumlog_nxp</dc:creator>
    <dc:date>2019-05-31T09:45:23Z</dc:date>
    <item>
      <title>Entry and Exit of ROM Bootloader, MKE18F + MCUXpresso</title>
      <link>https://community.nxp.com/t5/MCU-Bootloader/Entry-and-Exit-of-ROM-Bootloader-MKE18F-MCUXpresso/m-p/905906#M950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;Hello,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;I'm working on a MKE18F ROM Bootloader project&amp;nbsp;with&amp;nbsp;MCUXpresso IDE. In this project I try to configure the Bootloader&amp;nbsp;in order to update the &lt;SPAN style="color: #545454; background-color: #ffffff;"&gt;μ&lt;/SPAN&gt;C&amp;nbsp;firmware via CANbus.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;During my test I solved some issues that&amp;nbsp;have appeared and I updated the firmware successfully through UART and CANbus.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;But there are some issues that may cause our system to "lock-up"/brick. To solve this, we need our system to enter the ROM Bootloader&amp;nbsp;when exiting from any reset, and also we want it to exit the Bootloader after a defined timeout.&amp;nbsp;(At the end, we would like to&amp;nbsp;generate a .bin file that contains the Bootloader configuration (BCA); is there any chance to configure the BCA when programming the &lt;SPAN style="color: #545454; background-color: #ffffff; font-size: small;"&gt;μ&lt;/SPAN&gt;C through a debugger that does not require modifying the Linker file?)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;But now I am trying to solve some potential&amp;nbsp;problems&amp;nbsp;and...&amp;nbsp;surprise! I discovered that I can't exit the Bootloader using peripheral detection&amp;nbsp;timeout, and also it doesn't entry after reset (Software reset or Reset_b Pin).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;I know I can't pretend&amp;nbsp;to use timeout if I entered&amp;nbsp;the Boot ROM with the API tree.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;I have tried the next configurations:&lt;/SPAN&gt;&lt;/P&gt;&lt;H1 id="toc-hId-2041656322"&gt;&lt;STRONG&gt;1.- Enter at Start-up Process &amp;amp; Timeout exit:&lt;/STRONG&gt;&lt;/H1&gt;&lt;H2 id="toc-hId--707014144"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;1.1.-&amp;nbsp;FOPT [7] is set to 1&lt;/STRONG&gt;&lt;/H2&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;EM&gt;&amp;nbsp;"FOPT [7] is set to 1. This forces the ROM to run out of reset:"&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="language-c"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;//*****************************************************************************&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// Flash Configuration block : 16-byte flash configuration field that stores&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// default protection settings (loaded on reset) and security information that&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// allows the MCU to restrict access to the Flash Memory module.&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;// Placed at address 0x400 by the linker script.&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;//*****************************************************************************&lt;/SPAN&gt;
__attribute__ &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;used&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;section&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;".FlashConfig"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;const&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;struct&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;unsigned&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt; word1&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;unsigned&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt; word2&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;unsigned&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt; word3&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;unsigned&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt; word4&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt; Flash_Config &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0xFFFFFFFF&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0xFFFFFFFF&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0xFFFFFFFF&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0xFFFFFFFE&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍
&lt;SPAN class="comment token"&gt;//__________________________________________________________^^__&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;//Byte of FOPT -&amp;gt; FF -&amp;gt;FOPT[BOOTSRC_SEL] set to 1 &amp;amp; FOPT[BOOTPIN_OPT] set to 1‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;These code lines can be found in the &lt;EM&gt;startup_mke18f16.c&lt;/EM&gt; file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The information about FOPT register is in these&amp;nbsp;tables (&lt;A href="https://www.nxp.com/docs/en/reference-manual/KE1xFP100M168SF0RM.pdf#d1824e5a1310_d11e1107" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank"&gt;&lt;SPAN&gt;FOPT&amp;nbsp;&lt;/SPAN&gt;address&lt;/A&gt;&amp;nbsp;and &lt;A href="https://www.nxp.com/docs/en/reference-manual/KE1xFP100M168SF0RM.pdf#d2960e6a1310_d2897e29" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank"&gt;FOPT register&lt;/A&gt;) in the&amp;nbsp;&lt;SPAN style="font-size: 15px;"&gt;&lt;STRONG&gt;&lt;A href="https://www.nxp.com/docs/en/reference-manual/KE1xFP100M168SF0RM.pdf#%5B%7B%22num%22%3A291%2C%22gen%22%3A0%7D%2C%7B%22name%22%3A%22FitH%22%7D%2C780%5D" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank"&gt;KE1xFP100M168SF0RM&amp;nbsp;&lt;/A&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 15px;"&gt;document:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="Direccion_FOPT.PNG"&gt;&lt;IMG alt="Direccion_FOPT.PNG" src="https://community.nxp.com/t5/image/serverpage/image-id/83724i7F92BB2E75D3565E/image-size/large?v=v2&amp;amp;px=999" title="Direccion_FOPT.PNG" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="Fopt_Byte.PNG"&gt;&lt;IMG alt="Fopt_Byte.PNG" src="https://community.nxp.com/t5/image/serverpage/image-id/83725iE5078CF93C08A206/image-size/large?v=v2&amp;amp;px=999" title="Fopt_Byte.PNG" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I use this configuration, the MCU enters the Bootloader and I can establish communication via CANbus. But if&amp;nbsp;I don't communicate and I let the five seconds pass (default config),&amp;nbsp;it times-out and resets, but it enters the Bootloader over and over instead of jumping to flash user application. We can see&amp;nbsp;the&amp;nbsp;"timeout and reset every 5 seconds"&amp;nbsp;in&amp;nbsp;these oscilloscope captures:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="scope_11.png"&gt;&lt;IMG alt="scope_11.png" src="https://community.nxp.com/t5/image/serverpage/image-id/83726iEAD1759B9E7B220E/image-size/large?v=v2&amp;amp;px=999" title="scope_11.png" /&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="scope_13.png"&gt;&lt;IMG alt="scope_13.png" src="https://community.nxp.com/t5/image/serverpage/image-id/83727iE843E53D0479AF12/image-size/large?v=v2&amp;amp;px=999" title="scope_13.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;H2 id="toc-hId-1035796191"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;1.2.- BOOTCFG() pin is asserted&lt;/H2&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;EM&gt;"The pin must be configured as BOOTCFG0 by setting the BOOTPIN_OPT bit of FOPT to 0."&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;__attribute__ &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;used&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;section&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;".FlashConfig"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;const&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;struct&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;unsigned&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt; word1&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;unsigned&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt; word2&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;unsigned&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt; word3&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;unsigned&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;int&lt;/SPAN&gt; word4&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt; Flash_Config &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0xFFFFFFFF&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0xFFFFFFFF&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0xFFFFFFFF&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0xFFFF7DFE&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍
&lt;SPAN class="comment token"&gt;//__________________________________________________________^^__&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;//Byte of FOPT -&amp;gt; 7D -&amp;gt;FOPT[BOOTSRC_SEL] set to 0 &amp;amp; FOPT[BOOTPIN_OPT] set to 0‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The information about BOOTCFG0 configuration is in&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;this&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;table&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;in&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;the &lt;A href="https://www.nxp.com/docs/en/reference-manual/KE1xFP100M168SF0RM.pdf#d2960e6a1310_d2897e29" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank"&gt;KE1xFP100M168SF0RM&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 15px;"&gt;document:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pinreset.png"&gt;&lt;IMG alt="pinreset.png" src="https://community.nxp.com/t5/image/serverpage/image-id/83728iF882B2B689939BA1/image-size/large?v=v2&amp;amp;px=999" title="pinreset.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When&amp;nbsp;I&amp;nbsp;use this configuration, I force the BOOTCFG0 pin to GND then I power-on MCU. The MCU enters the Bootloader successfully but timeout is disabled, after five seconds pass it doesn't timeout. I don't know why this is happening, BCA&amp;nbsp;has the&amp;nbsp;default configuration. But nevertheless when I do a reset through the reset_b pin, it enters the Bootloader&amp;nbsp;again but now,&amp;nbsp;after five seconds, it times-out, resets and jumps into the flash user application (desired behaviour).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We keep in mind the next two flow chars and&amp;nbsp;I think the problem&amp;nbsp;is&amp;nbsp;the two conditional blocks before "Disable Timeout" detection (in &lt;A href="https://www.nxp.com/docs/en/reference-manual/KE1xFP100M168SF0RM.pdf#d3104e5a1310_d11e1756" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank"&gt;Figure 23-2- Kinetis bootloader Start-up Flowchart&lt;/A&gt;). We don't know what "Is user application valid?" block is checking.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="Flowchar kinetis bootloader Start up.png"&gt;&lt;IMG alt="Flowchar kinetis bootloader Start up.png" src="https://community.nxp.com/t5/image/serverpage/image-id/83730i6674DB55A1BE1337/image-size/large?v=v2&amp;amp;px=999" title="Flowchar kinetis bootloader Start up.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="bootloader flow char.PNG"&gt;&lt;IMG alt="bootloader flow char.PNG" src="https://community.nxp.com/t5/image/serverpage/image-id/83731iE02B84DBF148DA09/image-size/large?v=v2&amp;amp;px=999" title="bootloader flow char.PNG" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried these&amp;nbsp;configurations segmenting the flash memory in order to add a manually configured BCA. After setting up the Linker file, the result has been the same. Both projects are attached at the end of the post (Bootloader_KE18f_Projects.zip).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope you can help me, thanks a lot in advance!&amp;nbsp;&lt;IMG alt="Smiley Happy" class="emoticon emoticon-smileyhappy" id="smileyhappy" src="https://community.nxp.com/i/smilies/16x16_smiley-happy.png" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Links:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://www.nxp.com/docs/en/data-sheet/KL17P64M48SF2.pdf" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank" title="https://www.nxp.com/docs/en/data-sheet/KL17P64M48SF2.pdf"&gt;https://www.nxp.com/docs/en/data-sheet/KL17P64M48SF2.pdf&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://www.nxp.com/docs/en/data-sheet/KE1xFP100M168SF0.pdf" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank" title="https://www.nxp.com/docs/en/data-sheet/KE1xFP100M168SF0.pdf"&gt;https://www.nxp.com/docs/en/data-sheet/KE1xFP100M168SF0.pdf&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://mcuoneclipse.com/2017/07/12/getting-started-rom-bootloader-on-the-nxp-frdm-kl03z-board/" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank" title="https://mcuoneclipse.com/2017/07/12/getting-started-rom-bootloader-on-the-nxp-frdm-kl03z-board/"&gt;Getting Started: ROM Bootloader on the NXP FRDM-KL03Z Board | MCU on Eclipse&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 14:22:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCU-Bootloader/Entry-and-Exit-of-ROM-Bootloader-MKE18F-MCUXpresso/m-p/905906#M950</guid>
      <dc:creator>scutumlog_nxp</dc:creator>
      <dc:date>2020-11-02T14:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: Entry and Exit of ROM Bootloader, MKE18F + MCUXpresso</title>
      <link>https://community.nxp.com/t5/MCU-Bootloader/Entry-and-Exit-of-ROM-Bootloader-MKE18F-MCUXpresso/m-p/905907#M951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you try using the Kinetis Flash Tool to modified the BCA register. When you download the MCUBoot package if you follow the next route:&lt;/P&gt;&lt;P&gt;NXP_Kinetis_Bootloader_2_0_0\bin\Tools\KinetisFlashTool\win you can find the .exe of this tool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you access the BCA utilites you can configure the binary created in your application.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/84036i0A0A4535C1DA4758/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the configuration you can set the timeout you want and the protocol you want to use. With this you don't need to do this manually.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also I will suggest to check the chapter&amp;nbsp;2.6 Bootloader entry point. With this you could try to call the bootloader if the software reset flag is active for example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The user application valid check if there's write something in the offset section of the bootloader otherwise will jump again to the bootloader.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 May 2019 23:36:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCU-Bootloader/Entry-and-Exit-of-ROM-Bootloader-MKE18F-MCUXpresso/m-p/905907#M951</guid>
      <dc:creator>Alexis_A</dc:creator>
      <dc:date>2019-05-28T23:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: Entry and Exit of ROM Bootloader, MKE18F + MCUXpresso</title>
      <link>https://community.nxp.com/t5/MCU-Bootloader/Entry-and-Exit-of-ROM-Bootloader-MKE18F-MCUXpresso/m-p/905908#M952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alexis,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for replying.&lt;/P&gt;&lt;P&gt;We already knew about the Kinetis Flash Tool, and this application helped us a lot when we were starting with the bootloader.&lt;/P&gt;&lt;P&gt;As far as entry point with API is OK, we are using it correctly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you go in depth&amp;nbsp;what you are referring to when you talk about the offset section of the bootloader? (quoted below)&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;"The user application valid check if there's write something in the offset section of the bootloader otherwise will jump again to the bootloader."&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do we&amp;nbsp;configure and which are the registers&amp;nbsp;needed&amp;nbsp;in order to entry the bootloader after any reset?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot! :smileyhappy:&lt;/P&gt;&lt;P&gt;Jan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2019 11:58:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCU-Bootloader/Entry-and-Exit-of-ROM-Bootloader-MKE18F-MCUXpresso/m-p/905908#M952</guid>
      <dc:creator>scutumlog_nxp</dc:creator>
      <dc:date>2019-05-30T11:58:16Z</dc:date>
    </item>
    <item>
      <title>Re: Entry and Exit of ROM Bootloader, MKE18F + MCUXpresso</title>
      <link>https://community.nxp.com/t5/MCU-Bootloader/Entry-and-Exit-of-ROM-Bootloader-MKE18F-MCUXpresso/m-p/905909#M953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry Jan, with that comment&amp;nbsp;I was refering to the the bootloader located in flash, in case you have this kind of bootloader it always going to enter after any reset but in this case is located in ROM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think the best approach to do this will be call the bootloader in the Reset ISR Vector depending of the reset source. In&amp;nbsp;the chapter&amp;nbsp;2.6 of the MCUBoot Refence Manual there's an example of how to call the bootloader.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 May 2019 20:10:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCU-Bootloader/Entry-and-Exit-of-ROM-Bootloader-MKE18F-MCUXpresso/m-p/905909#M953</guid>
      <dc:creator>Alexis_A</dc:creator>
      <dc:date>2019-05-30T20:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: Entry and Exit of ROM Bootloader, MKE18F + MCUXpresso</title>
      <link>https://community.nxp.com/t5/MCU-Bootloader/Entry-and-Exit-of-ROM-Bootloader-MKE18F-MCUXpresso/m-p/905910#M954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alexis,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the fast&amp;nbsp;reply!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In our case we can not use the solution that you propose, because as it seems the bootloader called from API doesn't have enable timeout detection. Is this correct?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Source by Erich Styger:&amp;nbsp;&lt;A _jive_internal="true" class="link-titled" href="https://community.nxp.com/thread/456739#comment-928098" title="https://community.nxp.com/thread/456739#comment-928098"&gt;https://community.nxp.com/thread/456739#comment-928098&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, is there any errata in Kinetis ROM Bootloader (Chapter 23) section from&amp;nbsp;&lt;A href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Freference-manual%2FKE1xFP100M168SF0RM.pdf%23%255B%257B%2522num%2522%253A291%252C%2522gen%2522%253A0%257D%252C%257B%2522name%2522%253A%2522FitH%2522%257D%252C780%255D" rel="nofollow" target="_blank"&gt;KE1xFP100M168SF0RM&amp;nbsp;&lt;/A&gt;document or in the datasheet?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_5.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/84296iCEA7244075C2331A/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_5.png" alt="pastedImage_5.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_4.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/84297i3D824A3F035BD8B5/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_4.png" alt="pastedImage_4.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When we enter into the bootloader with FOTP[BOOTSRC_SEL]== 11, it doesn't exit with the timeout detection.&amp;nbsp;Could the&amp;nbsp;issue be related with "Is user valid application?" block (1)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If we enter&amp;nbsp;&lt;SPAN&gt;the bootloader with the API (&lt;A href="https://www.nxp.com/docs/en/reference-manual/MCUBOOTRM.pdf#d29e6a1310_d21e18"&gt;2.6 Bootloader entry point&lt;/A&gt;) and then do a reset pulling the Reset_b pin to GND, only then, it enters&amp;nbsp;the bootloader and then &lt;STRONG&gt;exits with the timeout successfully &lt;/STRONG&gt;and returns to the user application. Maybe this means that the user application is valid?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you Alexis! :smileyhappy:&lt;/P&gt;&lt;P&gt;Jan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 May 2019 09:45:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCU-Bootloader/Entry-and-Exit-of-ROM-Bootloader-MKE18F-MCUXpresso/m-p/905910#M954</guid>
      <dc:creator>scutumlog_nxp</dc:creator>
      <dc:date>2019-05-31T09:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: Entry and Exit of ROM Bootloader, MKE18F + MCUXpresso</title>
      <link>https://community.nxp.com/t5/MCU-Bootloader/Entry-and-Exit-of-ROM-Bootloader-MKE18F-MCUXpresso/m-p/905911#M955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Jan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looks like the Bootloader its exiting the application the application but after some miliseconds in the application the MCU reset by the watchdog. You could check this if you print something after enter you're application.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There's a note in the reference manual of the &lt;A href="https://www.nxp.com/docs/en/reference-manual/KE1xFP100M168SF0RM.pdf"&gt;KE1xF&lt;/A&gt;&amp;nbsp;that explains that if you want the Watchdog to support the bootloader is necessary to reconfigure the bootloader because unless in the start up code the watchdog is being disabled this will be ignored unless you reconfigured. Check the chapter 30.4.3.2 Reconfiguring the Watchdog for more information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jun 2019 17:35:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCU-Bootloader/Entry-and-Exit-of-ROM-Bootloader-MKE18F-MCUXpresso/m-p/905911#M955</guid>
      <dc:creator>Alexis_A</dc:creator>
      <dc:date>2019-06-11T17:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: Entry and Exit of ROM Bootloader, MKE18F + MCUXpresso</title>
      <link>https://community.nxp.com/t5/MCU-Bootloader/Entry-and-Exit-of-ROM-Bootloader-MKE18F-MCUXpresso/m-p/905912#M956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alexis! :smileygrin:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We worked in it and seems that the problem is&amp;nbsp;due to the&amp;nbsp;watchdog! We could find the problem by making a GPIO toggle inside a while, and the toggling only lasted around 8ms, this showed us that the user application started running indeed.&lt;/P&gt;&lt;P&gt;We&amp;nbsp;have been trying to&amp;nbsp;set Watchdog CS[UPDATE] to 1, but the problem remains.&amp;nbsp;Anyway we kept trying and&amp;nbsp;finally we managed to disable the Watchdog successfully using&amp;nbsp;these&amp;nbsp;API functions:&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="token function"&gt;WDOG32_Disable&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;WDOG&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍
&lt;SPAN class="token function"&gt;WDOG32_Deinit&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;WDOG&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much! this was driving us crazy.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Jun 2019 10:30:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCU-Bootloader/Entry-and-Exit-of-ROM-Bootloader-MKE18F-MCUXpresso/m-p/905912#M956</guid>
      <dc:creator>scutumlog_nxp</dc:creator>
      <dc:date>2019-06-13T10:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: Entry and Exit of ROM Bootloader, MKE18F + MCUXpresso</title>
      <link>https://community.nxp.com/t5/MCU-Bootloader/Entry-and-Exit-of-ROM-Bootloader-MKE18F-MCUXpresso/m-p/905913#M957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Jan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm glad that this information help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Alexis Andalon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jun 2019 13:49:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCU-Bootloader/Entry-and-Exit-of-ROM-Bootloader-MKE18F-MCUXpresso/m-p/905913#M957</guid>
      <dc:creator>Alexis_A</dc:creator>
      <dc:date>2019-06-17T13:49:53Z</dc:date>
    </item>
  </channel>
</rss>

