Answers.Body: <p>Using the micropython REPL interface of the hub I've managed to dump the firmware using the built in tools. This was after I'd updated to <code>v1.0.03.0034-c3879ab</code>. The commands on the hub to achieve this are:</p>
  <pre><code>import firmware
  firmware.flash_read(BYTE_NUMBER)
  </code></pre>
  <p>This will output a 32 bytes of the firmware starting at location <code>BYTE_NUMBER</code> which can be saved to a file. By calling this function repetitively, starting at <code>BYTE_NUMBER=0</code> and going until the function returns <code>false</code>, the entire firmware can be dumped. I couldn't find a way of getting the current firmware length so dumps will contain the full memory of the board (~1Mbyte).</p>
  <p>I've not found any online resources for old versions of the firmware of the SPIKE Prime hub.
  However, the latest firmware seems to be inside the current version of the windows application [<code>SPIKE-PRIME_Full_1.2.0_Global_Win10</code>]. This can be extracted by:</p>
  <ol>
  <li>Installing the SPIKE Prime Windows 10 application.</li>
  <li>Navigating to the resources directory inside the installed directory: [<code>C:/Program Files/SPIKE/resources</code>]</li>
  <li>Creating a directory to hold the extracted source code of the electron application. (E.g. Output)</li>
  <li>Extracting the <code>app.asar</code> file using the <a href="https://github.com/electron/asar" rel="nofollow noreferrer">asar tool</a> and the command <code>asar extract app.asar Output</code>.</li>
  <li>Navigating to the firmware directory found inside the extracted code <code>Output/app/renderer/flipper-hub/firmware/</code></li>
  <li>There you should find a <code>*.bin</code> where its name is the md5 of its contents. (E.g <code>09c1f4564bd22832993332820540d8c1.bin</code></li>
  </ol>
  <p>I compared the firmware I dumped from my hub to the one I found in the SPIKE Prime Windows 10 application and they matched exactly up to the size of the found firmware (it was smaller).  I've uploaded the firmware to my <a href="https://github.com/gpdaniels/spike-prime" rel="nofollow noreferrer">github</a> please feel free to PR more versions.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-09T15:02:48.783Z
Answers.LastActivityDate: 2020-07-09T15:02:48.783Z
Answers.UserDisplayName: gpdaniels
Body: <p>I'm interested in tinkering with the micropython filesystem and/or firmware in the SPIKE Prime hub and was wondering:</p>
  <ol>
  <li>How to dump the firmware from the SPIKE Prime hub?</li>
  <li>Is there an online resource somewhere to download old firmwares for the SPIKE Prime hub?</li>
  </ol>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-07-10T09:04:45.970Z
Comments.Text: That one is the filesystem that is on some flash memory on the board. It's mainly micropython files and sounds. The firmware is the code that runs the microprocessor. You can think of the firmware like the operating system which then runs the micropython scrips in the filesystem.
Comments.UserDisplayName: gpdaniels
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-07-10T09:13:18.277Z
Comments.Text: Sorry, I just saw this question, remembered a similar one from a bit before, found the linked question and raised a duplicate flag. Then I noticed the small but significant differences and thus retracted the duplicate flag but forgot about the auto-added comment. I'll remove it immediately :)
Comments.UserDisplayName: zovits
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-07-10T09:31:55.110Z
Comments.Text: No problem, it might signify that I need to edit the questions to make the differences clearer.
Comments.UserDisplayName: gpdaniels
Tags: <powered-up><spike-prime><micropython><robot-inventor>
Title: How to dump the firmware from the SPIKE Prime (and Mindstorms v4)?
UserDisplayName: gpdaniels
ThreadText: # How to dump the firmware from the SPIKE Prime (and Mindstorms v4)?
  
  (Asked by: username_0 on 2020-07-09)
  
  I'm interested in tinkering with the micropython filesystem and/or firmware in the SPIKE Prime hub and was wondering:
  
  1. How to dump the firmware from the SPIKE Prime hub?
  2. Is there an online resource somewhere to download old firmwares for the SPIKE Prime hub?
  
  **Tags:** powered-up, spike-prime, micropython, robot-inventor
  > **Comments:**
  > **username_0**: That one is the filesystem that is on some flash memory on the board. It's mainly micropython files and sounds. The firmware is the code that runs the microprocessor. You can think of the firmware like the operating system which then runs the micropython scrips in the filesystem.  
  > **username_1**: Sorry, I just saw this question, remembered a similar one from a bit before, found the linked question and raised a duplicate flag. Then I noticed the small but significant differences and thus retracted the duplicate flag but forgot about the auto-added comment. I'll remove it immediately :)  
  > **username_0**: No problem, it might signify that I need to edit the questions to make the differences clearer.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2020-07-09. Score: 2 | Accepted answer
  
  Using the micropython REPL interface of the hub I've managed to dump the firmware using the built in tools. This was after I'd updated to v1.0.03.0034-c3879ab. The commands on the hub to achieve this are:
  import firmware
  firmware.flash_read(BYTE_NUMBER)
  
  This will output a 32 bytes of the firmware starting at location BYTE_NUMBER which can be saved to a file. By calling this function repetitively, starting at BYTE_NUMBER=0 and going until the function returns false, the entire firmware can be dumped. I couldn't find a way of getting the current firmware length so dumps will contain the full memory of the board (~1Mbyte).
  I've not found any online resources for old versions of the firmware of the SPIKE Prime hub.
  However, the latest firmware seems to be inside the current version of the windows application [SPIKE-PRIME_Full_1.2.0_Global_Win10]. This can be extracted by:
  
  Installing the SPIKE Prime Windows 10 application.
  Navigating to the resources directory inside the installed directory: [C:/Program Files/SPIKE/resources]
  Creating a directory to hold the extracted source code of the electron application. (E.g. Output)
  Extracting the app.asar file using the asar tool and the command asar extract app.asar Output.
  Navigating to the firmware directory found inside the extracted code Output/app/renderer/flipper-hub/firmware/
  There you should find a *.bin where its name is the md5 of its contents. (E.g 09c1f4564bd22832993332820540d8c1.bin
  
  I compared the firmware I dumped from my hub to the one I found in the SPIKE Prime Windows 10 application and they matched exactly up to the size of the found firmware (it was smaller).  I've uploaded the firmware to my github please feel free to PR more versions.
  
  
  ---
  
  