From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Flashing A Firmware

Solved!
Go to solution

Hi,

 

I need to install firmware in the flash memory of a microcontroller using LabVIEW and I have no idea how to do that. Are there any tutorials on how to do it. Kindly do help me. Thank You. 

 

0 Kudos
Message 1 of 19
(3,217 Views)

That would depend entirely on what provisions the microcontroller board has made for firmware upgrades in terms of connectivity, protocol, error-checking, etc.

 

There's definitely not 1 universal answer or tutorial to point to.  The solution will require detailed knowledge of your microcontroller hardware.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 2 of 19
(3,214 Views)

The connection is via RS 422 and protocol is UART. 

0 Kudos
Message 3 of 19
(3,139 Views)

UART is not really a protocol... At least not at the level you are interested in.

Usually there is a command line utility that can burn a firmware from a file to a microcontroller (the file is generated from the MC development application in a proper format).

Did you check if such utility is available for your MC? It would be quite easy to use without reinventing the hot water.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 4 of 19
(3,122 Views)

@govindsankar wrote:

Hi,

 

I need to install firmware in the flash memory of a microcontroller using LabVIEW and I have no idea how to do that. Are there any tutorials on how to do it. Kindly do help me. Thank You. 

 


Hmmm... That's a pretty tall order for the lack of information you gave. You do know that every family of micorcontrollers is different and even similar micro's in the same line can have different programming requirements.

 

There must be a program that you are using to program them without LabVIEW.

 

I would dig into that because chances are that program can be called through a command line. (The System.Exec)

 

For instance when you program an Arduino with the Arduino IDE. The Arduino IDE is a Java program that builds a command line and calls "AVR Dude", which is an opensource command line driven Atmel microcontroller flashing program, that actually flashes firmware.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 19
(3,116 Views)

Hi, 

 

I have to flash a firmware using labview. Currently, we are using the STMicroelectronics Flash loader demonstrator. How it works can be seen in the video below. 

 

https://www.youtube.com/watch?v=VDNJUsWvI0o

 

There are many things to do here. Like disable read protection in the beginning, Select protocol and other things, select device, then select hex file, do global erase, the download the new firmware and verify download has happened correctly and finally enable read protection. Now I have to do all these things in LabVIEW. Is it possible. Or should I just use system-exec.VI to open this software, do these things here and then close it and then go back to the labview program. Or is there any other way. Thank You. 

 

 

0 Kudos
Message 6 of 19
(2,849 Views)

Hi govindsankar,

 

why do you think it's a good idea to start a new thread for the very same topic you already started last year?

Please stick with one thread!

 


@govindsankar wrote:

Now I have to do all these things in LabVIEW. Is it possible.


It may be possible if you have a good manual describing all those steps with all needed details and if you have the knowledge to implement all those details with LabVIEW.

 


@govindsankar wrote:

Or should I just use system-exec.VI to open this software, do these things here and then close it and then go back to the labview program.


I guess this will be much easier. Maybe that 3rd party software even supports command line parameters!?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 19
(2,829 Views)
Solution
Accepted by topic author govindsankar

It seems that this should be all very doable with the command line version of the stm flash utility as detailed in section 3 of this document: https://www.st.com/resource/en/user_manual/cd00171488-stm32-and-stm8-flash-loader-demonstrator-stmic...

Rolf Kalbermatter
My Blog
0 Kudos
Message 8 of 19
(2,815 Views)

Thank You. I studied the cmd version and can do using that and system exec.vi. But I just learned how to write the command line version and wrote one program to disable read protection, and it worked. But now my doubt is will it be possible for me to give input from labview to the cmd.exe file of this. For e.g. the enable and disable read protection. Right now my plan is writing two different sets of code, one for enable read protection and the other for disable read protection and use labview to control which code needs to be executed. But that is too much work. Is it possible for me to write just one set of code both for enable and disable and then give an input from labview to that .exe file and depending on the input the .exe file reads from labview it will decide whether to enable or disable. Is this possible. 

0 Kudos
Message 9 of 19
(2,782 Views)

You can do this in many ways. One of the simplest is to generate by code the correct command line depending on the options you want to change.

Then create a .cmd file containing this command line. Finally, run the newly generated .cmd file

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 10 of 19
(2,773 Views)