<?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: Using flashx io_ioctl FLASH_IOCTL_SWAP_FLASH_AND_RESET for bootloader in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254747#M7473</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nancy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is probably too late to help you but here goes anyway.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I Revised MQX 4.0 BSP to support a new flashx ioctl(), namely &lt;SPAN style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;FLASH_IOCTL_SWAP_FLASH.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;This&amp;nbsp; gives you support of the swap state transitions for swapping the active flash bank. &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;Called like this &lt;SPAN style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;:&amp;nbsp;&amp;nbsp; ioctl(flash_file, FLASH_IOCTL_SWAP_FLASH, &amp;amp;swap_status). T&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11pt; font-family: 'Calibri','sans-serif';"&gt;he "swap_status"&amp;nbsp; parameter is used for I/O with the low level swap driver: sends the swap control code and returns the swap status. &lt;/SPAN&gt;&lt;SPAN style="font-size: 11pt; font-family: 'Calibri','sans-serif';"&gt;See UpdateFirmwareDemo.c&amp;nbsp; in attached c&lt;SPAN style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;ode for details.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Mar 2013 21:33:20 GMT</pubDate>
    <dc:creator>davidwhite</dc:creator>
    <dc:date>2013-03-06T21:33:20Z</dc:date>
    <item>
      <title>Using flashx io_ioctl FLASH_IOCTL_SWAP_FLASH_AND_RESET for bootloader</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254744#M7470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am implementing a bootloader for a K60FX512VLQ12 processor. For my initial effort I used the swap_demo code from application note AN4533. I successfully implemented a bootloader in a non-MQX environment. Next I sought to incorporate the lessons learned in my application that uses MQX 3.8.1. I could not even access the swap status with MQX; I assume MQX has enabled protection for these registers. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I found an MQX example demo dual_flash_update for a M51 processor that I adapted to my K60 processor. I can successfully update program flash bank 1 with the code from bank 0 but when I execute&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;_io_ioctl(flash_hdl,&amp;nbsp; FLASH_IOCTL_SWAP_FLASH_AND_RESET, NULL);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the swap and reset does not occur.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this capability supported for my processor and MQX version? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The swap demo code from AN4533 stepped through the swap process and it was easy to debug each step, including the erasure of bank 1 and the actual swap step. It's not clear to me what actually went wrong with my MQX example and how to proceed, so I thought I would check to see if there are any known problems or issues.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, is it possible to disable whatever MQX protection settings that are preventing me from implementing the bootloader developed using the AN4533 example in the context of MQX?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Feb 2013 17:27:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254744#M7470</guid>
      <dc:creator>nancyb</dc:creator>
      <dc:date>2013-02-11T17:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using flashx io_ioctl FLASH_IOCTL_SWAP_FLASH_AND_RESET for bootloader</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254745#M7471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had similar problem and single stepped into the code.&amp;nbsp; FLASH_IOCTL_SWAP_FLASH_AND_RESET is not implemented in MQX 4.0 or MQX 3.8.1. We could not find it implemented in any of the Kinetis BSPs.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Feb 2013 22:40:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254745#M7471</guid>
      <dc:creator>davidwhite</dc:creator>
      <dc:date>2013-02-12T22:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using flashx io_ioctl FLASH_IOCTL_SWAP_FLASH_AND_RESET for bootloader</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254746#M7472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, David, for this information. Unless I hear different, I won't bother updating to MQX 4.0 right now, and I will pursue the alternate path; implement the swap using the code derived from AN4533. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried a couple times stepping into the io_ioctl routine but the debugger gets lost very quickly, I am debugging on a Windows 7 PC and the only recovery is to quit CodeWarrior and use TaskManager to kill DE.exe.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Feb 2013 13:02:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254746#M7472</guid>
      <dc:creator>nancyb</dc:creator>
      <dc:date>2013-02-13T13:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: Using flashx io_ioctl FLASH_IOCTL_SWAP_FLASH_AND_RESET for bootloader</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254747#M7473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nancy,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is probably too late to help you but here goes anyway.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I Revised MQX 4.0 BSP to support a new flashx ioctl(), namely &lt;SPAN style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;FLASH_IOCTL_SWAP_FLASH.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;This&amp;nbsp; gives you support of the swap state transitions for swapping the active flash bank. &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;Called like this &lt;SPAN style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;:&amp;nbsp;&amp;nbsp; ioctl(flash_file, FLASH_IOCTL_SWAP_FLASH, &amp;amp;swap_status). T&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 11pt; font-family: 'Calibri','sans-serif';"&gt;he "swap_status"&amp;nbsp; parameter is used for I/O with the low level swap driver: sends the swap control code and returns the swap status. &lt;/SPAN&gt;&lt;SPAN style="font-size: 11pt; font-family: 'Calibri','sans-serif';"&gt;See UpdateFirmwareDemo.c&amp;nbsp; in attached c&lt;SPAN style="font-family: 'Calibri','sans-serif'; font-size: 11pt;"&gt;ode for details.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Mar 2013 21:33:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254747#M7473</guid>
      <dc:creator>davidwhite</dc:creator>
      <dc:date>2013-03-06T21:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: Using flashx io_ioctl FLASH_IOCTL_SWAP_FLASH_AND_RESET for bootloader</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254748#M7474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, David, for sharing your solution. Your MQX supported solution is succinct and elegant. I did end up modifying the code from AN4533 to implement my bootloader and it works without exception. One artifact of my solution is that I cannot execute the swap while MQX is running; I observed hard faults and system resets. I worked around this by splicing into mqx_main.c to perform the bootloader processing prior to starting MQX. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does your solution require MQX 4.0? I am using MQX 3.8.1 and don't anticipate upgrading to 4.0 anytime soon. I don't want to go looking for trouble; trouble seems to find me just fine without my help :smileylaugh:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2013 15:44:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254748#M7474</guid>
      <dc:creator>nancyb</dc:creator>
      <dc:date>2013-03-07T15:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using flashx io_ioctl FLASH_IOCTL_SWAP_FLASH_AND_RESET for bootloader</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254749#M7475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're welcome. It is a common need so I though it good to share with the community. I asked Freescale to build it into their next release. I think it does require MQX 4.0. I did not try it with MQX 3.8.1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Mar 2013 15:56:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254749#M7475</guid>
      <dc:creator>davidwhite</dc:creator>
      <dc:date>2013-03-07T15:56:21Z</dc:date>
    </item>
    <item>
      <title>Re: Using flashx io_ioctl FLASH_IOCTL_SWAP_FLASH_AND_RESET for bootloader</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254750#M7476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for sharing your project. Sadly, I can not compile it, since FLASH_IOCTL_SWAP_FLASH is missing in my MQX 4.0 build. How did you added it? Can you share your library too?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Artur&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Mar 2013 13:58:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254750#M7476</guid>
      <dc:creator>artur73</dc:creator>
      <dc:date>2013-03-20T13:58:30Z</dc:date>
    </item>
    <item>
      <title>Re: Using flashx io_ioctl FLASH_IOCTL_SWAP_FLASH_AND_RESET for bootloader</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254751#M7477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Artur, &lt;SPAN style="color: #3f7f5f; font-size: 10pt;"&gt;&lt;SPAN class="mce_paste_marker"&gt;I think the files were in the archive but I will attach them again. You need to replace them in the MQX_4_0 source and rebuild.&amp;nbsp; See notes below on files to replace:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3f7f5f; font-size: 10pt;"&gt;&lt;SPAN class="mce_paste_marker"&gt;They are located in the bsp "mqx\source\io\flashx" and some in "mqx\source\io\flashx\freescale"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3f7f5f; font-size: 10pt;"&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3f7f5f; font-size: 10pt;"&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P align="left"&gt;This support was added by modifying below files in BSP_TWR_K60D100M.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;* -----------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;* flashx.h: revised flashx_device_if_struct to add&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;* boolean (_CODE_PTR_ CHIP_ERASE)(struct io_flashx_struct *, char_ptr);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;* &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;* flashx.c revised _io_flashx_install() to initialize the CHIP_SWAP pointer &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;* revised _io_flashx_ioctl() to add a case for FLASH_IOCTL_SWAP_FLASH &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;*&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;* flashprv.h&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;* revised io_flashx_struct to add&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;* boolean (_CODE_PTR_ CHIP_ERASE)(struct io_flashx_struct *, char_ptr);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;* &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;* flash_ftfl_prv.h&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;* added prototype for function ftfl_flash_swap()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;* &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;* flash_ftfl.c&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;* added function ftfl_flash_swap() to perform the bank swap&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P align="left"&gt;* revised const FLASHX_DEVICE_IF_STRUCT _flashx_ftfl_if to add ftfl_flash_swap&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2013 17:08:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254751#M7477</guid>
      <dc:creator>davidwhite</dc:creator>
      <dc:date>2013-03-21T17:08:56Z</dc:date>
    </item>
    <item>
      <title>Re: Using flashx io_ioctl FLASH_IOCTL_SWAP_FLASH_AND_RESET for bootloader</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254752#M7478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;swapsupport.zip has the mqx source files that were modified to add the IOCTL that supports flash swap. See the demo in the earlier post for examples of how to use it. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2013 17:11:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254752#M7478</guid>
      <dc:creator>davidwhite</dc:creator>
      <dc:date>2013-03-21T17:11:38Z</dc:date>
    </item>
    <item>
      <title>Re: Using flashx io_ioctl FLASH_IOCTL_SWAP_FLASH_AND_RESET for bootloader</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254753#M7479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot for the code and project. I added your code to the default MQX library and recompiled it.&lt;/P&gt;&lt;P&gt;Actually, I've encountered some issues with it.&lt;/P&gt;&lt;P&gt;I tried to create similar application under IAR. Everything looks OK except reading data from the active bank.&lt;/P&gt;&lt;P&gt;When debugger's pointer &lt;STRONG&gt;second&lt;/STRONG&gt; time reaches line in the &lt;STRONG&gt;read2ks&lt;/STRONG&gt; function:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;len = read(fl_bank0, chbuf,_CHBUF_SIZE_); // copy flash block to the buffer&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it for some reasons jumps to &lt;STRONG&gt;boot.s&lt;/STRONG&gt; and starts to cycle on these lines (see below) and execution stacked there: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; ldr r0, =0xe000e180 &lt;/STRONG&gt;&lt;/EM&gt;&lt;/TD&gt;&lt;TD&gt;&lt;EM&gt;&lt;STRONG&gt;/* NVIC_ICER0 - Interrupt Clear-Enable Registers */&lt;/STRONG&gt;&lt;/EM&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; ldr r1, =0xe000e280 &lt;/STRONG&gt;&lt;/EM&gt;&lt;/TD&gt;&lt;TD&gt;&lt;EM&gt;&lt;STRONG&gt;/* NVIC_ICPR0 - Interrupt Clear-Pending Registers */&lt;/STRONG&gt;&lt;/EM&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; ldr r2, =0xffffffff&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp; mov r3, #8&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Any help on this will be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;I'm trying to copy from active to inactive the software itself, also I use &lt;STRONG&gt;Int Flash Debug&lt;/STRONG&gt; configuration.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;That way Swap example works fine, but I would like to use MQX libraries.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Mar 2013 19:37:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254753#M7479</guid>
      <dc:creator>artur73</dc:creator>
      <dc:date>2013-03-25T19:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: Using flashx io_ioctl FLASH_IOCTL_SWAP_FLASH_AND_RESET for bootloader</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254754#M7480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Artur,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry, I have not tried IAR. The only configuration I have tested is CW 10.3 with MQX 4.0 for TWRK60N100.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't understand your comment about &lt;STRONG&gt;Int Flash Debug &lt;/STRONG&gt;configuration. Are you saying that &lt;STRONG&gt;Int Flash Debug&lt;/STRONG&gt; works correctly but &lt;STRONG&gt;Int Ram Debug&lt;/STRONG&gt; does not?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Mar 2013 19:55:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254754#M7480</guid>
      <dc:creator>davidwhite</dc:creator>
      <dc:date>2013-03-25T19:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: Using flashx io_ioctl FLASH_IOCTL_SWAP_FLASH_AND_RESET for bootloader</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254755#M7481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was able to make working normally the AN4533 application note from Freescale under IAR, which uses &lt;STRONG&gt;Int Flash Debug&lt;/STRONG&gt; configuration. Now I want to use yours, but also with &lt;STRONG&gt;Int Flash Debug&lt;/STRONG&gt; configuration, but so far no luck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am really not sure, why the execution pointer jumps to that Boot.s and eventually calls reset, so debugging session restarts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Artur&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Mar 2013 20:40:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254755#M7481</guid>
      <dc:creator>artur73</dc:creator>
      <dc:date>2013-03-25T20:40:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using flashx io_ioctl FLASH_IOCTL_SWAP_FLASH_AND_RESET for bootloader</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254756#M7482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eventually, I made everything working under IAR, thanks.&lt;/P&gt;&lt;P&gt;Now I have a question - is it possible to change sector size?&lt;/P&gt;&lt;P&gt;Or, is it possible to write data by pieces of 256 bytes instead of 2k?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Artur&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Apr 2013 18:28:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254756#M7482</guid>
      <dc:creator>artur73</dc:creator>
      <dc:date>2013-04-01T18:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: Using flashx io_ioctl FLASH_IOCTL_SWAP_FLASH_AND_RESET for bootloader</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254757#M7483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Artur,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good Job! Yes, I used 2k because that is the FLASH sector size on my K60. You can use arbitrary sizes.&lt;/P&gt;&lt;P&gt;I've seen examples from Freescale where they write one long word (32-bit) at a time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should be able to use the cache to improve performance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; /* Enable the sector cache */&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; ioctl(flash_file, FLASH_IOCTL_ENABLE_SECTOR_CACHE, NULL);&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You,&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Apr 2013 18:55:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254757#M7483</guid>
      <dc:creator>davidwhite</dc:creator>
      <dc:date>2013-04-01T18:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using flashx io_ioctl FLASH_IOCTL_SWAP_FLASH_AND_RESET for bootloader</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254758#M7484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually, I use the same TWR-K60D100M, so it has to have 2k sector size.&lt;/P&gt;&lt;P&gt;So, the write block size has nothing to do with the sector size?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Artur&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Apr 2013 19:00:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254758#M7484</guid>
      <dc:creator>artur73</dc:creator>
      <dc:date>2013-04-01T19:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: Using flashx io_ioctl FLASH_IOCTL_SWAP_FLASH_AND_RESET for bootloader</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254759#M7485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Artur,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Correct. The I/O system manages the FLASH for you. That is a large benefit of using MQX.&amp;nbsp; I think you can pick an arbitrary block size. I have not tested with anything larger than 2k. I picked 2k because it seemed optimal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whatever you do, test it thoroughly to be sure you're getting the results you expect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;David&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Apr 2013 19:09:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254759#M7485</guid>
      <dc:creator>davidwhite</dc:creator>
      <dc:date>2013-04-01T19:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using flashx io_ioctl FLASH_IOCTL_SWAP_FLASH_AND_RESET for bootloader</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254760#M7486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply, David.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, what is the meaning of "sector" in this case?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Apr 2013 19:11:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254760#M7486</guid>
      <dc:creator>artur73</dc:creator>
      <dc:date>2013-04-01T19:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Using flashx io_ioctl FLASH_IOCTL_SWAP_FLASH_AND_RESET for bootloader</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254761#M7487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The K60 with 512kB&amp;nbsp; has 256 2kB sectors. A sector is the smallest part of FLASH that can be erased by the FLASH controller. That is, you can't erase only one byte if you are coding on the "bare metal". The smallest region you can erase is 2kB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That being said you may not need to know or care what a sector is when you use the RTOS for flashing because it handles many of the low level details automatically.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Apr 2013 19:24:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254761#M7487</guid>
      <dc:creator>davidwhite</dc:creator>
      <dc:date>2013-04-01T19:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: Using flashx io_ioctl FLASH_IOCTL_SWAP_FLASH_AND_RESET for bootloader</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254762#M7488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot, I implemented flash uploading and saving, everything is fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have another issue. Let say, for some reasons corrupted firmware was uploaded and after swap/reboot we have "bricked" MCU. Is there any way to swap back to the working flash part?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Apr 2013 20:03:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Using-flashx-io-ioctl-FLASH-IOCTL-SWAP-FLASH-AND-RESET-for/m-p/254762#M7488</guid>
      <dc:creator>artur73</dc:creator>
      <dc:date>2013-04-05T20:03:06Z</dc:date>
    </item>
  </channel>
</rss>

