Showing posts with label compile. Show all posts
Showing posts with label compile. Show all posts

Tuesday, September 29, 2020

Travis CI and precompiled firmware for OHS 2.x

Over last weekend I've created a Travis continuous integration for OHS 2.x gateway repository. This CI performs a test build on every commit that is pushed to it. What it does is that it verifies that the commit is buildable, and maybe more importantly, it creates new compiled firmware related to every new commit, and places it back in releases section directly in GitHub.

This means that the latest, and also historical firmware are now available for download in https://github.com/vysocan/OHS_2-gateway/releases 

Binary files .bin can be directly used for DFU - Device Firmware Upgrade.

Sunday, May 26, 2019

Remote uplodad and debug

Maybe you have similar setup at home as me. That is you have your OHS gateway close in some storage room along with your home server. I have it, my network panel, my small backup/sharing server (running excellent Open Media Vault), and my OHS gateway sit close to each other. And my desk computer is down one floor. It is rather inconvenient to push upgrades to gateway, one would have to put the code into laptop, go upstairs, take a chair and plug the FTDI programmer in. Each time you make some changes in code. So I have searched and found rather nice solution to this.

I use remote serial over TCP network. My server runs basically a Debian fork and after small search and couple of tries I found a program called socat. Socat can take physical /dev/tty* device and stream it over TCP. My example:

socat tcp-l:1234,reuseaddr,fork file:/dev/ttyUSB0,nonblock,raw,echo=0,waitlock=/var/run/tty,b115200

This above creates a stream of /dev/ttyUSB0 to TCP port 1234.


On the other side there is not much to install or setup, just use avrdude command line. Only thing you need to do in Arduino IDE is to select Sketch->Export compiled binary, this will place two hex files in you sketch folder. Then using avrdude command push the hex to created network serial port like this:

avrdude -p m1284p -c arduino -P net:10.10.10.127:1234 -Uflash:w:main_board.ino.with_bootloader.standard.hex 
  
Where net:10.10.10.127:1234 is target machine virtual network serial port, and other parameters represents Atmega1284p configuration with Arduino bootloader. Only one warning is issued by avrdue:

ioctl("TIOCMGET"): Inappropriate ioctl for device 


But it can be safely ignored. And this is it. Happy programming!

Tuesday, April 17, 2018

Arduino IDE upgrade

I have just updated instruction in Compiling section on right. This include complete setup of latest Arduino IDE and its environment to compile your own version of gateway firmware.

The move from 1.6.9 to 1.8.5 resulted to around 3KB smaller flash size, but on the other hand increased around 100B in RAM size. RAM size increase might be just result of different calculation of unused stack above NilRTOS environment.