Difference between revisions of "STM32L476 Discovery"

From SEGGER Wiki
Jump to: navigation, search
(Created page with "=== Example implementation === As described above, the reference flash algorithm is based on the Open Flash Loader and therefore needs to be added manually using a JLinkDevice...")
 
Line 1: Line 1:
=== Example implementation ===
+
=== QSPI Flash Programming Support ===
As described above, the reference flash algorithm is based on the Open Flash Loader and therefore needs to be added manually using a JLinkDevices.xml file. An example JLinkDevices.xml entry as well as the used pinout in the example flash algorithm
 
   
  +
Before continuing with this article, please read the generic article about QSPI flash programming support on STM32L4 devices ([https://wiki.segger.com/STM32L4#STM32L446xx_.28Q.29SPI_support STM32L446xx (Q)SPI support]).
   
  +
=== Example implementation ===
is given below. This example assumes a Winbond W25Q16DV (2MB flash) connected to the Quad-SPI interface of the STM32F446xx. For further information regarding the Open Flash Loader and how to use the JLinkDevices.xml file, please refer to the J-Link User Manual (UM08001), chapter ''10 Adding Support for New Devices''.
 
  +
As described in the generic article, the reference flash algorithm is based on the SEGGER ''Open Flashloader'' and therefore needs to be added manually using a JLinkDevices.xml file. An example JLinkDevices.xml file as well as pinout used on the STM32L476 Discovery board, is given below. This example assumes a Micron N25Q128A (16MB flash) connected to the Quad-SPI interface of the STM32L476G. For further information regarding the ''Open Flashloader'' and how to use the JLinkDevices.xml file, please refer to the J-Link User Manual (UM08001), chapter ''10 Open Flash Loader''.
   
====Quad-SPI interface pins====
+
====Quad-SPI Interface Pins====
 
The example algorithm uses the following port pins to interface the (Q)SPI flash.
 
The example algorithm uses the following port pins to interface the (Q)SPI flash.
 
{| class="wikitable"
 
{| class="wikitable"
Line 11: Line 12:
 
! Alternate function !! Port / Pin
 
! Alternate function !! Port / Pin
 
|-
 
|-
| QUADSPI_BK1_IO0 || PF8
+
| QSPI_CLK || PE10
 
|-
 
|-
| QUADSPI_BK1_IO1 || PF9
+
| QSPI_CS || PE11
 
|-
 
|-
| QUADSPI_BK1_IO2 || PE2
+
| QSPI_D0 || PE12
 
|-
 
|-
| QUADSPI_BK1_IO3 || PF6
+
| QSPI_D1 || PE13
 
|-
 
|-
| QUADSPI_CLK || PB2
+
| QSPI_D2 || PE14
 
|-
 
|-
| QUADSPI_BK1_NCS || PG6
+
| QSPI_D3 || PE15
 
|}
 
|}
   
Line 28: Line 29:
 
<Device>
 
<Device>
 
<ChipInfo Vendor="ST"
 
<ChipInfo Vendor="ST"
Name="STM32F446ZE"
+
Name="STM32L476ZG"
WorkRAMAddr="0x20000000"
 
WorkRAMSize="0x18000"
 
 
Core="JLINK_CORE_CORTEX_M4" />
 
Core="JLINK_CORE_CORTEX_M4" />
<FlashBankInfo Name="Internal Flash"
+
<FlashBankInfo Name="QSPI Flash"
 
BaseAddr="0x90000000"
 
BaseAddr="0x90000000"
MaxSize="0x200000"
+
MaxSize="0x01000000"
Loader="ST_STM32F446_Reference.elf"
+
Loader="ST_STM32L476_Disco.elf"
 
LoaderType="FLASH_ALGO_TYPE_OPEN" />
 
LoaderType="FLASH_ALGO_TYPE_OPEN" />
 
</Device>
 
</Device>

Revision as of 18:17, 27 October 2016

QSPI Flash Programming Support

Before continuing with this article, please read the generic article about QSPI flash programming support on STM32L4 devices (STM32L446xx (Q)SPI support).

Example implementation

As described in the generic article, the reference flash algorithm is based on the SEGGER Open Flashloader and therefore needs to be added manually using a JLinkDevices.xml file. An example JLinkDevices.xml file as well as pinout used on the STM32L476 Discovery board, is given below. This example assumes a Micron N25Q128A (16MB flash) connected to the Quad-SPI interface of the STM32L476G. For further information regarding the Open Flashloader and how to use the JLinkDevices.xml file, please refer to the J-Link User Manual (UM08001), chapter 10 Open Flash Loader.

Quad-SPI Interface Pins

The example algorithm uses the following port pins to interface the (Q)SPI flash.

Alternate function Port / Pin
QSPI_CLK PE10
QSPI_CS PE11
QSPI_D0 PE12
QSPI_D1 PE13
QSPI_D2 PE14
QSPI_D3 PE15

JLinkDevices.xml

<Database>
  <Device>
    <ChipInfo Vendor="ST"
              Name="STM32L476ZG"
              Core="JLINK_CORE_CORTEX_M4" />
    <FlashBankInfo Name="QSPI Flash"
                   BaseAddr="0x90000000"
                   MaxSize="0x01000000"
                   Loader="ST_STM32L476_Disco.elf"
                   LoaderType="FLASH_ALGO_TYPE_OPEN" />
  </Device>
</Database>

Flash algorithm (*.elf)

This file contains the program routines used by the J-Link DLL during flash programming.

IAR example project

The example project contains a simple counter loop which is linked into the (Q)SPI flash memory region @ address 0x90000000. The project includes the JLinkDevices.xml file as well as the ST_STM32F446_Reference.elf. It runs out-of-the-box. Please note, that IAR EWARM must at least use the J-Link DLL version V6.01a, which supports the Open Flash Loader.