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 51.. zephyr:board-supported-runners:: 52 53Applications for the ``promicro_nrf52840/nrf52840`` board target can be 54built in the usual way (see :ref:`build_an_application` for more details). 55 56Flashing 57======== 58 59The board is factory-programmed with Adafruit's UF2 booloader 60 61#. Reset the board into the bootloader by bridging ground and RST 2 times 62quickly 63 64 The status LED should start a fade pattern, signalling the bootloader is 65 running. 66 67#. Compile a Zephyr application; we'll use :zephyr:code-sample:`blinky`. 68 69 .. zephyr-app-commands:: 70 :app: zephyr/samples/basic/blinky 71 :board: promicro_nrf52840/nrf52840/uf2 72 :goals: build 73 74#. Flash it onto the board. You may need to mount the device. 75 76 .. code-block:: console 77 78 west flash 79 80 When this command exits, observe the red LED on the board blinking, 81 82 83Debugging 84========= 85 86You may debug this board using the broken out pads on the back. 87PyOCD and openOCD can be used to flash and debug this board. 88 89Recovery 90======== 91 92In case of a error resulting in a board's bootloader becoming inaccessible, 93it is possible to flash anything directly using openOCD: 94 95#. Setup OpenOCD correctly, here for WCH linkE in ARM mode: 96 97 .. code-block:: console 98 99 openocd -f interface/cmsis-dap.cfg -f target/nrf52.cfg 100 101Note interface and target folders are from openOCD's tcl folder. 102 103#. Connect to openOCD, for example with telnet or GDB: 104 105 .. code-block:: console 106 107 telnet localhost 4444 108 109 .. code-block:: console 110 111 target extended-remote localhost:3333 112 113#. Erase flash: 114 115 .. code-block:: console 116 117 reset halt 118 nrf5 mass_erase 119 120or 121 122 .. code-block:: console 123 124 mon reset halt 125 mon nrf5 mass_erase 126 127#. Flash Bootloader 128 129 .. code-block:: console 130 131 flash write_image erase nice_nano_bootloader-0.9.2_s140_6.1.1.hex 132 133or 134 135 .. code-block:: console 136 137 mon flash write_image erase nice_nano_bootloader-0.9.2_s140_6.1.1.hex 138 139References 140********** 141 142.. target-notes:: 143 144.. _Nice!Nano website: 145 https://nicekeyboards.com/docs/nice-nano/ 146.. _Clone Wiki: 147 https://github.com/joric/nrfmicro/wiki/Alternatives 148.. _Nice!Nano Documentation: 149 https://nicekeyboards.com/docs/nice-nano/pinout-schematic 150