Go Down

Topic: Porting from Board-Ethernet to Board-Yun (Read 662 times) previous topic - next topic


I have a sketch written for board-ethernet (aka: W5100 ethernte) that includes some web-server and some low-layer protocol. Runs fine.

Now i want to expand the sketch so that the single sketch compiles and runs on either ethernet or yun.

Some things i would like to understand:

1. Bootloader

Ethernet bootloader size is 0.5 KByte, Yun is 4KByte. What more is in the Yun ? I guess uno/ethernet source is avr/bootloaders/atmega/ATmegaBOOT_168.c and yun is
avr/bootloaders/caterina/Caterina.c ? Couldn't figure out immediately the difference. The source file for atmega is even larger. The hex output is smaller though. Is this code difference because of the USB library on the Yun ?

2. conditional compile

I was trying for some predefined macros that would allow me to conditionally compile in my sketch the pieces i need on either ethernet or Yun. Eg: On Yun i  need the W5100 pieces and "WebServer" components, on Yun this code would be replaced by using the bridge library. But i could not figure out good predefined macros (#ifdef ARDUINO_BOARD_YUN or the like...). What board specific defines exist ? What's recommended to create a sketch that will compile across different boards while still using their differences in hardware ?


Hmm. nobody with any ideas ? Nobody trying to compile for both Ethernet and Yun ?


Go Up