<?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: How do I use my own flashing script in MCUXpresso in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-use-my-own-flashing-script-in-MCUXpresso/m-p/1757107#M65697</link>
    <description>&lt;P&gt;MK81FN256&lt;/P&gt;</description>
    <pubDate>Tue, 14 Nov 2023 18:48:28 GMT</pubDate>
    <dc:creator>RogerDavisWork</dc:creator>
    <dc:date>2023-11-14T18:48:28Z</dc:date>
    <item>
      <title>How do I use my own flashing script in MCUXpresso</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-use-my-own-flashing-script-in-MCUXpresso/m-p/1753705#M65678</link>
      <description>&lt;P&gt;We have some projects that use the MCUXpresso IDE for building, flashing, and debugging.&lt;/P&gt;&lt;P&gt;One of our projects requires multiple steps to flash the target because it uses both internal and external flash parts.&amp;nbsp; We have a flashing script that works for us from a command line interface using JLink commands and would like to port it into the MCUXpresso setup so that we can call it to flash the target when we want to debug.&lt;/P&gt;&lt;P&gt;I have tried multiple things to get it to recognize my script but I am doing it wrong somehow.&amp;nbsp; First, I cannot seem to replace the script.jlink file that is in the project because it just gets overwritten with the default values.&amp;nbsp; I also tried editing the debug configuration and having the path to my flashing script in the Script field in the JLink Debugger tab, but that generates errors as if it is looking for some other kind of file than my flashing script.&lt;/P&gt;&lt;P&gt;Please advise me as to how to get MCUXpresso to use my script and execute it such that the JLink commands will flash my target in the debug startup sequence.&amp;nbsp; Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2023 20:50:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-use-my-own-flashing-script-in-MCUXpresso/m-p/1753705#M65678</guid>
      <dc:creator>RogerDavisWork</dc:creator>
      <dc:date>2023-11-07T20:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use my own flashing script in MCUXpresso</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-use-my-own-flashing-script-in-MCUXpresso/m-p/1754363#M65679</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/225442"&gt;@RogerDavisWork&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you tell us what is your part number?&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 17:46:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-use-my-own-flashing-script-in-MCUXpresso/m-p/1754363#M65679</guid>
      <dc:creator>Pavel_Hernandez</dc:creator>
      <dc:date>2023-11-08T17:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use my own flashing script in MCUXpresso</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-use-my-own-flashing-script-in-MCUXpresso/m-p/1757107#M65697</link>
      <description>&lt;P&gt;MK81FN256&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 18:48:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-use-my-own-flashing-script-in-MCUXpresso/m-p/1757107#M65697</guid>
      <dc:creator>RogerDavisWork</dc:creator>
      <dc:date>2023-11-14T18:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use my own flashing script in MCUXpresso</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-use-my-own-flashing-script-in-MCUXpresso/m-p/1757181#M65699</link>
      <description>&lt;P&gt;Hello, in order to get more details, is the script the same one that you use successfully on J-link commander? or did you make modifications to add on the J-Link debugger tab? Could you share both if possible?&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Pavel&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 22:34:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-use-my-own-flashing-script-in-MCUXpresso/m-p/1757181#M65699</guid>
      <dc:creator>Pavel_Hernandez</dc:creator>
      <dc:date>2023-11-14T22:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use my own flashing script in MCUXpresso</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-use-my-own-flashing-script-in-MCUXpresso/m-p/1757812#M65706</link>
      <description>&lt;P&gt;I found a partial workaround by adding the flashing batch file that uses the jlink script as a post-build step.&amp;nbsp;I have two versions of jlink scripts. The first flashes both internal and external flash parts. The second one only flashes the external part.&lt;BR /&gt;The reason that I have two scripts is an attempt to see what I can get to work by flashing both or just the external in the post-build step.&lt;/P&gt;&lt;P&gt;The ideal situation is to be able to flash both flashes myself in post-build, and just have the debugger load symbols and run (by *unchecking* the "Load Image" box on the "Startup" tab). But this does not work. When it runs, the code goes into the weeds every time when I do this.&lt;/P&gt;&lt;P&gt;So instead, I flash either one or both flashes in post-build and then allow the debug configuration to re-flash the internal one again (by *checking* the "Load Image" box on the "Startup" tab). This appears to work for some unknown reason.&lt;/P&gt;&lt;P&gt;Interestingly, I can flash both flashes using the same batch and jlink files on a command line and run the device, so I am fairly confident that there is nothing wrong with the flash script. Although after flashing it, I then perform a reset.&lt;/P&gt;&lt;P&gt;Here is the version for flashing both internal and external flashes. The one that only does the external one is identical without the first loadbin. The way that the external flashing works is that we load the image into upper RAM and a flashing utility into lower RAM and let it run.&lt;/P&gt;&lt;P&gt;The batch file sets up this config:&lt;/P&gt;&lt;P&gt;set JLINK_ARGS=-ExitOnError 1 -device MK81FN256XXX15 -if JTAG -speed 4000 -jtagconf "-1,-1" -autoconnect 1&lt;BR /&gt;set JLINK_COMMAND_SCRIPT=-CommanderScript %SCRIPT_PATH%&lt;BR /&gt;%JLINK_PATH%\JLink %JLINK_ARGS% %JLINK_COMMAND_SCRIPT%&lt;/P&gt;&lt;P&gt;The jlink script is this:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;RSetType 3&lt;BR /&gt;r&lt;/P&gt;&lt;P&gt;loadbin C:\xxx\internal_firmware_image.bin, 0x0000&lt;/P&gt;&lt;P&gt;loadbin C:\xxx\external_firmware_image.bin, 0x20000000&lt;BR /&gt;loadbin C:\yyy\tools\qspi_192K.bin, 0x1FFF0000&lt;BR /&gt;wreg msp, 0x20030000&lt;BR /&gt;wreg psp, 0x20030000&lt;BR /&gt;setpc 0x1fff0400&lt;BR /&gt;halt&lt;BR /&gt;exit&lt;/P&gt;&lt;P&gt;I should note that in post-build, before running the flashing batch file, we run another batch file that calls a python script to process the axf/elf file into two binary files, and it is these files that get flashed into the two flash parts.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2023 18:48:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-use-my-own-flashing-script-in-MCUXpresso/m-p/1757812#M65706</guid>
      <dc:creator>RogerDavisWork</dc:creator>
      <dc:date>2023-11-15T18:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use my own flashing script in MCUXpresso</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-use-my-own-flashing-script-in-MCUXpresso/m-p/1767685#M65749</link>
      <description>&lt;P&gt;If you want to program multiple binary files, you can do this directly in the debugger/gdb commands/settings, e.g. see&lt;/P&gt;&lt;P&gt;&lt;A href="https://mcuoneclipse.com/2022/11/01/loading-multiple-binary-files-with-gdb/" target="_blank"&gt;https://mcuoneclipse.com/2022/11/01/loading-multiple-binary-files-with-gdb/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Additionally, if you want to do low level stuff, you can do this with the J-Link Script files: &lt;A href="https://wiki.segger.com/J-Link_script_files" target="_blank"&gt;https://wiki.segger.com/J-Link_script_files&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The script can be passed in the MCUXpresso IDE here:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ErichStyger_0-1701533543887.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/252683i97D53AFE583CB7EA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ErichStyger_0-1701533543887.png" alt="ErichStyger_0-1701533543887.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;</description>
      <pubDate>Sat, 02 Dec 2023 16:12:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/How-do-I-use-my-own-flashing-script-in-MCUXpresso/m-p/1767685#M65749</guid>
      <dc:creator>ErichStyger</dc:creator>
      <dc:date>2023-12-02T16:12:31Z</dc:date>
    </item>
  </channel>
</rss>

