-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathREADME.compiling
108 lines (73 loc) · 3.37 KB
/
README.compiling
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
Note: This stuff is beta! Patches welcome, dragons ahead.
For info on programming dongle, see README.dongle
For info on linux userspace app, see README.app
Hardware connection
-------------------
The rf24boot doesn't make use of the IRQ line, so you may leave it
disconnected. For avr you can use either hardware SPI or soft-SPI.
This can be set in "Project Settings -> Hardware config"
Make sure to fill in appropriate lines.
Note on SS line when using hardware SPI on AVR:
The SS line needs to be specified and WILL be configured as output.
You can use it for CE or CSN, but it must be set as output.
This is AVR hardware weirdness.
For software SPI any free GPIO pins would do with no special
considerations.
Prereqs
--------
Install antares. Follow instructions at http://github.com/nekromant/antares
Compiling the bootloader
------------------------
Copy the starting config. Use config_m328pbootldr as a starting point for the actual bootloader.
cp config_m328pbootldr .config
Adjust settings using 'make menuconfig' as required.
Normally you'll need to set your target MCU, tick 'Run in bootloader section'
and set bootloader address for AVR.
PITFALL: AVR fuse calcs and datasheets show the bootloader section size in WORDS,
while antares, like gcc expects a hex value in BYTES.
PITFALL#2: Tripple check that fuses in config are correct for your device
Otherwise you may brick you micro.
Then burn it to your board with avrdude. Remember to set the fuses correctly
to enable boot reset vector. Everything should work out of the box.
The bootloader should fit in 4k for avr. If it doesn't, check the following stuff:
* Completely disable everything in Libraries->Console and IO.
* Under target platform tick "Extra size optimisations"
Debugging
---------
Enabling debugging will considerably (+2K) bloat the bootloader.
You can burn it to application section for debugging, and test
reading and writing the eeprom and dummy partitions.
To enable debugging:
make manuconfig
Navigate to
Libraries and drivers -> Console and IO
Enable early console and set it to something you have on your board,
like AVR HW serial port.
Make sure you select avr-libc glue as well.
Enable 'printk and dbg() macro support'
You are done. Compile and burn it to your board, you should see debugging
coming from the serial port of your choice.
rf24 library debugging can be tuned in:
Libraries and drivers -> Wireless devices -> nrf24L01 support
0 - stands for debugging disabled
5 - stands for very verbose
Compiling the uISP app
----------------------
Normally you won't need this, since rf24tool will be in your 'uappmgr'.
If you don't have it already in the list - run 'uappmgr update'
Get an uISP dongle. Order, etch, make yours... Whatever.
See github.com/uISP for schematics and firmware.
Use config_uispdongle as a starting config. Any atmega with vusb and nrf24l01
can do the trick with a little bit of hacking ;).
Here are the schematics and an ultra-cheap (1 layer!) PCB design of one such dongle:
https://github.com/nekromant/nrf24l01-dongle
If you have this one use config_nrfdongle to get you bootloader app
Compiling the rf24tool
----------------------
cd rf24tool
make
sudo make install
Or just copy the rf24tool somewhere to your $PATH.
See rf24tool --help for info on different options
Enjoy, remember to share, comment post... or don't do any,
but just send your patches!