Skip to main content
Visitor II
October 18, 2019
Question

How to upload Cortex-M4 FW without IDE?

  • October 18, 2019
  • 4 replies
  • 914 views

I'm working with Development Kit and want to upload my Cortex-M4 image but I do not want to use IDE. I assume there should be a Linux program that can stop M4, write image into SRAM and restart M4.

Where can I find a details on how to do it?

Thanks.

    This topic has been closed for replies.

    4 replies

    Explorer
    October 18, 2019

    You can try ST's now-abandoned STLink Utility, or Seggers "JFlash Lite" tool.

    The latter is installed with the Jlink JTAG drivers.

    dimaxAuthor
    Visitor II
    October 18, 2019

    Thanks but this is not good for us.

    We are developing our own board based on STM32MP1. We can not afford keep STLink or JTag on board. We also want to be able to upgrade FW without physical connection to the board, except network of course.

    Architecturally MPU can stop MCU, upload image and start/restart it. Actually this is what it does at boot time. But I can't find the way to change the FW image and force FW reload and MCU restart without reseting the whole board.

    Explorer
    October 18, 2019

    > We can not afford keep STLink or JTag on board.

    You don't need a debug pod (STLink or JLink) on-board. Just the connector, wiring to the JTAG pins.

    > Architecturally MPU can stop MCU, upload image and start/restart it. Actually this is what it does at boot time. But I can't find the way to change the FW image and force FW reload and MCU restart without reseting the whole board.

    So, you basically know already where to look.

    If you want do download new M4 firmware via MPU, there is (IMHO) no way around digging into the datasheets / reference manuals and the existing firmware.

    Technical Moderator
    October 18, 2019
    dimaxAuthor
    Visitor II
    October 18, 2019

    Thanks Patrick. If you say this is the official way to do it I will start looking deeper into it. I was sure there is something more simple.

    One additional question.

    Where the M4 image is stored in the file system and how is it loaded at the boot time?

    My assumption is that the image is stored as a file in known place and U-boot or part of the Kernel is loading it at the boot time and starts MCU. Am I right?

    Technical Moderator
    October 18, 2019

    The firmware components are stored in the file system, by default in the /lib/firmware/ folder.

    see Remote processor boot through sysfs

    The load is done using the kernel.

    uBoot could also be used to have faster M4 startup. See https://wiki.st.com/stm32mpu/index.php/How_to_start_the_coprocessor_from_the_bootloader