Difference between revisions of "STM32 Cube Programmer"

From media_wiki
Jump to: navigation, search
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
Erases, programs, views and verifies the content of the device Flash memory
+
Erases, programs, views and verifies the content of the device Flash memory<BR>
 
+
[[File:STM32CubeProg.PNG |550px|Mid]]<BR>
'''Getting Started'''
+
[[File:ST-Link-config-menu.PNG |175px|right]] <BR>
 +
'''Getting Started'''<BR>
 
Setting up and connecting your NUCLEO board.
 
Setting up and connecting your NUCLEO board.
  
Line 19: Line 20:
 
   Example: Address '''0x08000000''' Size '''0x8000''' Data Width '''8 bit'''
 
   Example: Address '''0x08000000''' Size '''0x8000''' Data Width '''8 bit'''
 
   Size reference:
 
   Size reference:
         0X400 X 4 = 1600 (default)
+
         0X400 = 1024 (default)
       0X4000 X 4 = 16000
+
       0X4000 = 16K
       0X8000 X 4 = '''32000''' (full size of flash for NUCLEO-C0316)
+
       0X8000 = '''32K''' (full size of flash for NUCLEO-C0316)
 +
      0x10000 = 64K
 
   3. Select '''Read''' or '''Read all'''
 
   3. Select '''Read''' or '''Read all'''
  
Line 31: Line 33:
 
       The start address of hex, srec, or ELF files, is displayed in the '''“Address”''' field.
 
       The start address of hex, srec, or ELF files, is displayed in the '''“Address”''' field.
 
       For a binary file it is '''0x0''' in the '''“Address”''' field.
 
       For a binary file it is '''0x0''' in the '''“Address”''' field.
Memory erasing
 
Memory sectors are displayed in the right-hand panel showing the start address and the size of each sector.
 
To erase one or more sectors:
 
1. Select them in the first column.
 
2. Then click on the “Erase selected sectors” button.
 
The “Full chip erase” button erases the whole memory.
 
  
 +
'''Memory erasing'''
 +
 +
Memory sectors are displayed in the right-hand panel showing the start address and the size of each sector.
 +
To erase one or more sectors:
 +
  1. Select them in the '''first''' column.
 +
  2. Then click on the '''“Erase selected sectors”''' button.
 +
  The '''“Full chip erase”''' button erases the whole memory.
 +
[[File:Erasing-Flash.PNG |350px|mid]] <br>
 
'''Memory programming'''
 
'''Memory programming'''
To program a memory, go through the following steps:
+
To program a memory, go through the following steps:
 
   1. Click on the browse button and select the file to be programmed.  
 
   1. Click on the browse button and select the file to be programmed.  
 
     The supported formats are:  
 
     The supported formats are:  
Line 46: Line 50:
 
       Intel hex files (.hex)   
 
       Intel hex files (.hex)   
 
       Motorola S-record files (.Srec).
 
       Motorola S-record files (.Srec).
   2. In case of programming a '''binary''' file, the address must be set.
+
   2. In case of programming a '''binary''' file, the address must be set. Example: '''0x0800000'''
 
   3. Select the programming options:
 
   3. Select the programming options:
 
       – Verify after programming: read back the programmed memory and compare it byte  
 
       – Verify after programming: read back the programmed memory and compare it byte  
Line 56: Line 60:
 
   4. Click on the ”Start programming” button to start programming.
 
   4. Click on the ”Start programming” button to start programming.
 
     The progress bar on the bottom of the window shows the progress of the erase and programming operations.
 
     The progress bar on the bottom of the window shows the progress of the erase and programming operations.
 +
 +
----
 +
==[[ STM32 Workshops ]]==
 +
==[[ Main Page ]]==

Latest revision as of 01:07, 25 February 2023

Erases, programs, views and verifies the content of the device Flash memory
Mid

ST-Link-config-menu.PNG


Getting Started
Setting up and connecting your NUCLEO board.

 1. Start STM32 Cube Programmer application.
 2. Attach the USB cable to the NUCLEO board
 3. Attach the USB cable to your computer.
 4. Find the ST-LINK configuration panel located on the right side of the Main Menu.
 5. Locate Under the Not Connected status a Blue (ST-Link) button with a drop down menu.
 6. Ensure ST-Link is selected and not UART or USB in the drop down menu.
 7. Click on the Green Connect button to connect the NUCLEO board with the built in ST-Link to the computer
 8. Ensure the Not connected status message has changed to Connected and the ST-LINK configuration should be greyed out. 
 9. Ensure you are connected by reading the Target information.

Reading and displaying target memory

 1. Ensure the ST-Link is connected and working as stated above.
 2. Specify the Address and the Size of the data to be read.
 Example: Address 0x08000000 Size 0x8000 Data Width 8 bit
 Size reference:
       0X400 =  1024 (default)
      0X4000 =  16K
      0X8000 =  32K (full size of flash for NUCLEO-C0316)
      0x10000 = 64K
 3. Select Read or Read all

Reading and displaying a file from a previously saved program.

 1. To open and display a file, just click on the “+” and select “Open File”
 2. Select the file from the list in the directory.
      Example: myfile.bin
      The file size is displayed in the “Size” field.
      The start address of hex, srec, or ELF files, is displayed in the “Address” field.
      For a binary file it is 0x0 in the “Address” field.

Memory erasing

Memory sectors are displayed in the right-hand panel showing the start address and the size of each sector. 
To erase one or more sectors: 
 1. Select them in the first column.
 2. Then click on the “Erase selected sectors” button.
 The “Full chip erase” button erases the whole memory.

mid
Memory programming

To program a memory, go through the following steps:
 1. Click on the browse button and select the file to be programmed. 
    The supported formats are: 
      binary files (.bin), 
      ELF files (.elf, .axf, .out) 
      Intel hex files (.hex)  
      Motorola S-record files (.Srec).
 2. In case of programming a binary file, the address must be set. Example: 0x0800000
 3. Select the programming options:
      – Verify after programming: read back the programmed memory and compare it byte 
        per byte with the file.
      – Skip flash memory erase before programming: if checked, the memory is not 
        erased before programming. This option must be checked only when you are sure 
        that the target memory is already erased.
      – Run after programming: start the application just after programming.
 4. Click on the ”Start programming” button to start programming.
    The progress bar on the bottom of the window shows the progress of the erase and programming operations.

STM32 Workshops

Main Page