misc‎ > ‎

Nanode RF

Misc notes about the Nanode RF or indeed any Nanode like board.

NanodeRF and some sketches running slowly

The EtherCard/ping example runs slowly for some people. This appears to be the bootloader leaving the CS of the other components in such a state that they confuse matters (current guess). Add
DDRB |= 0x2f; PORTB |= 0x7;
just after line 18, Serial.begin(57600) in setup() in pings.ino

All that does is to force deselect the RFM12, Ethernet & SRAM (which the bootloader below happens to do anyway - maybe it should leave the device in a better state)

Reprogram from SRAM

The Nanode boards have a 32k SRAM on them (23k256). This is large enough to store code to be flashed to the device. If the application level can manage to fill the SRAM with the wanted code (and a magic header) then all that remains is a call in to the bootloader to have the new code programmed in to flash. See http://blog.thiseldo.co.uk/?p=620 and http://blog.thiseldo.co.uk/?p=609

Below describes the changes made to get the simple nanode TFTP server for code upload, and modified optiboot working. I stress, all code written by Andy and others at links mentioned, merely small changes for Arduino 1.0 environment and some other misc changes. Also, these changes may not be necessary but worked for me.

Bootloader

Summary follows - see below for the actual patches.

boards.txt:

nanodev5.upload.protocol=arduino

Makefile:

STK500 = avr-gcc

How to make this auto defined for both linux and windows?

optiboot.c:

See patch, but the summary is, write over the magic value in SRAM having programmed the flash in case of boot loop, specifically disable the chip selects on the ethernet and RFM12b, delay

cores:

Copy from 1.0 Arduino IDE and merge in pins_arduino.h which lives elsewhere.

rm -rf sketchbook/hardware/NanodeBootLoader/cores

rsync -a /usr/share/arduino/hardware/arduino/cores sketchbook/hardware/NanodeBootLoader/.

rsync -a /usr/share/arduino/hardware/arduino/variants/standard/pins_arduino.h ~/sketchbook/hardware/NanodeBootLoader/cores/arduino/.

EtherCard_TFTPServer

SRAM9 library - surround with Arduino.h/WProgram.h. Alter to pin 9 for SRAM. (Original from here - altered one is below)

NanodeMAC library - surround with Arduino.h/WProgram.h. Diff below. (Original from here)

EtherCard_TFTPServer - reset using WDT timeout. "tsize" doesn't seem to be sent via tftp or atftp on linux. Bypassing just now with: if (expectedSize == 0) {expectedSize = transferSize;}. Also because of that, I've added a "magic2" that must be present in the header and also at the end of the data in case of incomplete transfers. (Original here)

EtherCard library - original here. Pin change.


Č
ċ
ď
EtherCard_TFTPServer.diff
(5k)
Zzz Zed,
19 Dec 2011 16:02
ċ
ď
EtherCard_library.diff
(0k)
Zzz Zed,
19 Dec 2011 15:13
ċ
ď
NanodeMac.git.diff
(0k)
Zzz Zed,
19 Dec 2011 12:50
ċ
ď
SRAM9.tgz
(3k)
Zzz Zed,
19 Dec 2011 12:46
ċ
ď
nanodev5_bootloaders.diff
(8k)
Zzz Zed,
19 Dec 2011 14:50
ċ
ď
optiboot_nanodev5.hex
(3k)
Zzz Zed,
19 Dec 2011 15:50
Comments