cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot download program to the board using STM32CubeIDE on my Mac

Spaced Cowboy
Associate III

I have an STM32F723 discovery board, and am getting started with the default application for that board within STM32Cube.

Compiling is fine. Downloading the program is not:

61234STMicroelectronics ST-LINK GDB server. Version 5.3.2
Copyright (c) 2019, STMicroelectronics. All rights reserved.
 
Starting server with the following options:
        Persistent Mode            : Disabled
        Logging Level              : 1
        Listen Port Number         : 61234
        Status Refresh Delay       : 15s
        Verbose Mode               : Disabled
        SWD Debug                  : Enabled
 
Waiting for debugger connection...
Debugger connected
      -------------------------------------------------------------------
                        STM32CubeProgrammer v2.2.0                  
      -------------------------------------------------------------------
 
 
 
Log output file:   /tmp/STM32CubeProgrammer_hvYFoH.log
ST-LINK SN  : 0672FF495150807567094632
ST-LINK FW  : V2J34M25
Voltage     : 3.20V
SWD freq    : 4000 KHz
Connect mode: Under Reset
Reset mode  : Hardware reset
Cannot identify the device
Error: unknown or unsupported device (DevID = 0x0000)
 
 
Memory Programming ...
Opening and parsing file: ST-LINK_GDB_server_sAVdCQ.srec
  File          : ST-LINK_GDB_server_sAVdCQ.srec
  Size          : 73708 Bytes
  Address       : 0x08000000 
 
 
Erasing memory corresponding to segment 0:
Download in Progress:
 
 
File download complete
Time elapsed during download operation: 00:00:00.517
 
 
 
Verifying ...
 
 
 
 
Error: Data mismatch found at address  0x08000000 (byte = 0x3A instead of 0x00)
 
 
Error: Download verification failed
 
 
Encountered Error when opening /Applications/STM32CubeIDE.app/Contents/Eclipse/plugins/com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.macos64_1.1.0.201910081157/tools/bin/STM32_Programmer_CLI
Error in STM32CubeProgrammer
Debugger connection lost.
Shutting down...

I know the board is working because using the freeware tools ("sudo port install stlink") I can do:

simon% st-flash erase
st-flash 1.5.1
2019-10-22T10:39:19 INFO: Loading device parameters....
2019-10-22T10:39:19 INFO: Device connected is: F72 device, id 0x10006452
2019-10-22T10:39:19 INFO: SRAM size: 0x40000 bytes (256 KiB), Flash: 0x80000 bytes (512 KiB) in pages of 2048 bytes
Mass erasing......
 
simon% arm-elf-objcopy -O ihex usbtest.elf usbtest.ihex
 
simon% st-flash write usbtest.ihex 0x08000000
st-flash 1.5.1
2019-10-22T10:39:29 INFO: Loading device parameters....
2019-10-22T10:39:29 INFO: Device connected is: F72 device, id 0x10006452
2019-10-22T10:39:29 INFO: SRAM size: 0x40000 bytes (256 KiB), Flash: 0x80000 bytes (512 KiB) in pages of 2048 bytes
2019-10-22T10:39:29 INFO: Attempting to write 207401 (0x32a29) bytes to stm32 address: 134217728 (0x8000000)
2019-10-22T10:39:29 WARN: unaligned len 0x32a29 -- padding with zero
Flash page at addr: 0x08020000 erasedEraseFlash - Sector:0x5 Size:0x20000 
2019-10-22T10:39:33 INFO: Finished erasing 6 pages of 131072 (0x20000) bytes
2019-10-22T10:39:33 INFO: Starting Flash write for F2/F4/L4
2019-10-22T10:39:33 INFO: Successfully loaded flash loader in sram
enabling 32-bit flash writes
size: 32768
size: 32768
size: 32768
size: 32768
size: 32768
size: 32768
size: 10794
2019-10-22T10:39:36 INFO: Starting verification of write complete
2019-10-22T10:39:38 INFO: Flash written and verified! jolly good!

The debugger configuration looks like:

0690X00000AqjhsQAB.png

Any hints ?

3 REPLIES 3
Spaced Cowboy
Associate III

Well, I gave up.

I installed a linux VNC connection instead, and can program the device from there, at least after altering the /etc/udev/rules.d/49-stlinkv2-1.rules file to make the linux device have 666 permissions. The default seems to need a group of "plugdev" which doesn't exist on Centos 7.

It'd be nice if the Mac version worked though - VNC isn't an ideal solution

Hey, I had the same issue and resolved it by setting Debug Configurations -> Debugger -> Debug probe = ST-LINK (OpenOCD)

INT3GRATION
Associate II

@Hingle McCringleberry

I can confirm: changing `ST-LINK (ST-LINK GBD server)` to -> `ST-LINK (OpenOCD)` does work!!!