简体   繁体   中英

Is programming using the Arduino IDE suitable for commercial products?

I need to program a microcontroller in such a way that I EXACTLY know what it will be doing, because it is for a project that requires high levels of reliability (similar to automotive products).

I know my way around in C (started 9 years ago) so ideally I would code everything myself using the ATMEL official framework, compile it with AVR-GCC and burn the EEPROM with AVRDude. There is also the method of uploading the .hex to the bootloader already burned to avoid using an in circuit programmer (done by Arduino). No surprises.

However, the framework is -obviously- very low level. I don't really have the time to manipulate the registers directly every time I use an ADC or send data on the USART (actually more prone to error). So I thought the Arduino library can't be unreliable given all the time it's been out there (it has the C++ syntax but why not).

But actually, if I'm going to use the Arduino libraries, what is wrong with using the entire Arduino IDE for a commercial product? What does programming via the Arduino IDE hide (to make it simpler for the users) that makes it "not trusted" for commercial applications? Or is it a myth?

The libraries of Arduino are effective but not efficient. They where developed for users with little knowledge of hardware or software.

For example, take a look at the hardwareSerial.cpp module and see it uses internal loops for sending data, instead of using serial interrupts. This blocks your sketch until it finishes sending data.

Like this example there are some more, and are the reason why i program my own libraries most of the time.

Totally give up the idea that using Arduino lib in a commercial products. Not only because it's in-efficiently, but also because the Thread Safety is not guaranteed. For example, some variables and data-structures (queue) are not protected from ISR context to main context, which may cause data integrity issue or even random Hard Fault. Although the probability is low, you should still give up the idea unless the quality of your products is not important.

On the other hand, low efficiency means you have to pay more hardware budget on the processor, also make it improper in commercial products.

People like Arduino because they want a rapid developing. If you write an solid framework yourself you will be able to develop products fast, also solid.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM