|
| 1 | +.. _stm32l1_disco_board: |
| 2 | + |
| 3 | +ST STM32LDISCOVERY and 32L152CDISCOVERY |
| 4 | +####################################### |
| 5 | + |
| 6 | +Overview |
| 7 | +******** |
| 8 | + |
| 9 | +The two generations of the STM32L1 Discovery development boards come with |
| 10 | +an integrated ST-LINK/V2 debugger and programmer. The boards have a |
| 11 | +24-segment LCD and a touch slider, along with two user LEDs and a user button. |
| 12 | +Support circuitry for measuring power consumption is also available. |
| 13 | +It also comes with a comprehensive STM32 software HAL library and various |
| 14 | +packaged software examples. |
| 15 | + |
| 16 | +There |
| 17 | +are two variants of the board: |
| 18 | + |
| 19 | +- STM32LDISCOVERY targets STM32L152RBT6, with 128K flash, 16K RAM |
| 20 | +- 32L152CDISCOVERY targets STM32L152RCT6, with 256K flash, 32K RAM |
| 21 | + |
| 22 | +The STM32LDISCOVERY is no longer sold, but was widely available. The current |
| 23 | +configuration assumes only 128K flash and 16K RAM, so it builds and runs |
| 24 | +on both variants out of the box. |
| 25 | + |
| 26 | +.. image:: img/stm32l1_disco.jpg |
| 27 | + :width: 564px |
| 28 | + :height: 600px |
| 29 | + :align: center |
| 30 | + :alt: STM32LDISCOVERY |
| 31 | + |
| 32 | +More information about the board can be found at the `STM32LDISCOVERY website`_. |
| 33 | + |
| 34 | +Hardware |
| 35 | +******** |
| 36 | + |
| 37 | +The STM32 Discovery board features: |
| 38 | + |
| 39 | +- On-board ST-LINK/V2 with selection mode switch to use the kit as a standalone |
| 40 | + ST-LINK/V2 (with SWD connector for programming and debugging) |
| 41 | +- Board power supply: through USB bus or from an external 5 V supply voltage |
| 42 | +- External application power supply: 3 V and 5 V |
| 43 | +- Four LEDs: |
| 44 | + |
| 45 | + - LD1 (red) for 3.3 V power on |
| 46 | + - LD2 (red/green) for USB communication |
| 47 | + - LD3 (green) for PC9 output |
| 48 | + - LD4 (blue) for PC8 output |
| 49 | +- Two push buttons (user and reset) |
| 50 | +- Extension header for all LQFP64 I/Os for quick connection to prototyping board |
| 51 | + and easy probing |
| 52 | + |
| 53 | +More information about STM32L151x can be found in the `STM32L1x reference manual`_. |
| 54 | + |
| 55 | +Supported Features |
| 56 | +================== |
| 57 | + |
| 58 | +The Zephyr stm32l1_disco board configuration supports the following hardware features: |
| 59 | + |
| 60 | +.. list-table:: Supported hardware |
| 61 | + :header-rows: 1 |
| 62 | + |
| 63 | + * - Interface |
| 64 | + - Controller |
| 65 | + - Driver/component |
| 66 | + * - NVIC |
| 67 | + - on-chip |
| 68 | + - nested vector interrupt controller |
| 69 | + * - UART |
| 70 | + - on-chip |
| 71 | + - serial port-polling |
| 72 | + serial port-interrupt |
| 73 | + * - PINMUX |
| 74 | + - on-chip |
| 75 | + - pinmux |
| 76 | + * - GPIO |
| 77 | + - on-chip |
| 78 | + - gpio |
| 79 | + * - CLOCK |
| 80 | + - on-chip |
| 81 | + - reset and clock control |
| 82 | + * - FLASH |
| 83 | + - on-chip |
| 84 | + - flash memory |
| 85 | + * - WATCHDOG |
| 86 | + - on-chip |
| 87 | + - window watchdog |
| 88 | + * - I2C |
| 89 | + - on-chip |
| 90 | + - i2c |
| 91 | + * - SPI |
| 92 | + - on-chip |
| 93 | + - spi |
| 94 | + |
| 95 | +Other hardware features are not yet supported in this Zephyr port. |
| 96 | + |
| 97 | +The default configuration can be found in the defconfig file: |
| 98 | +``boards/arm/stm32l1_disco/stm32l1_disco_defconfig`` |
| 99 | + |
| 100 | +Connections and IOs |
| 101 | +=================== |
| 102 | + |
| 103 | +Each of the GPIO pins can be configured by software as output (push-pull or open-drain), as |
| 104 | +input (with or without pull-up or pull-down), or as peripheral alternate function. Most of the |
| 105 | +GPIO pins are shared with digital or analog alternate functions. All GPIOs are high current |
| 106 | +capable except for analog inputs. |
| 107 | + |
| 108 | +Default Zephyr Peripheral Mapping: |
| 109 | +---------------------------------- |
| 110 | + |
| 111 | +.. rst-class:: rst-columns |
| 112 | + |
| 113 | +- UART_1_TX : PA9 |
| 114 | +- UART_1_RX : PA10 |
| 115 | +- UART_2_TX : PA2 |
| 116 | +- UART_2_RX : PA3 |
| 117 | +- I2C1_SCL : PB6 |
| 118 | +- I2C1_SDA : PB7 |
| 119 | +- I2C2_SCL : PB10 |
| 120 | +- I2C2_SDA : PB11 |
| 121 | +- SPI1_NSS : PA4 |
| 122 | +- SPI1_SCK : PA5 |
| 123 | +- SPI1_MISO : PA6 |
| 124 | +- SPI1_MOSI : PA7 |
| 125 | +- SPI2_NSS : PB12 |
| 126 | +- SPI2_SCK : PB13 |
| 127 | +- SPI2_MISO : PB14 |
| 128 | +- SPI2_MOSI : PB15 |
| 129 | + |
| 130 | +For mode details please refer to `STM32L1DISCOVERY board User Manual`_. |
| 131 | + |
| 132 | +Programming and Debugging |
| 133 | +************************* |
| 134 | + |
| 135 | +Applications for the ``stm32l1_disco`` board configuration can be built and |
| 136 | +flashed in the usual way (see :ref:`build_an_application` and |
| 137 | +:ref:`application_run` for more details). |
| 138 | + |
| 139 | +Flashing |
| 140 | +======== |
| 141 | + |
| 142 | +STM32L1DISCOVERY board includes an ST-LINK/V2 embedded debug tool interface. |
| 143 | +This interface is supported by the openocd version included in the Zephyr SDK. |
| 144 | + |
| 145 | +Flashing an application |
| 146 | +----------------------- |
| 147 | + |
| 148 | +Here is an example for the :ref:`blinky-sample` application. |
| 149 | + |
| 150 | +.. zephyr-app-commands:: |
| 151 | + :zephyr-app: samples/basic/blinky |
| 152 | + :board: stm32l1_disco |
| 153 | + :goals: build flash |
| 154 | + |
| 155 | +You will see the LED blinking every second. |
| 156 | + |
| 157 | +Debugging |
| 158 | +========= |
| 159 | + |
| 160 | +You can debug an application in the usual way. Here is an example for the |
| 161 | +:ref:`blinky-sample` application. |
| 162 | + |
| 163 | +.. zephyr-app-commands:: |
| 164 | + :zephyr-app: samples/basic/blinky |
| 165 | + :board: stm32l1_disco |
| 166 | + :maybe-skip-config: |
| 167 | + :goals: debug |
| 168 | + |
| 169 | +References |
| 170 | +********** |
| 171 | + |
| 172 | +.. target-notes:: |
| 173 | + |
| 174 | +.. _STM32LDISCOVERY website: |
| 175 | + https://www.st.com/en/evaluation-tools/32l152cdiscovery.html |
| 176 | + |
| 177 | +.. _STM32L1x reference manual: |
| 178 | + https://www.st.com/resource/en/reference_manual/cd00240193.pdf |
| 179 | + |
| 180 | +.. _STM32L1DISCOVERY board User Manual: |
| 181 | + https://www.st.com/resource/en/user_manual/dm00027954.pdf |
0 commit comments