Under Linux, you'd probably use avrdude
to program them. It supports most programmers and most AVR chips. The main thing to watch out for, is that I think you need to use avr-objcopy
to extract the data from the 'ELF' binary files, you can't program the 'ELF' directly with avrdude.
Random googling for avr-objcopy / avrdude commandlines comes up with this, which looks like it might work:
# create demo.bin from demo.elf
avr-objcopy -j .text -j .data -O binary demo.elf demo.bin
# program demo.bin to the 'flash' memory in an 'atmega128' chip,
# using a 'stk200' programmer connected to the 'lpt1' port on your computer
avrdude -p atmega128 -c stk200 -P lpt1 -U flash:w:demo.bin:r
I'd say you're dreaming. The main problem will be the limited RAM.
In 2004, Eric Beiderman managed to get a kernel booting with 2.5MB of RAM, with a lot of functionality removed.
However, that was on x86, and you're talking about ARM. So I tried to build the smallest possible ARM kernel, for the 'versatile' platform (one of the simplest). I turned off all configurable options, including the ones that you're looking for (USB, WiFi, SPI, I2C), to see how small it would get. Now, I'm just referring to the kernel here, and this does not include any userspace components.
The good news: it will fit in your flash. The resulting zImage is 383204 bytes.
The bad news: with 256kB of RAM, it won't be able to boot:
$ size obj/vmlinux
text data bss dec hex filename
734580 51360 14944 800884 c3874 obj/vmlinux
The .text segment is bigger than your available RAM, so the kernel can't decompress, let alone allocate memory to boot, let alone run anything useful.
One workaround would be to use the execute-in-place support (CONFIG_XIP), if your system supports that (ie, it can fetch instructions directly from Flash). However, that means your kernel needs to fit uncompressed in flash, and 734kB > 700kB. Also, the .data and .bss sections total 66kB, leaving abut 190kB for everything else (ie, all dynamically-allocated data structures in the kernel).
That's just the kernel. Without the drivers you need, or any userspace.
So, yes, you're going to need a bit more RAM.
Best Answer
A journaling filesystem is less prone to corruption, so ext4 is used, still it is not 100% safe. By default in raspbian you have option flags in fstab, that upon power up, it does a filsystem check and repairs corrupted SD card.
Well there are lot of UPS boards, but many of them are useless, they just invoke
sudo shutdown -h now
script at detected power outage and the capacitors supply the board for few seconds. But if you reconnect the power before the capacitors are drained out, then the board won't start again automatically.A good UPS has to have an additional MCU that handles the correct sequence. For example the Beaglebone has an standalone PMIC, but they never thought about to use it correctly. Most of these boards are stamped in millions copies, but they lack of very basic functionality, shutdown sequence.