Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mini boot #11

Open
wants to merge 19 commits into
base: mini-boot
Choose a base branch
from
Open

Conversation

jonatanolofsson
Copy link

Merge mini-boot into master (for faster downloads, astyle etc)

Marti Bolivar and others added 19 commits December 7, 2010 23:27
The firmware matches pretty much the DFU 1.1 specification.

This is a follow up of 95e1150
which only changed the separately defined u8_usbFunctionalDescriptor
but not the one included in the configuration descriptor. And which
also got it wrong (0.1).

(Ideally the code should be cleaned up to only specify this in one place)

Also fix the detach timeout which was set to 64 seconds. I believe
the intended value was 255 ms like stated in the comment. Since the
Maple devices are not detached (transition between run-time mode and
DFU mode, issued over the DFU interface), this is not used anyway.

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Acked-by: Marti Bolivar <mbolivar@leaflabs.com>
To let DFU programmers such as dfu-util know that they can trust
the DFU functional descriptor on this device.

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Acked-by: Marti Bolivar <mbolivar@leaflabs.com>
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
It's about time we had one of these, and I don't want to imply that
the previous two commits for DFU compliance were mine. So credit their
author, Tormod Volden, in the single entry.

We can add more people as we go.

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Comitting the results of:

$ find . -name '*.c' -o -name '*.s' -o -name '*.h' -o -name '*.ld' | xargs fromdos

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Command used:

$ ack --files-with-matches '[ \t]+$' | xargs sed -i -E 's/[ \t]+$//'

`ack' is also known as `ack-grep' on some systems and in some package
managers (e.g. Ubuntu's).

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
32 ms is the value used in ST's DFU IAP example for STM32.

For DFU-compliant programming tools like dfu-util this change
should speed up flashing more than ten times.

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
The sources have ugly whitespace. Run astyle on them, ignoring those
in usb_lib/. Astyle version 2.01 (2.01-1 on Ubuntu 12.04) options were:

--indent=spaces=4
--style=java
--indent-namespaces
--pad-oper
--pad-header
--unpad-paren
--align-pointer=name
--indent-preprocessor
--lineend=linux

Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
USB uses little endian, as does ARM, so there should not be any byte
swapping. Bytes were swapped back and forth inconsistently and would
break word access of u16_u8 union types. It seems like this has gone
unnoticed for long because the word values are mostly used for comparing
against zero.

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
The DFU_UPLOAD support allows copying the contents of the flash or RAM
memory of the Maple to the computer.

Note that we use the wValue (BlockNum in the DFU standard) to calculate
the target address. We therefore rely on the host program (for instance
dfu-util) to set (increase) wValue for each block.

This use of wValue is not mandated by the DFU standard, which only says
wValue should be incremented by the host "to provide useful context" to
the device, but this implementation allows random access of memory
locations.

On the other hand the DFU_DNLOAD code does not make use of BlockNum but
simply increases its memory pointer for each block received. Maybe this
was done because reading out wValue was broken due to endian mix-up?

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Fixing dfu.c to allow compiling with -Os
Conflicts:
	dfu.c
	hardware.c
	hardware.h
	main.c
	usb.c
@rogerclarkmelbourne
Copy link

@jonatanolofsson

Can you tell me whether you still intend maintaining your repo now that LeafLabs have issued an End of Life notification? (Marti just closed a issue I put in to the leaflabs repo about build targets using the Make file rather than using Branches)

I have forked your repo and intend to make some changes, possibly including build targets, but as Marti will not be actioning Pull Requests any more, either your repo will need to become the master and I will issue a Pull Request to your repo,

Or I need to make a new master.
Note. I already have effectively taken over libmaple for Arduino 1.6+
So I'd be happy to take on being master repo for the bootloader if you are not actively maintaining it

Thanks

Roger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants