Skip to content

Commit 4563713

Browse files
author
Nico
committed
Resolved minor TODOs
1 parent 82b7469 commit 4563713

File tree

3 files changed

+21
-46
lines changed

3 files changed

+21
-46
lines changed

Readme.md

Lines changed: 13 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ and some online shops even sell the bigger 32u2 (I've got two of them :D).
3737
* Arduino IDE integration + programming with the 16u2 (USB-Core)
3838
* IDE example sketches for HID devices (Mouse, Keyboard, Gamepad, Media/System Keys)
3939
* IDE example sketch for a working Serial + Keyboard demonstration
40-
* IDE example sketch for no usb usage
4140
* IDE example sketch for PWM demonstration
4241
* IDE example USB-Serial demo (equal to original firmware for baud rate 115200)
4342
* IDE example sketch for 16u2 - 328/2560 communication (HoodLoader1 technique)
43+
* Newer features are listed in the HID Project page itself.
4444

4545
**16u2 features on a normal Uno/Mega R3:**
4646
* 16kb flash (minus 4kb for the HoodLoader2) (8 for a 8u2, 32 for a 32u2)
@@ -161,11 +161,11 @@ lock_bits=0x2F
161161
162162
163163
Official DFU + USB-Serial Fuses:
164-
low_fuses=0xFF // Nick Gammon read 0xEF, have to check this
164+
low_fuses=0xEF
165165
high_fuses=0xD9
166166
extended_fuses=0xF4
167167
unlock_bits=0x3F
168-
lock_bits=0x2F
168+
lock_bits=0xCF
169169
```
170170

171171
### Updating HoodLoader2 to a newer version
@@ -250,18 +250,8 @@ Have a look at the examples in the HID Project and check out the [pinout](https:
250250

251251
If you don't want to use the USB-Core you can also choose under *Tools/USB Core* "No USB functions" to get rid of the USB stuff
252252
and save the ram for other stuff if you don't need it. You also don't need the HID Project essentially if you don't want to use the USB functions.
253-
You have to add an ISR into every sketch then. Checkout the 'HoodLoader2_NoUSB_Blink' example in the HID Project.
254-
255-
```cpp
256-
#ifndef USBCON
257-
// workaround for undefined USBCON has to be placed in every sketch
258-
// otherwise the timings wont work correctly
259-
ISR(USB_GEN_vect)
260-
{
261-
UDINT = 0;
262-
}
263-
#endif
264-
```
253+
254+
**No workaround is no longer needed with version 2.0.1 or newer.**
265255

266256
### How to flash/erase firmwares (.hex files) with avr-dude
267257

@@ -362,32 +352,15 @@ Baud 57600 cannot be used in bootloader mode since its used for CDC programming.
362352

363353
The main MCU will always reset on a 16u2 reprogramming. There is no way to fix this (yet).
364354

365-
Gamepads and RAW-HID in an HID multi report gives problems under some OS (Gamepads especially Linux).
366-
This is an OS bug and has nothing to do with the HoodLoader.
367-
368-
Also the HoodLoader only ensures that you can upload sketches to the MCUs. If your USB HID devices have any problems
369-
please check the HID Project for known bugs/updates.
370-
371-
TODO
372-
====
373-
(ignore this, its just for me)
374-
375-
documentation HoodLoader2:
376-
pictures, example with leds spi, ir sensor, usb function
377-
check if fastled/other libs work
378-
379-
Bootloader itself:
380-
remove buffer and use endpoint double banks? store prev endpoint state in isr! (reliable and useful??)
381-
change bootloader key position in ram?
382-
383-
check fuse setting: 0xEF, vs 0xFF
384-
fix usb vid pass via boards.txt
355+
The HoodLoader only ensures that you can upload sketches to the MCUs.
356+
If your USB HID device causes any problem please check the HID Project for known bugs/updates.
385357

386-
Hid Project:
387-
update Burning via ISP (advanced)
388-
system wakeup and other (github pull requests)
389-
Test with Android phone
358+
The Magic BootKey is not stored properly in ram and may cause errors. This is a general Arduino
359+
Software problem, we have to do this to keep compatible. Normally there shouldn't be any noticeable error.
360+
This bug has a workaround in the HID Project so it wont matter any ways. Just want to mention it here.
390361

362+
The USB setting (pid, vid, manufacturer, name) cannot be passed with the new IDE because the u2 Series is not integrated.
363+
These values are defined in the pins_arduino.h
391364

392365
Version History
393366
===============
@@ -401,6 +374,7 @@ Version History
401374
2.0.1 Pre-Release (29.11.2014)
402375
* HoodLoader2.0.1 Release
403376
* Better, full reset after bootloader execution with watchdog
377+
* This fixes the "No-USB" workaround with the USB clock
404378
* Fixed fuse bug
405379
* Fixed magic key passed from Arduino core (HID Project)
406380
* Changed some descriptor names, bugfix above freed some space

avr/boards.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,11 +237,11 @@ HoodLoader2atmega16u2DFU.upload.tool=arduino:avrdude
237237
HoodLoader2atmega16u2DFU.build.mcu=atmega16u2
238238

239239
#fuses (HoodLoader2 only, not suitable for DFU)
240-
HoodLoader2atmega16u2DFU.bootloader.low_fuses=0xFF
240+
HoodLoader2atmega16u2DFU.bootloader.low_fuses=0xEF
241241
HoodLoader2atmega16u2DFU.bootloader.high_fuses=0xD9
242242
HoodLoader2atmega16u2DFU.bootloader.extended_fuses=0xF4
243243
HoodLoader2atmega16u2DFU.bootloader.unlock_bits=0x3F
244-
HoodLoader2atmega16u2DFU.bootloader.lock_bits=0x0F
244+
HoodLoader2atmega16u2DFU.bootloader.lock_bits=0xCF
245245

246246

247247
#Board selection (only important for burning bootloaders)

tools/Atmega_Board_Programmer/Atmega_Board_Programmer.ino

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@ along with Hoodloader2. If not, see <http://www.gnu.org/licenses/>.
5454
// Version 1.26-A: Turn off programming mode when done (so chip can run)
5555
// Version 1.26-B: Updated to HoodLoader 2.0.1
5656
// Version 1.26-C: Updated to HoodLoader 2.0.2
57+
// Version 1.26-D: Corrected Fuses to original Arduino values
5758

58-
#define VERSION "1.26-C"
59+
#define VERSION "1.26-D"
5960

6061
//================================================================================
6162
// HoodLoader2 definitions
@@ -216,21 +217,21 @@ signatureType signatures [] =
216217
0x0000, // start address (0x0000-0x4000)
217218
sizeof Arduino_COMBINED_dfu_usbserial_atmega16u2_Mega2560_Rev3_hex,
218219
128, // page size in bytes (for committing)
219-
0xFF, // fuse low byte: external clock, m
220+
0xEF, // fuse low byte: external clock, m
220221
0xD9, // fuse high byte: SPI enable, NOT boot into bootloader, 4096 byte bootloader
221222
0xF4, // fuse extended byte: brown-out detection at 2.6V
222-
0x0F }, // lock bits
223+
0xCF }, // lock bits
223224

224225
#else // HOODLOADER2_16U2_UNO
225226
{ { 0x1E, 0x94, 0x89 }, "ATmega16U2", 16 * kb, 512 ,
226227
Arduino_COMBINED_dfu_usbserial_atmega16u2_Uno_Rev3_hex, // loader image
227228
0x0000, // start address (0x0000-0x4000)
228229
sizeof Arduino_COMBINED_dfu_usbserial_atmega16u2_Uno_Rev3_hex,
229230
128, // page size in bytes (for committing)
230-
0xFF, // fuse low byte: external clock, m
231+
0xEF, // fuse low byte: external clock, m
231232
0xD9, // fuse high byte: SPI enable, NOT boot into bootloader, 4096 byte bootloader
232233
0xF4, // fuse extended byte: brown-out detection at 2.6V
233-
0x0F }, // lock bits
234+
0xCF }, // lock bits
234235

235236
#endif
236237

0 commit comments

Comments
 (0)