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

Add support for nRFMicro #342

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Add support for nRFMicro #342

wants to merge 5 commits into from

Conversation

pdcook
Copy link

@pdcook pdcook commented Sep 8, 2024

Checklist

  • Please provide specific title of the PR describing the change
  • If you are adding an new boards, please make sure
    • Provide link to your allocated VID/PID if applicable
    • UF2_BOARD_ID in your board.h follow correct format from uf2 specs

Description of Change

Add support for nRFMicro-like boards https://github.com/joric/nrfmicro/wiki, such as the extremely popular and affordable SuperMini. Very similar to nice!nano v2 config, but not identical.

VID/PID 1209/5284

Copy link
Member

@hathach hathach left a comment

Choose a reason for hiding this comment

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

look good, I marked this as draft for now, when PID PR is merged and new pid is push, you can convert it to ready for review again.

@hathach hathach marked this pull request as draft September 11, 2024 03:28
@pdcook pdcook marked this pull request as ready for review September 11, 2024 20:44
@pdcook
Copy link
Author

pdcook commented Sep 11, 2024

VID/PID allocated, ready for review! https://pid.codes/1209/5284/

@joric
Copy link

joric commented Sep 12, 2024

There was a patch here https://gist.github.com/joric/7226eda8d5fdba44bc64d4520825a11d that blinks and supports OTA (maps LED to 1.10 and DFU to 1.02) https://github.com/joric/nrfmicro/wiki/Bootloader#nrf52840 looks like this PR doesn't take into account that blue led is at 1.10 not at 0.15.

 src/boards/pca10056/board.h | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/boards/pca10056/board.h b/src/boards/pca10056/board.h
index 92ce3462..bfe13798 100644
--- a/src/boards/pca10056/board.h
+++ b/src/boards/pca10056/board.h
@@ -25,20 +25,21 @@
 #ifndef PCA10056_H
 #define PCA10056_H
 
+#define _PINNUM(port, pin)    ((port)*32 + (pin))
+
 /*------------------------------------------------------------------*/
 /* LED
  *------------------------------------------------------------------*/
-#define LEDS_NUMBER         2
-#define LED_PRIMARY_PIN     13
-#define LED_SECONDARY_PIN   14
-#define LED_STATE_ON        0
+#define LEDS_NUMBER       1
+#define LED_PRIMARY_PIN   _PINNUM(1, 10) // Blue
+#define LED_STATE_ON      1
 
 /*------------------------------------------------------------------*/
 /* BUTTON
  *------------------------------------------------------------------*/
 #define BUTTONS_NUMBER      2
-#define BUTTON_1            11
-#define BUTTON_2            12
+#define BUTTON_1            _PINNUM(1,2)
+#define BUTTON_2            _PINNUM(0,12)
 #define BUTTON_PULL         NRF_GPIO_PIN_PULLUP
 
 //--------------------------------------------------------------------+

Also see OTA section https://github.com/joric/nrfmicro/wiki/Bootloader#ota-updates "You'd need to short two pins to ground, 0.12 is FRST and 0.11 is DFU in pca10056. Mind that 0.11 does not exist on E73 module so it would need fixing and recompiling the bootloader (e.g. put DFU button BUTTON_1 to pin 1.02 in pca10056/board.h)." I'm not quite sure it does that either.

But the LED is the main issue, I mean what's the point in changing bootloader if it doesn't even support user LED.

SuperMini and nRFMicro Pinouts are vastly different, here's a comparison table here https://github.com/joric/nrfmicro/wiki/Pinout (SuperMini is essentially a nice!nano v1 clone) so you'd have to choose what you really support. I don't mind if it's going to be a nicenano (i.e. supermini) bootloader because nRFMicro is a DIY board for kids that's kind of dead already because there are better boards. But I don't know why make another nice!nano bootloader, I think it already has a few:

nRFMicro User LED is at 1.10. Nice!nano/SuperMini User LED is at 0.15, according to schematics https://nicekeyboards.com/docs/nice-nano/pinout-schematic.

SuperMini (as in mass-produced Chinese nice!nano v1 clone) swaps colors but you can assume it's still a Blue LED (charging LED that's supposed to be Red doesn't have a dedicated pin, it's charger-driven). SuperMini comes with an official nice!nano bootloader so they must be identical in pinout. Not sure in VCC locking pin though but bootloader doesn't control that anyway.

If anything, VID/PID 1209/5284 is now assigned to nRFMicro, not nice!nano/supermini so I don't know what to do here. I suggest changing the LED pin to 1.10, changing the DFU buttons and go with nRFMicro. SuperMini is an entirely another board and it already has a bootloader as in nicenano v1/v2.

nRFMicro doesn't have anything common with SuperMini, pinout is completely different. SuperMini is a nice!nano clone.

I don't make SuperMini. I just like it because it's way cheaper than nice!nano and has an ESD decoupling.

@pdcook
Copy link
Author

pdcook commented Sep 12, 2024

Whoops, committed the completely wrong file. My setup is currently a mess. Should be fixed now. I elected to go with the 1.02/0.12 configuration as it appeared that the wiki preferred that.

@joric
Copy link

joric commented Sep 12, 2024

LGTM now.

@fanoush
Copy link
Contributor

fanoush commented Oct 18, 2024

Hi found this PR when searching for SuperMini, but looks like I am at wrong place as this PR is not for SuperMini @pdcook maybe you can rename the PR title - remove SuperMini from the name?

@pdcook
Copy link
Author

pdcook commented Oct 18, 2024

@fanoush You're right, I'll do that. If you're still looking for a SuperMini bootloader (and Arduino core) you can find that here: https://github.com/pdcook/nRFMicro-Arduino-Core

@pdcook pdcook changed the title Add support for nRFMicro-based boards (ProMicro-like, SuperMini, etc) Add support for nRFMicro Oct 18, 2024
@fanoush
Copy link
Contributor

fanoush commented Oct 18, 2024

Thanks. It comes with older version of this bootlader for nice!nano so it seems I can use update-nice_nano_bootloader-0.8.3_nosd.uf2 to upgrade.

Came from https://circuitpython.org/board/supermini_nrf52840/ which suggests upgrading bootloader and that page is specifically for SuperMini (there is also separate page for nice!nano https://circuitpython.org/board/nice_nano/ ) but then in the release files there is no file for supermini, so I checked pull requests and found this.

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