1.. zephyr:board:: promicro_nrf52840 2 3More of a board type than a unique board, It is based on Nice!Nano. 4Also referred to as Pro Micro, Promicro, SuperMini nRF52840 boards. 5 6Overview 7******** 8 9The hardware provides support for the Nordic 10Semiconductor nRF52840 ARM Cortex-M4F CPU and the following devices: 11 12* :abbr:`ADC (Analog to Digital Converter)` 13* CLOCK 14* FLASH 15* :abbr:`GPIO (General Purpose Input Output)` 16* :abbr:`I2C (Inter-Integrated Circuit)` 17* :abbr:`MPU (Memory Protection Unit)` 18* :abbr:`NVIC (Nested Vectored Interrupt Controller)` 19* :abbr:`PWM (Pulse Width Modulation)` 20* RADIO (Bluetooth Low Energy and 802.15.4) 21* :abbr:`RTC (nRF RTC System Clock)` 22* :abbr:`SPI (Serial Peripheral Interface)` 23* :abbr:`UART (Universal asynchronous receiver-transmitter)` 24* :abbr:`USB (Universal Serial Bus)` 25* :abbr:`WDT (Watchdog Timer)` 26 27More information about the original board can be found at the 28`Nice!Nano website`_. 29 30Information about clones can be found at `Clone Wiki`_. 31 32Pinout and Schematic are available in the `Nice!Nano Documentation`_ 33 34 35Supported Features 36================== 37 38.. zephyr:board-supported-hw:: 39 40Connections and IOs 41=================== 42 43LED 44--- 45 46* LED0 = P0.15, can be any color. 47 48Programming and Debugging 49************************* 50 51Applications for the ``promicro_nrf52840/nrf52840`` board target can be 52built in the usual way (see :ref:`build_an_application` for more details). 53 54Flashing 55======== 56 57The board is factory-programmed with Adafruit's UF2 booloader 58 59#. Reset the board into the bootloader by bridging ground and RST 2 times 60quickly 61 62 The status LED should start a fade pattern, signalling the bootloader is 63 running. 64 65#. Compile a Zephyr application; we'll use :zephyr:code-sample:`blinky`. 66 67 .. zephyr-app-commands:: 68 :app: zephyr/samples/basic/blinky 69 :board: promicro_nrf52840/nrf52840/uf2 70 :goals: build 71 72#. Flash it onto the board. You may need to mount the device. 73 74 .. code-block:: console 75 76 west flash 77 78 When this command exits, observe the red LED on the board blinking, 79 80 81Debugging 82========= 83 84You may debug this board using the broken out pads on the back. 85PyOCD and openOCD can be used to flash and debug this board. 86 87Recovery 88======== 89 90In case of a error resulting in a board's bootloader becoming inaccessible, 91it is possible to flash anything directly using openOCD: 92 93#. Setup OpenOCD correctly, here for WCH linkE in ARM mode: 94 95 .. code-block:: console 96 97 openocd -f interface/cmsis-dap.cfg -f target/nrf52.cfg 98 99Note interface and target folders are from openOCD's tcl folder. 100 101#. Connect to openOCD, for example with telnet or GDB: 102 103 .. code-block:: console 104 105 telnet localhost 4444 106 107 .. code-block:: console 108 109 target extended-remote localhost:3333 110 111#. Erase flash: 112 113 .. code-block:: console 114 115 reset halt 116 nrf5 mass_erase 117 118or 119 120 .. code-block:: console 121 122 mon reset halt 123 mon nrf5 mass_erase 124 125#. Flash Bootloader 126 127 .. code-block:: console 128 129 flash write_image erase nice_nano_bootloader-0.9.2_s140_6.1.1.hex 130 131or 132 133 .. code-block:: console 134 135 mon flash write_image erase nice_nano_bootloader-0.9.2_s140_6.1.1.hex 136 137References 138********** 139 140.. target-notes:: 141 142.. _Nice!Nano website: 143 https://nicekeyboards.com/docs/nice-nano/ 144.. _Clone Wiki: 145 https://github.com/joric/nrfmicro/wiki/Alternatives 146.. _Nice!Nano Documentation: 147 https://nicekeyboards.com/docs/nice-nano/pinout-schematic 148