Getting Information about STLink and STM32 Devices (with examples)

Getting Information about STLink and STM32 Devices (with examples)

1: Display amount of program memory available

$ st-info --flash

Motivation: This command allows you to quickly retrieve information about the program memory available on a connected STM32 device. Knowing the amount of program memory is crucial for planning and optimizing your application’s size.

Explanation: The --flash argument is used to display the amount of program memory available on the STM32 device. Flash memory is where the program code and constants are stored.

Example Output:

Flash memory: 
  Start: 0x08000000
  Size: 512 KiB
  Page Size: 2048 B
  Number of Pages: 256

The output above shows that the program memory (flash) starts at address 0x08000000 and has a size of 512 KiB.

2: Display amount of SRAM memory available

$ st-info --sram

Motivation: Understanding the available SRAM memory is important when developing applications for STM32 devices, as SRAM is used for storing variables and dynamically allocated memory during program execution.

Explanation: The --sram argument is used to display the amount of SRAM (Static Random-Access Memory) available on the STM32 device. SRAM is faster than flash memory and is used for temporary data storage.

Example Output:

SRAM memory: 
  Start: 0x20000000
  Size: 96 KiB

The output above shows that the SRAM memory starts at address 0x20000000 and has a size of 96 KiB.

3: Display summarized information of the device

$ st-info --probe

Motivation: This command provides a quick summary of the connected STLink and STM32 device. It is useful for verifying the device’s presence, identifying it, and confirming the connection.

Explanation: The --probe argument is used to display summarized information about the connected STLink and STM32 device. This includes the device’s ID, flash memory information, SRAM information, and version details.

Example Output:

Device summary: 
  STLink Version: V2.1-1
  STM32 Device ID: 0x440
  Core ID: ARMv7-M
  Flash memory: 
    Start: 0x08000000
    Size: 512 KiB
    Page Size: 16384 B
    Number of Pages: 32
  SRAM memory: 
    Start: 0x20000000
    Size: 96 KiB

The output above provides detailed information about the connected STLink version, STM32 device ID, core ID, flash memory details, and SRAM memory details. This information helps in confirming the device’s identity and understanding its memory characteristics.

Conclusion

The st-info command provides valuable information about connected STLink and STM32 devices. This article demonstrated three different use cases of the command: displaying the amount of program memory available, displaying the amount of SRAM memory available, and obtaining summarized information about the device. Utilizing these command options allows developers to better understand the memory resources and characteristics of their STM32 devices, facilitating more efficient and optimized firmware development.

Related Posts

How to use the command 'w' (with examples)

How to use the command 'w' (with examples)

The ‘w’ command in Linux is used to display who is currently logged in and their processes.

Read More
Using git commits-since (with examples)

Using git commits-since (with examples)

Display commits since yesterday git commits-since yesterday Motivation Checking the commits made since yesterday can be useful for reviewing the work done in the past day and staying updated with recent changes.

Read More
How to use the command 'docker rmi' (with examples)

How to use the command 'docker rmi' (with examples)

The docker rmi command is used to remove one or more Docker images.

Read More