-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Nrf52840 usbboot #1004
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
Nrf52840 usbboot #1004
Changes from all commits
50e7a4c
ce9f05f
0de8697
d0e00d7
3d8bb96
5365e51
dadf831
05f36eb
53593d1
78f806c
52ebfd0
6d4a2f5
9bb4ded
c854e2d
c10899d
2b3436e
418e28c
35d38db
9fc0ec6
6d2702e
6143710
f5be5ed
4722371
4d45565
5454768
8d065fe
ecd3993
bed7310
4920cc4
8fbe1d7
c4f11df
b14b280
46c453c
36e2f38
a73effa
7fff7f5
6d0cb96
be2ff20
1745e20
3564e98
0365912
4e5d9a0
0806c0a
6ef3a0b
948ddf8
3e31969
baf68a9
c5089d7
f199e87
97a1ae9
7715d19
0e81959
69f224a
ce01496
a53b1c7
10846d3
f98c7f7
4b1f880
873e202
862ae2f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
*.bin | ||
*.map | ||
*.hex | ||
!ports/nrf/**/bootloader/*.hex | ||
!ports/nrf/**/bootloader/**/*.hex | ||
*.dis | ||
*.exe | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* This file is part of the MicroPython project, http://micropython.org/ | ||
* | ||
* The MIT License (MIT) | ||
* | ||
* Copyright (c) 2017 Scott Shawcroft for Adafruit Industries | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
*/ | ||
|
||
#include "tusb.h" | ||
|
||
void run_background_tasks(void) { | ||
#ifdef NRF52840_XXAA | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm wondering if there's a better way to do this, could we only include this file if we're building for 840, then we wouldn't need the macro check There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There could be other background service running besides usb, e.g ble task handling. |
||
tusb_task(); | ||
tud_cdc_flush(); | ||
#endif | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,11 @@ | ||
MCU_SERIES = m4 | ||
MCU_VARIANT = nrf52 | ||
MCU_SUB_VARIANT = nrf52 | ||
SD ?= s132 | ||
SOFTDEV_VERSION ?= 2.0.1 | ||
|
||
LD_FILE = boards/feather52832/custom_nrf52832_dfu_app_$(SOFTDEV_VERSION).ld | ||
BOOTLOADER_PKG = boards/feather52832/bootloader/feather52_bootloader_$(SOFTDEV_VERSION)_s132_single.zip | ||
BOOT_FILE = boards/feather52832/bootloader/feather52_bootloader_$(SOFTDEV_VERSION)_s132_single | ||
|
||
BOOT_SETTING_ADDR = 0x7F000 | ||
NRF_DEFINES += -DNRF52832_XXAA | ||
|
||
ifeq ($(OS),Windows_NT) | ||
NRFUTIL = ../../lib/nrfutil/binaries/win32/nrfutil.exe | ||
else | ||
NRFUTIL = nrfutil | ||
endif | ||
|
||
CFLAGS += -DADAFRUIT_FEATHER52 | ||
|
||
check_defined = \ | ||
$(strip $(foreach 1,$1, \ | ||
$(call __check_defined,$1,$(strip $(value 2))))) | ||
__check_defined = \ | ||
$(if $(value $1),, \ | ||
$(error Undefined make flag: $1$(if $2, ($2)))) | ||
|
||
.PHONY: dfu-gen dfu-flash boot-flash | ||
|
||
dfu-gen: | ||
$(NRFUTIL) dfu genpkg --dev-type 0x0052 --application $(BUILD)/$(OUTPUT_FILENAME).hex $(BUILD)/dfu-package.zip | ||
|
||
dfu-flash: | ||
@:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyUSB0) | ||
$(NRFUTIL) dfu serial --package $(BUILD)/dfu-package.zip -p $(SERIAL) -b 115200 | ||
|
||
boot-flash: | ||
@:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyUSB0) | ||
$(NRFUTIL) dfu serial --package $(BOOTLOADER_PKG) -p $(SERIAL) -b 115200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New line