Skip to content

Commit 5e6690e

Browse files
authored
Merge pull request #194 from cmdwtf/board-add-sf-nrf52840-micromod
Add board 'sparkfun_nrf52840_micromod'.
2 parents 3895ffb + 78d0c3a commit 5e6690e

File tree

5 files changed

+88
-0
lines changed

5 files changed

+88
-0
lines changed

.github/workflows/githubci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
- 'pca10100'
4646
- 'pitaya_go'
4747
- 'raytac_mdbt50q_rx'
48+
- 'sparkfun_nrf52840_micromod'
4849
- 'waveshare_nrf52840_eval'
4950

5051
steps:

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ This is a CDC/DFU/UF2 bootloader for nRF52 boards.
2020
- Particle Argon
2121
- Particle Boron
2222
- Particle Xenon
23+
- [SparkFun MicroMod nRF52840](https://www.sparkfun.com/products/16984)
2324

2425
UF2 is an easy-to-use bootloader that appears as a flash drive. You can just copy `.uf2`-format
2526
application images to the flash drive to load new firmware. See https://github.com/Microsoft/uf2 and https://github.com/adafruit/uf2-samdx1 for more information.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/*
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 2018 Ha Thach for Adafruit Industries
5+
* Copyright (c) 2021 Chris Marc Dailey
6+
*
7+
* Permission is hereby granted, free of charge, to any person obtaining a copy
8+
* of this software and associated documentation files (the "Software"), to deal
9+
* in the Software without restriction, including without limitation the rights
10+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
* copies of the Software, and to permit persons to whom the Software is
12+
* furnished to do so, subject to the following conditions:
13+
*
14+
* The above copyright notice and this permission notice shall be included in
15+
* all copies or substantial portions of the Software.
16+
*
17+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23+
* THE SOFTWARE.
24+
*/
25+
26+
#ifndef _SPARKFUN_NRF52840_MICROMOD_H_
27+
#define _SPARKFUN_NRF52840_MICROMOD_H_
28+
29+
#define _PINNUM(port, pin) ((port)*32 + (pin))
30+
31+
/*------------------------------------------------------------------*/
32+
/* LED
33+
*------------------------------------------------------------------*/
34+
#define LEDS_NUMBER 1
35+
#define LED_PRIMARY_PIN _PINNUM(0, 13)
36+
#define LED_STATE_ON 1
37+
38+
/*------------------------------------------------------------------*/
39+
/* BUTTON
40+
*------------------------------------------------------------------*/
41+
#define BUTTONS_NUMBER 2
42+
#define BUTTON_1 _PINNUM(0, 7)
43+
#define BUTTON_2 _PINNUM(0, 10)
44+
#define BUTTON_PULL NRF_GPIO_PIN_PULLUP
45+
46+
//--------------------------------------------------------------------+
47+
// BLE OTA
48+
//--------------------------------------------------------------------+
49+
#define BLEDIS_MANUFACTURER "SparkFun"
50+
#define BLEDIS_MODEL "MicroMod nRF52840"
51+
52+
//--------------------------------------------------------------------+
53+
// USB
54+
//--------------------------------------------------------------------+
55+
#define USB_DESC_VID 0x1B4F
56+
#define USB_DESC_UF2_PID 0x0022
57+
#define USB_DESC_CDC_ONLY_PID 0x0023
58+
59+
//------------- UF2 -------------//
60+
#define UF2_PRODUCT_NAME "SparkFun MicroMod nRF52840"
61+
#define UF2_VOLUME_LABEL "SFMM852BOOT"
62+
#define UF2_BOARD_ID "nRF52840-micromod-v10"
63+
64+
#define UF2_INDEX_URL "https://www.sparkfun.com/products/16984"
65+
66+
#endif /* _SPARKFUN_NRF52840_MICROMOD_H_ */
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
MCU_SUB_VARIANT = nrf52840
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include "boards.h"
2+
#include "uf2/configkeys.h"
3+
4+
__attribute__((used, section(".bootloaderConfig")))
5+
const uint32_t bootloaderConfig[] =
6+
{
7+
/* CF2 START */
8+
CFG_MAGIC0, CFG_MAGIC1, // magic
9+
5, 100, // used entries, total entries
10+
11+
204, 0x100000, // FLASH_BYTES = 0x100000
12+
205, 0x40000, // RAM_BYTES = 0x40000
13+
208, (USB_DESC_VID << 16) | USB_DESC_UF2_PID, // BOOTLOADER_BOARD_ID = USB VID+PID, used for verification when updating bootloader via uf2
14+
209, 0xada52840, // UF2_FAMILY = 0xada52840
15+
210, 0x20, // PINS_PORT_SIZE = PA_32
16+
17+
0, 0, 0, 0, 0, 0, 0, 0
18+
/* CF2 END */
19+
};

0 commit comments

Comments
 (0)