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

Squashed merge to upstream #32

Closed

Conversation

dhalbert
Copy link
Collaborator

This is another version of #31, but with many commits squashed into one, per @mmoskal 's request. The 08b5cd3 commit deletes the asf4 tree, and the aa9868d commit is all the subsequent changes. So just look at the latter commit for changed files so you don't have to see the thousands of deletions in the first commit. Unfortunately this is not an automatically mergeable PR due to the squashes, but the changes are the same as in #31.

SAMD51 builds

Enumerates ok but flash doesn't work.

Do manual flash writes and slow delay down when we have a much faster clock.

DM: fixed nvmctrl math in erase

DM: actually I think they want manual page writes

Re-enabled self-updater with SAMD51 support.

Get the version dynamically from git.

Correct flash offset now that we use a uint8_t pointer.

Turn on the neopixel.

Fix M0 compilation by avoiding USB macro.

Add board.mk files for every board.

Clean up ignores

Add grove zero board config file.

Don't use M0 name in the Zero bootloader

add board.mk for grove-zero

Add version info to all generated files.
Add .ino generation to scripts/gendata.py.
Clean up Makefile to handle new version number generation.

Note that Adafruit release tags will be v<a>.<b>.<c>-adafruit.<n>.
The first part of the tag is the upstream version. The <n> is the
Adafruit increment from that.

add pirkey and itsybitsy m0
change dotstar brightness to account for new 'dimmer' apa102's
update makefile to not use py3

consistancy and missing CRYSTALLESS

special metro m0 delay to avoid SWD contention while programming

Update to more recent Arduino

Add comment

Restore IRQs in neopixel functions

Remove -mlong-calls and add -nostartfiles; see #29
  Thanks @awatterott!

Avoid global writes in handover

Handle first read after handover correctly

V1.24; Add O marker for fixed MSC handover

Make the bootloader data go first in binary to avoid HardFault when erasing first page

Update samd pkg version

Fixes for WebUSB support

Fix Windows build

Remove WebUSB landing page support

add _binfo defn to linker scripts for doing usermode handover.

add proper serial number to USB descriptor; fix compile warning
Copy link
Member

@mmoskal mmoskal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good to me. Thank you!

" movs r6, #3; d2: sub r6, #1; bne d2;" // delay 3
#endif
#ifdef SAMD51
" movs r6, #3; d2: subs r6, #1; bne d2;" // delay 3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought there is only subs in Thumb instruction set (ie the instruction always sets the flags) - doesn't SAMD21 accept this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't write that code, but testing:

$ cat sub.c
void f(void) {
    asm volatile("sub r6, #1");
}
$ cat subs.c
void f(void) {
    asm volatile("subs r6, #1");
}
$ arm-none-eabi-gcc -mthumb -mcpu=cortex-m0plus -c sub.c
$ arm-none-eabi-gcc -mthumb -mcpu=cortex-m4 -c sub.c
$ arm-none-eabi-gcc -mthumb -mcpu=cortex-m0plus -c subs.c
/tmp/ccSbIfJ3.s: Assembler messages:
/tmp/ccSbIfJ3.s:27: Error: instruction not supported in Thumb16 mode -- `subs r6,#1'
$ arm-none-eabi-gcc -mthumb -mcpu=cortex-m4 -c subs.c

This seems to be a toolchain bug:
https://forum.pjrc.com/threads/27624-Coming-Soon-Teensy-LC-(low-cost-Teensy)/page13
https://sourceware.org/bugzilla/show_bug.cgi?id=15348

// Get top 4 bits.
uint8_t nibble = word >> 28;
word <<= 4;
serial_number[serial_number_idx++] = (nibble >= 10) ? 'A' + (nibble - 10) : '0' + nibble;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's writeNum in utils.c. Could that be used?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't know about that. I'll use it!

src/main.c Outdated
@@ -154,6 +162,9 @@ int main(void) {
while (1) {
}

#if USB_PID == 0x0013 // Metro m0
delay(100);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this have to do with attaching debugger?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes/programmer. when programming the metro m0, the SWD programmer can't attach after the bootloader's been put on. this doesn't affect overall functionality, but makes it easier for us to program

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, would be good to add a comment, and also check USB_VID.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dhalbert please add ^^ thx!

dhalbert referenced this pull request in dhalbert/uf2-samdx1 Feb 23, 2018
1. use writenum() for serial number.
2. Add comment and VID checking for SWD programmer delay for Metro M0.
Also:
3. Make warnings be errors on compile so they don't fly by; fix remaining warnings.
4. `make all-boards` now stops when a board fails to build.
5. Fix .binfo location for Metro M4: M4 code is now >8K. Use <n>K constants instead of hex constants for readability.
dhalbert referenced this pull request in dhalbert/uf2-samdx1 Feb 23, 2018
1. use writenum() for serial number.
2. Add comment and VID checking for SWD programmer delay for Metro M0.
Also:
3. Make warnings be errors on compile so they don't fly by; fix remaining warnings.
4. `make all-boards` now stops when a board fails to build.
5. Fix .binfo location for Metro M4: M4 code is now >8K. Use <n>K constants instead of hex constants for readability.
@dhalbert
Copy link
Collaborator Author

dhalbert commented Mar 9, 2018

Closing this informational PR. Same changes were incorporated by PR #31.

@dhalbert dhalbert closed this Mar 9, 2018
@dhalbert dhalbert deleted the squashed_merge_to_upstream branch February 3, 2023 19:25
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.

4 participants