Loading ...
Sorry, an error occurred while loading the content.

Download to target

Expand Messages
  • jp.civade
    Hi, I ve seen in make.defs, it s possible to implement a command to download code to target. I m under windows / cygwin, and got stlink installed and running.
    Message 1 of 4 , Jun 2, 2012
    • 0 Attachment
      Hi,

      I've seen in make.defs, it's possible to implement a command to download code to target.

      I'm under windows / cygwin, and got stlink installed and running. Stlink got a command line able to do it with the following syntax :

      "C:\Program Files\STMicroelectronics\STM32 ST-LINK Utility\ST-LINK Utility\ST-LINK_CLI.exe" -c SWD -p ${project_name}.hex -w32 -Run

      Now, the Question:

      Hown to implement the DOWNLOAD command in make.defs?

      Thanks for reading!
    • Gregory N
      ... You have to define a macro in Make.defs called DOWNLOAD. There is only one example in the source tree. See nuttx/configs/vsn/nsh/Make.defs: define
      Message 2 of 4 , Jun 3, 2012
      • 0 Attachment
        > I'm under windows / cygwin, and got stlink installed and running. Stlink got a command line able to do it with the following syntax :
        >
        > "C:\Program Files\STMicroelectronics\STM32 ST-LINK Utility\ST-LINK Utility\ST-LINK_CLI.exe" -c SWD -p ${project_name}.hex -w32 -Run
        >
        > Now, the Question:
        >
        > Hown to implement the DOWNLOAD command in make.defs?

        You have to define a macro in Make.defs called DOWNLOAD. There is only one example in the source tree. See nuttx/configs/vsn/nsh/Make.defs:

        define DOWNLOAD
        @armst /dev/ttyUSB0 nuttx.srec
        endef

        So yours would be something like:

        define DOWNLOAD
        @ST-LINK_CLI.exe" -c SWD -p nuttx.hex -w32 -Run
        endef

        Assuming that C:\Program Files\STMicroelectronics\STM32 ST-LINK Utility\ST-LINK Utility\ is in your PATH.

        You would perform the rebuild and download by:

        make download

        Greg
      • jp.civade
        Cool, thanks!
        Message 3 of 4 , Jun 3, 2012
        • 0 Attachment
          Cool, thanks!

          --- In nuttx@yahoogroups.com, "Gregory N" <spudarnia@...> wrote:
          >
          > > I'm under windows / cygwin, and got stlink installed and running. Stlink got a command line able to do it with the following syntax :
          > >
          > > "C:\Program Files\STMicroelectronics\STM32 ST-LINK Utility\ST-LINK Utility\ST-LINK_CLI.exe" -c SWD -p ${project_name}.hex -w32 -Run
          > >
          > > Now, the Question:
          > >
          > > Hown to implement the DOWNLOAD command in make.defs?
          >
          > You have to define a macro in Make.defs called DOWNLOAD. There is only one example in the source tree. See nuttx/configs/vsn/nsh/Make.defs:
          >
          > define DOWNLOAD
          > @armst /dev/ttyUSB0 nuttx.srec
          > endef
          >
          > So yours would be something like:
          >
          > define DOWNLOAD
          > @ST-LINK_CLI.exe" -c SWD -p nuttx.hex -w32 -Run
          > endef
          >
          > Assuming that C:\Program Files\STMicroelectronics\STM32 ST-LINK Utility\ST-LINK Utility\ is in your PATH.
          >
          > You would perform the rebuild and download by:
          >
          > make download
          >
          > Greg
          >
        • jp.civade
          Final notice with proper options : For flashing within cygwin for STM32 plateform, with a make download command: Add a block in make.defs (ie: after the
          Message 4 of 4 , Jun 5, 2012
          • 0 Attachment
            Final notice with proper options :

            For flashing within cygwin for STM32 plateform, with a  "make download" command:

            Add a block in make.defs (ie: after the define CLEAN for example):


            define DOWNLOAD
                @"C:/Program Files/STMicroelectronics/STM32 ST-LINK Utility/ST-LINK Utility/ST-LINK_CLI.exe" -c SWD -p nuttx.hex -Q -Rst
            endef


            Assuming here:

            * You've installed STM32 ST link utility
            * Installation is done in the standard path
            * No need to add stlink to path
            * You've properly updated it if necessary (be careful with latest STM32F4 Discovery, because CPU mask rev Z is not properly supported.... you've got to patch stlink, see st forums)
            * Flashing will be done in quiet mode (no progress bar)

            The board will be resetted at the end of upload, so your program will run automatically (-Rst).


          Your message has been successfully submitted and would be delivered to recipients shortly.