Writing firmware in Linux

Post Reply
wi7s
 

Posts: 5
Joined: 07 Feb 2024, 06:47

Writing firmware in Linux

Post by wi7s »

I just finished assembling the logic board and wanted to upgrade the firmware before starting work on the RF board. Since I only use Linux I had to figure out how to update the firmware, and my preference is to use the command line. Here's what I ended up doing, hopefully it is helpful for other Linux users.

1. Download the firmware HEX file as usual using the serial number & your call sign
2. In a command line window, change your current working directory to where-ever you downloaded the firmware HEX file, then issue the command

avrdude -c arduino -p m328p -P /dev/ttyUSB0 -b 115200 -U flash:w:"WI7S_truSDX_123456789A1234556_Firmware.hex":a

You should replace your exact HEX file name above, and the tty port device name. BTW, that's all in one line, no newline after the -U option.

To find out which device name Linux assigns to the USB-to-serial device, you can just do

ls /dev/tty*

It's probably the last one on the list. If there is confusion, you can do the ls command before and after plugging in the truSDX, the difference will show you which device name to use. The avrdude command is part of the Arduino package, so you'll need to install Arduino before this.

I did not have to install CH340 drivers, seems like they are included in the Linux kernel, at least it was in my Debian 10 system! I got my kit from amazon and the bootloader was already installed so I did not have to do that step.

73, ilkka wi7s
k4djg
 

Posts: 3
Joined: 11 Aug 2023, 11:45
Location: New Marrket, Va

Re: Writing firmware in Linux

Post by k4djg »

A quick question. If I cut and paste the command, it comes up as two lines, so I need to know if there is a space after the -U as the copy shows, or no space? I plan to edit the command to my needs and save it for later use. de K4DJG
wi7s
 

Posts: 5
Joined: 07 Feb 2024, 06:47

Re: Writing firmware in Linux

Post by wi7s »

Yes, I had a space after the -U

The forum seems to format the command better when I shorten the name of the hex file:

avrdude -c arduino -p m328p -P /dev/ttyUSB0 -b 115200 -U flash:w:"myfile.hex":a

73, ilkka wi7s
ON5VC/p
 

Posts: 1
Joined: 21 Mar 2024, 07:10

Re: Writing firmware in Linux

Post by ON5VC/p »

Thank you,
You are a genius :-)
Post Reply

Users browsing this forum: No registered users and 8 guests