Author Topic: How bloody hard can it be to program an AVR chip?  (Read 56422 times)

0 Members and 1 Guest are viewing this topic.

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: How bloody hard can it be to program an AVR chip?
« Reply #25 on: July 13, 2013, 11:52:48 pm »
As I said later, I wrote a script myself to validate the file and it's perfect. Sorry, but I think you're doing something wrong on your end, this is perfect Intel HEX format that AVR Studio should accept without complaint.
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 37661
  • Country: au
    • EEVblog
Re: How bloody hard can it be to program an AVR chip?
« Reply #26 on: July 13, 2013, 11:53:49 pm »
You can right click on the RAW button and save as to get the hex file. Stupid way to distribute that kind of file. Dave has probably been trying to program the HTML from the page.

Ok, this sounds plausible, I didn't know this, I do not use github.
Will have to try again.
If that's the case, then I agree, it's a completely stupid way to distribute the files. If I fell for this, countless others can too.
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: How bloody hard can it be to program an AVR chip?
« Reply #27 on: July 13, 2013, 11:56:07 pm »
Absolutely. That's different, though. If your code depends strongly on a specific version of a library, then that library is part of your program, and you should be responsible for it. But built code from your own software? No, that shouldn't be in the source tree.

If that's the case, then I agree, it's a completely stupid way to distribute the files. If I fell for this, countless others can too.

It is stupid. Links to files in the VCS tree are not an appropriate way to distribute code. GitHub's for developers, not users.
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11790
  • Country: us
Re: How bloody hard can it be to program an AVR chip?
« Reply #28 on: July 13, 2013, 11:56:11 pm »
I should not have to learn it
I should not have to write a script
I should not have to convert formats

You should not have to know how to use a DMM
You should not have to know how to use a scope
You should not have to know how to substitute one chip for another
...

Sometimes your required knowledge domain expands.
You can't box yourself in.

Opening up a HEX file in a text editor to see if it looks like a HEX file is an elementary troubleshooting operation.
Stop acting helpless!
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: How bloody hard can it be to program an AVR chip?
« Reply #29 on: July 13, 2013, 11:58:36 pm »
HEX files are literally that: just hex, with some additional formatting characters. You don't know Python, but I only used it because it's my usual chosen language for quick scripts. Surely you know something that could be used to pick out only characters [0-9a-f] from a file and dump them back out in a different format? Hell, it's a trivial task in C. For that matter, in Linux/Unix you could do it at the command line with nothing but "sed"...
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 37661
  • Country: au
    • EEVblog
Re: How bloody hard can it be to program an AVR chip?
« Reply #30 on: July 13, 2013, 11:59:09 pm »
Stupid way to manage a software project that's indicative of people with no real software experience. The hex file is a build product, it shouldn't be stored in the version control tree, which is only for source. It should be generated from the source by the Makefile, which should have a build target to prepare .zip and .tar.bz2 packages for distribution. These should be offered from a home page somewhere for direct download.

Unless I missed it, the HEX file is not available elsewhere, and Makerbot point you to this page when you go looking for the HEX files.
If this is the issue then Makerbot really need to fix this and make it easy and idiot proof for people to reflash their Makerbots if need be.
As far as I knew, I was doing everything right. I found the official page that has the firmware and .HEX builds, I found the file structure, I right clicked and downloaded the file and it stored as .HEX file which I then tried to use using the official AVR tools.
 

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 37661
  • Country: au
    • EEVblog
Re: How bloody hard can it be to program an AVR chip?
« Reply #31 on: July 14, 2013, 12:00:18 am »
HEX files are literally that: just hex, with some additional formatting characters. You don't know Python, but I only used it because it's my usual chosen language for quick scripts. Surely you know something that could be used to pick out only characters [0-9a-f] from a file and dump them back out in a different format? Hell, it's a trivial task in C. For that matter, in Linux/Unix you could do it at the command line with nothing but "sed"...

You don't get, I shouldn't have to resort to that. The whole idea of anyone having to do that is just retarded.
It should be download hex file, program, the end.
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: How bloody hard can it be to program an AVR chip?
« Reply #32 on: July 14, 2013, 12:02:35 am »
On a slightly different note: What is with all these people who can't write a goddamn bootloader? Seriously, IIRC Dave bricked it by trying to update the firmware! That. Should. Not. Be. Possible!! Everyone who's thinking of sticking a microcontroller in your product? Take note. There should be nothing, nothing, nothing that you can do without opening the case that requires opening the case to fix.

Even if I pull the goddamn plug halfway through a firmware upload, when I boot it back up, it should be at least alive enough to redownload the firmware over USB or whatever it uses.
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 37661
  • Country: au
    • EEVblog
Re: How bloody hard can it be to program an AVR chip?
« Reply #33 on: July 14, 2013, 12:03:28 am »
Opening up a HEX file in a text editor to see if it looks like a HEX file is an elementary troubleshooting operation.
Stop acting helpless!

Yes, but at the time I had absolutely to reason to believe it was not a valid .HEX file. I downloaded the file and it saved as a .HEX file. I even redownloaded it to make sure it wasn't a corrupted download.
The file being downloaded in .HTML format instead of raw file format never even occurred to me that was possible.
Ok, I should have opened a hex editor and checked it, but I knew that I wouldn't know what I'd be looking at anyway in terms of HEX file format anyway if I did that. Ok, I'm stupid expecting shit to just work, my fault.  :-[
« Last Edit: July 14, 2013, 12:06:21 am by EEVblog »
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11790
  • Country: us
Re: How bloody hard can it be to program an AVR chip?
« Reply #34 on: July 14, 2013, 12:04:11 am »
You don't get, I shouldn't have to resort to that. The whole idea of anyone having to do that is just retarded.
It should be download hex file, program, the end.

Makerbot is (IMHO) not a commercial retail product, it is a geeky hobby user product. You should expect to be a techy person before you even go near it...
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: How bloody hard can it be to program an AVR chip?
« Reply #35 on: July 14, 2013, 12:06:25 am »
With all due respect, the fact that AVR Studio wouldn't accept it should have made you immediately look at the file contents, but instead, you just went ranting about this damn software, as you tend to do. In my experience, you are very prejudiced against open source software. Any time there's OSS anywhere near what you're trying to do, it immediately takes the blame.

If your probes are in the wrong socket in your multimeter and you get a probe warning, do you just blame the aftermarket probes? No, you look down.
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 37661
  • Country: au
    • EEVblog
Re: How bloody hard can it be to program an AVR chip?
« Reply #36 on: July 14, 2013, 12:10:54 am »
Makerbot is (IMHO) not a commercial retail product, it is a geeky hobby user product. You should expect to be a techy person before you even go near it...

I agree.
And that's why I thought I'd have no trouble reflashing the chip with my AVRISP. It's not like I'm new to programming micros. But it just went from bad to worse hence, hence my rant.
My view it was a valid hex file was helped by various online posts that said they couldn't get it working either, and resorted to avrdude etc, so I started down the avrdude path and that had it's own set of issues I ran into. Once again, issues that many other people seem to have had as well.
It's one of those example where everything seemed to be going wrong, and I kept pushing in a certain direction.

I'll go back and try the HEX download and avrstudio again and see if it works.
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11790
  • Country: us
Re: How bloody hard can it be to program an AVR chip?
« Reply #37 on: July 14, 2013, 12:11:40 am »
Yes, but at the time I had absolutely to reason to believe it was not a valid .HEX file.

Yeah, look, I'm sorry to beat you round the head with this, but you had the evidence right there in front of you:

I simply cannot get AVRtsudio to read any if the .HEX formats - "unsupported format" error.

If AVRStudio says it's not a valid .HEX format, then chances are it is not a valid .HEX format. At that point you should look inside the file to check.

Yes, I've made similar goofs. We all do from time to time. Sometimes the best thing to do when things aren't working is to stop and reflect on the problem, rather than pressing on.
« Last Edit: July 14, 2013, 12:13:15 am by IanB »
 

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 37661
  • Country: au
    • EEVblog
Re: How bloody hard can it be to program an AVR chip?
« Reply #38 on: July 14, 2013, 12:13:13 am »
With all due respect, the fact that AVR Studio wouldn't accept it should have made you immediately look at the file contents. but instead, you just went ranting about this damn software, as you tend to do.

No, I went online and checked to see if anyone else had the same issue, they did, and that lead me into another direction with using avrdude.

Quote
In my experience, you are very prejudiced against open source software. Any time there's OSS anywhere near what you're trying to do, it immediately takes the blame.

Wrong. I expect simple stuff like this to just work, is that so wrong?
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9889
  • Country: nz
Re: How bloody hard can it be to program an AVR chip?
« Reply #39 on: July 14, 2013, 12:13:24 am »
The problem is caused by an interaction of two things.
1- github providing what looks like a file link but is actually the next webpage in the download process.
2- People doing a right-click/save-as instead of clicking on the link.
(save-as is a browser feature and not part how the internet was designed. Websites expect you to always click links. If it's HTML it loads the page, if it's a file it pops up the download box or starts the download)


But yeah, i agree, it's a stupid way to design a website.
Caught me out once as well.
« Last Edit: July 14, 2013, 12:21:14 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline EEVblogTopic starter

  • Administrator
  • *****
  • Posts: 37661
  • Country: au
    • EEVblog
Re: How bloody hard can it be to program an AVR chip?
« Reply #40 on: July 14, 2013, 12:15:55 am »
Yeah, look, I'm sorry to beat you round the head with this, but you had the evidence right there in front of you:

Yes, I know, I'm an idiot, I admit it :-[
That does not mean I'm not allowed to have a rant about this, because it seems like something that many other people have been caught by too. Including the avrdude and driver issues etc. My rant about these tools stands regardless of the hex file issue.
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8515
  • Country: us
    • SiliconValleyGarage
Re: How bloody hard can it be to program an AVR chip?
« Reply #41 on: July 14, 2013, 12:43:34 am »
i don't understand why they just dont make the firmware image available as a .hex and a .bin , throw both of em in a zip file and done.
all this hoop jumping , clicking links , futzing with github..  deal wath that stuff for the source

the distributable : zip it.
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1198
  • Country: fi
Re: How bloody hard can it be to program an AVR chip?
« Reply #42 on: July 14, 2013, 12:45:20 am »
Now, it's perfectly reasonable to use version control separately for built projects (it's not unusual for entire websites to be inside VCS), but not in a subdirectory of the source code tree, and you certainly shouldn't make your users dick around with the VCS ever, ever, ever.
If the task at hand is looking for a firmware file to reprogram their microcontroller, that is not an unreasonable thing to ask your users.

Offline gxti

  • Frequent Contributor
  • **
  • Posts: 507
  • Country: us
Re: How bloody hard can it be to program an AVR chip?
« Reply #43 on: July 14, 2013, 12:48:42 am »
My view it was a valid hex file was helped by various online posts that said they couldn't get it working either, and resorted to avrdude etc, so I started down the avrdude path and that had it's own set of issues I ran into. Once again, issues that many other people seem to have had as well.
It's one of those example where everything seemed to be going wrong, and I kept pushing in a certain direction.

In the software industry we have a term for that: yak shaving. You start out trying to do something simple but hit a roadblock, then another and another and 10 diversions later you're on the Mongolian steppes shaving a yak.
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11790
  • Country: us
Re: How bloody hard can it be to program an AVR chip?
« Reply #44 on: July 14, 2013, 12:50:14 am »
Yes, the sensible thing is to provide a "system management utility" with a friendly UI that automates the whole process. You fire up the utility and pick from a menu:

1. System diagnostic check
2. System reset to factory conditions
3. etc...

If the system fails the diagnostic check, you can have it automatically download and reset the firmware and get you up and running again.

But that would be the difference between a real product and a technological geek fest.
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: How bloody hard can it be to program an AVR chip?
« Reply #45 on: July 14, 2013, 12:50:28 am »
I don't remember anything about driver issues. I just remember you complaining about not being able to find the EXE (a valid complaint, but Makerbot's fault, they should have pointed you in the right direction, or hell, provided the download), and then about the file format. What was the problem with that?

Now, it's perfectly reasonable to use version control separately for built projects (it's not unusual for entire websites to be inside VCS), but not in a subdirectory of the source code tree, and you certainly shouldn't make your users dick around with the VCS ever, ever, ever.
If the task at hand is looking for a firmware file to reprogram their microcontroller, that is not an unreasonable thing to ask your users.
Bullshit. Yes it is.
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: How bloody hard can it be to program an AVR chip?
« Reply #46 on: July 14, 2013, 12:51:29 am »
If the system fails the diagnostic check, you can have it automatically download and reset the firmware and get you up and running again.

But that would be the difference between a real product and a technological geek fest.

It's not a real technological geek fest if it doesn't have somebody who can write a proper damn bootloader.
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11790
  • Country: us
Re: How bloody hard can it be to program an AVR chip?
« Reply #47 on: July 14, 2013, 12:55:33 am »
It's not a real technological geek fest if it doesn't have somebody who can write a proper damn bootloader.

When you are young, you start with a hypothesis that half the population are idiots.

By the time you die, you have refined that opinion to believe that 95% of the population are idiots.

How are you ever going to find someone to write that bootloader when you only have 5% of the population to choose from?
 

Offline digsys

  • Supporter
  • ****
  • Posts: 2209
  • Country: au
    • DIGSYS
Re: How bloody hard can it be to program an AVR chip?
« Reply #48 on: July 14, 2013, 01:24:03 am »
Quote from: gxti
   You start out trying to do something simple but hit a roadblock, then another and another and 10 diversions later you're on the Mongolian steppes shaving a yak.   
Ahhhhh Yak shaving ... that brings back memories. In later years, I switched to washing ducks, it is a HECK of lot easier.
Hello <tap> <tap> .. is this thing on?
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: How bloody hard can it be to program an AVR chip?
« Reply #49 on: July 14, 2013, 01:32:10 am »
Eh, I don't think people are idiots, but I think anything that requires end users to muck about with development tools is a very poor choice. It doesn't need to be the world's best bootloader, it just needs to not overwrite itself, and do a checksum test on boot. WDT should reset to bootloader in case the update's a dud and the firmware crashes. Obviously if you need to update the bootloader itself things get more complicated, but the point is to make it small and simple so you can avoid doing that.

I shouldn't be so harsh, I don't think they can't write a proper bootloader. It's this common mentality in OSS and, apparently, OSH that the product is never "done". It's always in development stages. Hell, there's more than one quite stable, usable program that I use on my computer whose version number still starts with "0.". These OS* groups really need to set proper release deadlines and prioritize polishing the UI so end users don't have to break out avrdude. It's OK if it has a few bugs if all the user has to do to fix them when you release an update is click a button or two. Releasing bug-free software is impossible, so an emphasis has to be placed on the bug fix mechanism.

Development versions are one thing, but Makerbot's been around long enough to get the bootloader right. I don't think I'm being unreasonable in thinking that should be a high priority, since it's used to fix other bugs.

My method of choice for update releases would be a self-contained EXE file (Windows) or Python script (Linux - easiest way to ensure a common set of GUI components and whatnot, and just about every distro has it preinstalled) with a little information blurb and an "Update" button. Works from any PC plugged into the thing via USB. The Linux one could work on Mac as well with a bit of cross-platform voodoo.
« Last Edit: July 14, 2013, 01:39:29 am by c4757p »
No longer active here - try the IRC channel if you just can't be without me :)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf