Arduino distributable program file - arduino

Similar to an .exe file, is there a way to make a 'distributable' of an Arduino program? Some sort of ready-to-upload file... I'd like to share the program but the code should be kept the most secret as possible, or at least make it hard to know.

You can distribute the .hex binary file, and then let the users upload the binary on the Arduino themselves.
The ordinary Arduino IDE already does that for you when you click on the button verify & upload, so you simply have to take the generated .hex file and give it away.
Or you can use Arduino Makefile to get your .hex binaries using any other development environment.
Note: even though the source code is not included nor displayed, it is possible to reverse engineer an .hex binary as much as it is possible to do it with an .exe binary.

Related

How to "make and program" my PIC32 without using MPLAB?

I have to find some solution to flash my Program Memory into my PIC32 without MPLab.
I think the first step is to generate the .hex file from the source code.
And the second one, flashing the memory into the PIC.
How can I do it using a standard IDE or command line please ?
(Currently using MPLab, I use the MPLab Snap to flash the program memory)

nodemcu/ESP8266 using Arduino IDE - Firmware?

I guess I'm having a basic understanding issue regarding the nodemcu/ESP8266 when it is used with the Arduino IDE and/or visual micro (for MS Visual Studio).
Everytime I upload a program/sketch which is obviously written in C in this case, it is compiling and uploading a binary of about 280kb, even if it is only a simple "blink" example.
Is it some kind of firmware being uploaded everytime or is it just monsterious libraries needed for the ESP to work with the Arduino IDE?
If it is firmware, do you normally "update" the firmware to a more recent build when working with the Arduino IDE? When using the nodemcu LUA firmware, there are periodic updates.
Thanks!
Basically, you build the firmware, which is a combination of your own code, and lots of other code/libraries.
All the other parts are part of the Arduino ESP8266 core, which does indeed get updates (it lives here: https://github.com/esp8266/Arduino). And it itself contains the Espressif SDK, which also gets updates (https://github.com/esp8266/Arduino/tree/master/tools/sdk).
Like NodeMCU you can get periodic updates, but they are of the core, and the only way to get them into your firmware is to recompile your sketch.
This is completely normal - When writing code for an interpreted language like Lua for the ESP/NodeMCU, you're just uploading what is a relatively small text file(s), as the code needed to run it is already on the chip, and doesn't change.
However, when you start working with compiled languages like C (With the Espressif SDK only, for example), or C++ with the Arduino IDE, you are replacing the entire firmware each time your code changes. This includes the TCP/IP stack, WiFi management, the logic controlling the PHY/MAC interface, the mini OS, and a host of other bits to make your ESP8266 work. Even if your code appears to be just a simple "blink" sequence, there's a lot of code running behind the scenes to make it possible, leading to the large sketch size.
Generally, every change to your sketch code will produce a complete copy of everything needed to create a bootable, runnable binary for the ESP8266. This is what is causing the 280KiB file. Since each copy of your code includes the newest (Or at least whatever is in your IDE at the time) copy of the system level code, there is no separate update process - Each time you upload your sketch, the system code is updated too.
Additionally, there is some extra overhead from the Arduino abstraction on the Espressif SDK, leading to a larger resulting binary size.

Writing to flash ROM for an embedded OS on atmega328p (h8write equivalent for avr)

I'm currently reading a Japanese book on embedded OS/RTOS es except that I am not using the recommended hardware as I already had a seeeduino microcontroller.(atmega328p) The book is about KOZOS "12 steps to making your own embedded OS" by Sakai Hiroaki(It's hiro-something)
I'm stuck at the part where I need to write into the flash ROM of the atmega328p because the author is using a different chip called H8. He uses a software called h8write and uses that in his OS, but I honestly have no idea what is going on at this point, and what the avr replacement for h8write would be. I've looked around to no avail as there is minimal documentation on what h8write does aside from the "it helps you write to flash ROM" that shows up in the book.
This is the first time I'm doing lower layer stuff and it's frankly terrifying...
I'm using ubuntu 14.04 if that helps.
If I understand correctly, the h8write program is supposed to run on your computer and transfer the compiled to the microcontroller. You are using a seeeduino, which is an Arduino compatible board, with Ubuntu. The standard way of programming on this environment is with the arduino software:
install the arduino package (sudo apt-get install aruino)
type the command arduino from a terminal emulator: this brings an IDE where you can type your code
connect the seeeduino to an USB port
click on the button with a right-pointing arrow: this will take care of everything (compiling, linking and uploading to the seeeduino)
Once you are comfortable with this workflow, you can try to get your hands dirty with low-level stuff. The Arduino IDE is built on top of smaller utilities like avr-gcc, avr-libc, avr-as and avrdude. Avrdude is the program used to transfer the compiled program to the Arduino/seeeduino, i.e. write to the flash. You can use these utilities directly, from the command line. This is however complicated by the fact that you will need to pass many command-line arguments, so I recommend you automate the process using a Makefile. Thankfully there is a generic Arduino Makefile available that makes this quite easy:
install the generic Arduino Makefile: sudo apt-get install arduino-mk
read the instructions in the comments at the top (the Makefile is at /usr/share/arduino/Arduino.mk)
write your own project-specific Makefile as per these instructions
type make to compile your program
type make upload to upload to the seeeduino (i.e. write the flash).
This application note tells you how to write the flash memory during program run.
A very good tutorial on how to use the PROGMEM attribute in AVR microcontrollers can be found here

How to make an Arduino file into an executable .exe

I have an arduino file, which has a .ino extension. Is there a way to make this into an executable file with .exe extension? I want to be able to call it to execute from a TCL program.
EDIT:: Or, how would one run an Arduino .ino file from a TCL program?
You seem to be misunderstanding what the Arduino is about. The code in your .ino file gets uploaded to and executed on the Arduino microcontroller. The code does not run (execute) on the computer where you write your code.
If you want to communicate with the Arduino from your PC, you would typically do it through a serial or wifi connection. Do some searches on that (if that is what you are trying to do). There is a great deal of information and tutorials on that.

Android USB Accessory JAR copy to system folders, does it need the odex file too?

I am trying to get my phone to accept USB Accessory mode and run the DemoKit connected to the Arduino ADK. My ROM did not contain the appropriate files so, I decided to do it myself.
First the specs
My phone: Samsung GT-I9100
My ROM: 2.6.35.7-I9000XWJVZ (rooted)
Firmware: 2.3.6
I've succeeded before in copying the .jar .odex and .xml file to the appropriate folders. Although it completely bricked my phone and was stuck in a boot loop. Now, recovered, I want to give it a second try.
What is this .odex file that every other .jar file has in the /system/framework folder?
Do I need to build/copy the .odex file myself (read something that Dalvik does JIT compiling)?
Is it possible that in my previous attempt, the copying of the .odex (that I got from another phone I9100), bricked mine?
I know I was careless in my previous attempt. Now, I want to approach the subject with a bit more knowledge...

Resources