AT for commercial use - how to archive this without getting sued? - Page 1
Forum section: electronics / general

author: Flunze
author_rank: Regular Contributor
timestamp: August 20, 2020, 02:24:40 pm
content: Hello, as a private project, I want to develop something for the IT company that I am working on. It requires very little horsepower, so almost any ATtiny or ATmega will do. Arduinos from china are supposed to be unreliable, and since they are also some sort open source hardware, it could also be very problematic, to not get sued.So I was wondering, if the AT controllers could be programmed without the Arduino IDE, which also requires proper licensing, which costs a lot of money.There are other programmers out there, but I cannot see anything, that seems to be unregulated enought, to be used for this purpouse. Also, I do not know, what kind of hardware is required and can legally be used.It is impossible to require buying licenses and also impossible to require a public release of the code for free use.And this is, where I am totally confused and have no Idea, what to do. I am NOT asking for a 1:1 tutorial. I am just asking for:- What hardware to interface between an unflashed ATtiny/ATmega and a PC? If possible something that allows easy programming via header, if possible also to programm multiple chips at once (but that is not a requirement at all)- What software can be used, to assemble the C code to flash the controller?That basically is all I have to ask here. Everything else will come, when I have an answer to that.Just remember: The solution needs to be 100% legal and license free and NOT open source of course. In the IT industries it is mandatory to keep the function of this secret. It is not the lazyness, why I ask here. It is, because I need professional people, who absolutely know, what they are doing to verify, that what I am planning is totally backed up by law. I will likely find many tutorials that somewhat help me to the right direction, but I cannot trust them - especially, since many require Arduino IDE or even an Arduino itself. That is just out of question. It needs to be legal from the ground up.If any results come out, which are not related to my company (maybe a diy-programmer circuit that can be used without licenes at all, I will release this to the net, since it does not harm the project I am planning to do)Thank you all! <3

author: agehall
author_rank: Frequent Contributor
timestamp: August 20, 2020, 02:38:57 pm
content: Just whip up your own board with the MCU you need and use the vendor's tools to develop for it. Or use free GNU toolchain for the architecture of your choice.I don't think stuff you develop using Arduino per se cannot be proprietary but the Arduino ecosystem is full of libraries with varying licenses that might get you into a bad place. If you want to be in total control you are pretty much left to doing all the heavy lifting on your own. Should not be too difficult on the type of device you seem to be looking for.Sorry if I'm not very specific here but to be perfectly honest, I don't think this is as hard as you might think it is. There are numerous reasons why I wouldn't put arduino stuff in a commercial/proprietary product but virtually none of them are the concerns you mention.As for programming the devices, check the datasheet for any device you are interested in and it should tell you what protocol the device expects. From there it is trivial to find a programmer you can use. (Unless, of course, the vendor directly provides this info on the info pages for the MCU in quesiton)

author: Ian.M
author_rank: Super Contributor
timestamp: August 20, 2020, 02:49:04 pm
content: https://www.arduino.cc/en/Main/FAQ#toc10states what you can and cant do with Arduino 'stuff' in a commercial product. Assuming you are designing your own board from scratch, the only odious bit is that "The LGPL does, however, require you to make available object files that allow for the relinking of the firmware against updated versions of the Arduino core and libraries" which you probably don't want to do.You can throw out the whole Arduino toolchain including all 'tainted' libraries and program your AVR 'bare metal from the command line using AVR-GCC and AVR-LibC, flashing the chip with any AVRDUDE supported programmer. If you want it wrapped up in an IDE, Atmel Studio is still around, or you could try wrestling with a recent version of MPLAB X and AVR 'flavoured' XC8#. Check in the actual IDE after selecting your AVR for its programmer support list.There's no need to go off the beaten path with a DIY programmer as Chinese clones of various Atmel ones are as cheap as chips. If you are desperate to get going yesterday, an Arduino running the ArduinoISP sketch and six M-F Dupont jumper wires (or five F-F and one M-F) is sufficient to get started with AVRDUDE.# Check the XC8 licence. AFAIK it still permits commercial use in free mode. OTOH its free mode is known for generating bloated binaries as Microchip make you pay for optimization (and support).

author: newbrain
author_rank: Super Contributor
timestamp: August 20, 2020, 04:37:33 pm
content: If you want to go for a commercial product, and making the SW open (or partially open) is not an option, the Arduino framework is automatically out of the picture, as are the most part of the Arduino library you find on the net (they are mostly LGPL or straight GPL).So, you probably have to go bare-metal, which for simple ATmega or ATtiny controllers is not a big deal.As a development environment, you have a number of choices:Go commando - your favourite text editor, makefiles and AVR-gcc.Not as difficult as it seems, you could e.g. use VS Code and live mostly in it also for compilation. But read below for a better option.Use Atmel Studio or that other Microchip thing - See Ian.M post.I would have a serious look atPlatformIO.It is a add-on for VS Code (and other serious editors), that makes it easy to compile/build embedded programs.Given a board/MCU definition, it will download the necessary tools and create a suitable project.It also supports the Arduino framework, but you are not forced to use it.The tool itself is under Apache license, though this is not really important for you: you are not probably going to modify it!There are also other options, e.g. Visual Studio (but the Community Edition might not be OK for your use) + VisualGDB (paid add-on), and probably many I don't know/care about...The only license obligations to be complied to are the ones for the vendor provided include files, for ATmega a slightly modified 3-clause BSD so no problems at all, and for the libraries you intend to use: avr-libc is also BSD, any other you need to check!In the perspective of a non-FOSS product:Good: Apache, BSD, MIT, public domain, WTFPLBad: GPL, LGPL, Affero, some less common ones...Ugly: Any proprietary one.Note:IANAL, TINLA, though I had a lot of exposure to licenses (and complying to them) in my job, as a FOSS product owner.

author: rstofer
author_rank: Super Contributor
timestamp: August 21, 2020, 12:16:19 pm
content: I used to spend a lot of time with the ATmega128 using the GCC tools under Linux. The editor was unimportant but today I would use 'geany'.Keep one terminal open for the editor and another to run 'make' with optional targets like 'make clean' or 'make program'.I'm not sure I would use GNU <anything> for a commercial project. The licensing would make my head explode. Instead, I would use the chip manufacturer's toolchain and let them deal with licensing. Either that or buy a commercial toolchain but this gets expensive.You could do most of the code development using whatever toolchain seems most helpful and then port it to a vendor's tools. What I wouldn't do is use 'open source' <anything> for a commercial project.

author: Psi
author_rank: Super Contributor
timestamp: August 21, 2020, 01:32:47 pm
content: All you need is- An ATmega/ATtiny microcontroller suitable to run C code (Don't get one of the small ATtiny's without any RAM)- A 100nF decoupling capacitor on the IC from VCC to GND- Download of Atmel Studio IDE (Free)- Some sort of compatible AVR programmer. (i'm not up to date on what cheap options exist. I got my AVRISP MK2 for like $40)Connect up GND VCC MOSI MISO SCK and RESET from programmer to the chip and you should be ready to write some code and upload some firmware to the chip.Quote from: Flunze on August 20, 2020, 02:24:40 pmThe absolute cheapest option is if you have an old computer with a LPT printer port and install Windows XP 32bit on itThen look up the connections for a BSD AVR printer port programmer. It's simple wires from LPT port to the ATmega/tiny programming pins. (Series resistor optional but recommended)However, i recommend paying like $50 for a proper USB programmer

author: newbrain
author_rank: Super Contributor
timestamp: August 21, 2020, 02:48:21 pm
content: Quote from: rstofer on August 21, 2020, 12:16:19 pmThe world of licensing is strange and complicated, both for FOSS and proprietary SW.GNU software is used routinely to develop commercial, closed source, application, as you probably experience every day all around you (I think nowadays more than half of our SW is compiled by gcc).One needs to tread carefully, though.The GNU compiler tools ('gcc') bring a specific exception to the GPL V3, to allow for distribution of "System libraries" (e.g. libgcc) without the need to convey the source to the recipient of the SW.This does not give a blanket permission for the linked libraries, which need to be evaluated, e.g., for a hosted application: libc is LGPL V2, so you are fine with dynamic linking, but not with static linking (this is a bit of a simplification).In the embedded world, there's the fattish newlib and its slimmer sibling newlib-nano, distributed under permissive licenses (dynamic linking is not really a thing for embedded).If you trust the chip vendor for licensing your SW and don't read the fine print, you might have some 'interesting' surprise.Would you be able to quickly point out, as an example, if you have the right to distribute SW built with NXP Redlib?This is an easy one - there's an explicit clause - yes.Can you distribute, with an Open Source license, some SW that includes the ST HAL or code generated by CubeMx?The answer is a clear 'maybe': for sure, I would not dare make it GPL, reading their "Ultimate Liberty license SLA0044" (though I see many examples of such on the web...).Probably, using and distributing it with a non-viral, non copyleft license is fine (e.g. MIT/BSD - maybe Apache, but I would need to study).

author: amyk
author_rank: Super Contributor
timestamp: August 21, 2020, 11:35:44 pm
content: I bet a ton of people just enable the code protection bits, and no one would care.

author: sleemanj
author_rank: Super Contributor
timestamp: August 21, 2020, 11:53:47 pm
content: Code:I'm not sure I would use GNU <anything> for a commercial project.Err, the AVR tool chain is Gnu. Indeed, same applies for Microchip's Arm offerings.https://www.microchip.com/mplab/avr-support/avr-and-arm-toolchains-c-compilers

author: westfw
author_rank: Super Contributor
timestamp: August 22, 2020, 07:16:17 am
content: Quoteavr-libc uses a permissive, non-gnu license.

author: newbrain
author_rank: Super Contributor
timestamp: August 22, 2020, 09:19:18 am
content: QuoteAs I said in my first answer to the OP:Quote

author: Flunze
author_rank: Regular Contributor
timestamp: August 29, 2020, 11:31:37 am
content: I am currently looking into MPLAB X IDE. This tool could solve the issue. However this adds additional work, because there are no libraries included. But this was expected.It seems, that the documentation of the AT family (each chips documentation) gives enougth information to get started. I am looking into ATtiny84A at the moment, which looks very promising.

author: 2N3055
author_rank: Super Contributor
timestamp: August 29, 2020, 11:41:51 am
content: Look at Codevision AVR. Very inexpensive tool, chock full of libraries..

author: NivagSwerdna
author_rank: Super Contributor
timestamp: August 29, 2020, 11:50:39 am
content: Quote from: Flunze on August 20, 2020, 02:24:40 pmI think you need to be more specific... End user programming (so probably via USB) or your own production programming which could use a programming header, TagConnect or Pogo pins?FWIW to date I have found Chinese knock off Unos to be reliable but counterfeiting seems to have exponentially increased recently... even with an Uno you don't need Arduino... just program it bare metal, however it does sound like spinning your own board is the way forward and your choice of uP should be influenced by what you need... timers, GPIOs, ADCs, DACs, CAN, RTC etc...

author: westfw
author_rank: Super Contributor
timestamp: August 29, 2020, 08:57:12 pm
content: QuoteHuh? I'm pretty sure that MPLABX/XC8 uses exactly the same libraries (and basically the same compiler) as Atmel Studio. (avr-gcc, avr-libc, etc.)