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

Added Makerdiary nRF52840 MDK USB Dongle support #31202

Closed
wants to merge 3 commits into from

Conversation

424778940z
Copy link

As title says.
Tested, works fine.

@mcrosson
Copy link

Shouldn't CONFIG_GPIO_AS_PINRESET=y be set to n or unset per https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/cbb51081997ce31fdf355bd533cad5f5d575f347/config/nrf52840_mdk_usb_dongle.h#L50

Also, the newer MDK dongles ship with uf2 bootloader and not pyocd from what I've seen. Can they still be flashed using pyocd somehow?

@424778940z
Copy link
Author

Fixed that CONFIG_GPIO_AS_PINRESET option.

For the bootloader, I checked, they do use U2F now, I have been using JLink exclusively, didn't really play with it.
I changed it to match Adafruit Feather NRF52840 since the U2F BL repo claims support both boards
Didn't see an option for adafruit-nrfutil in boards\common, if there is a more proper way, please let me know.

@mcrosson
Copy link

The storage layout still may not be 100% in the dts. I have the following for my mdk dongle using zephyr + zmk to get it booting properly with uf2. It may need to be adjusted lightly but the mbr/adafruit_boot partitions are different than what you have defined.

&flash0 {
	/*
	 * For more information, see:
	 * http://docs.zephyrproject.org/latest/devices/dts/flash_partitions.html
	 */
	partitions {
		compatible = "fixed-partitions";
		#address-cells = <1>;
		#size-cells = <1>;

		sd_partition: partition@0 {
			label = "mbr";
			reg = <0x00000000 0x00001000>;
		};
		code_partition: partition@1000 {
			label = "code_partition";
			reg = <0x00001000 0x000d3000>;
		};

		/*
		 * The flash starting at 0x000d4000 and ending at
		 * 0x000f3fff is reserved for use by the application.
		 */

		/*
		 * Storage partition will be used by FCB/LittleFS/NVS
		 * if enabled.
		 */
		storage_partition: partition@d4000 {
			label = "storage";
			reg = <0x000d4000 0x00020000>;
		};

		boot_partition: partition@f4000 {
			label = "adafruit_boot";
			reg = <0x000f4000 0x0000c000>;
		};
	};
};

I also had to add the following settings for zephyr+zmk ; not sure if tghey are required for uf2 but it may be worth additional tests.

CONFIG_USE_DT_CODE_PARTITION=y

CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_NVS=y
#CONFIG_SETTINGS_NVS=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y

@github-actions
Copy link

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Mar 31, 2021
@github-actions github-actions bot closed this Apr 14, 2021
@maxromanovsky
Copy link

@424778940z @mcrosson any chance to get it merged? :)

@dchauran
Copy link

@jfischer-no @anangl it looks like your review was requested, and I would really love to see this merged.

@koush
Copy link

koush commented Jul 31, 2021

Shouldn't CONFIG_GPIO_AS_PINRESET=y be set to n or unset per https://github.com/makerdiary/nrf52840-mdk-usb-dongle/blob/cbb51081997ce31fdf355bd533cad5f5d575f347/config/nrf52840_mdk_usb_dongle.h#L50

Also, the newer MDK dongles ship with uf2 bootloader and not pyocd from what I've seen. Can they still be flashed using pyocd somehow?

The MakerDiary Dongles have shipped with uf2 Bootloader out of the box for over a year now. I've added support for adafruit-nrfutil flashing in my pull request. Didn't see this pull request until just now.

#37185

@xlla
Copy link

xlla commented Nov 19, 2021

I have tested this PR.
It works with mcuboot, but does not work with adafruit_bootloader using @mcrosson 's partition map.

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

Successfully merging this pull request may close these issues.

9 participants