Skip to main content
CWedg.1
Associate II
January 27, 2021
Solved

How can we determine the flash memory size of STM32L4 processors?

  • January 27, 2021
  • 4 replies
  • 2818 views

We have PCB assemblies built that contain STM324L7 with 1M and 2M flash memory. How can we determine the flash memory size using a JTAG connection (e.g. by reading a register value)?

This topic has been closed for replies.
Best answer by CWedg.1

Found it...

Flash size is part of the Device Electronic signature (section 58 of the reference manual). Details on the MCU Device ID Code is in Debug Support, section 57.

4 replies

Andrew Neil
Super User
January 27, 2021

The title says L4, but the text says L7 - so which is it?

Have you looked in the datasheet for registers which may either tell you directly, or identify the chip so that you can work it out?

EDIT

Actually, in ST's documentation structure, it would probably be in the Reference Manual, rather than the datasheet.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Uwe Bonnes
Chief
January 27, 2021

Most, if not all STM32 have a chip size register. From the type of STM32 you have, get the address of that register and read it.

CWedg.1
CWedg.1AuthorBest answer
Associate II
January 27, 2021

Found it...

Flash size is part of the Device Electronic signature (section 58 of the reference manual). Details on the MCU Device ID Code is in Debug Support, section 57.

Andrew Neil
Super User
January 27, 2021

Excellent: so you can select that as the 'Best' answer - which flags the thread as 'Answered'.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
mcdino.5338840562911753E12
Associate III
March 23, 2021

@CWedg.1​  I am facing the same issue here. I have 2 STM32L4 with 128MByte and 256MByte flash size respectively in the same system and want to differentiante using the memory size. How did you succeed in reading the memory size? Using the flash size data register? Thanks for any help