BlueNRG-2 | Unable to debug over STLINK/V2 | Multiple Issue

Discussions concerning TrueSTUDIO for STM32 9.0.0 and later versions.

Moderators: Markus Girdland, Mattias Norlander

anshuman
Posts: 1
Joined: Thu Jun 28, 2018 9:08 am

BlueNRG-2 | Unable to debug over STLINK/V2 | Multiple Issue

Postby anshuman » Thu Jun 28, 2018 10:37 am

Hi All,

Please help I'm stuck with this, I am currently having some difficulties while debugging the BlueNRG-2 "STEVAL-IDB008V2" over STLink/v2.

PROBLEM FACED : When trying to debug and flash the code using TrueStudio getting following error message
Failure at line:13 in 'Target Software Startup Scripts'. Please edit the debug configuration settings. Error writing data to flash


Error Atollic - Error writing data to flash.jpg


Details:

Board : STEVAL-IDB008V2
BlueNRG2 Part Number : BLE232ES
IDE Version : Version: 9.0.1, Build id: 20180420-1214
Project : Imported from BlueNRG-2 Navigator Examples
Example : BLE_SensorDemo_BlueMSapp
Build Status : Success
Hardware Test : OK - Tested by flashing code using :
1. BlueNRG-2 Navigator over USB-Serial, and
2. BlueNRG-1 ST-Link Utility over STLINK/V2.

Additional Information

Console Message while debug

Code: Select all

Atollic TrueSTUDIO gdbserver for ST-Link. Version 4.2.2 (WIN32 2018-02-26 16:20:21 15675)
Copyright (c) 2018, STMicroelectronics. All rights reserved.


Starting server with the following options:
        Persistant Mode            : Disabled
        LogFile Name               : debug_log.txt
        Logging Level              : 31
        Listen Port Number         : 61234
        Status Refresh Delay       : 15s
        Verbose Mode               : Enabled
        SWD Debug                  : Enabled

Atollic TrueSTUDIO gdbserver for ST-Link. Version 4.2.2 (WIN32 2018-02-26 16:20:21 15675)
Hardware watchpoint supported by the target
STM32 device: Flash size =256
Enter STM32_AppReset() function
NVIC_DFSR_REG = 0x00000009
XPSR = 0xC1000000
ST_LINK Major version =2 Jtag version =31
ST_LINK VID=1155 PID=14152
ST_LINK device status: HALT_MODE
ST_LINK detects target voltage =3.24 Volt
ST-Link device initialization OK
Waiting for debugger connection...
Waiting for connection on port 61234...
Accepted connection on port 61234...
Debugger connected
ST_LINK device status: HALT_MODE
Reading 0x4 bytes of memory from addr 0x100006fa
Reading 0x2 bytes of memory from addr 0x100006fa
Enter STM32_AppReset() function
NVIC_DFSR_REG = 0x00000009
XPSR = 0xC1000000
Flash erase: Address= 0x10040000, Length=92160
Flash write: Address= 0x10040000, Length=192
Programming flash..
STM32 device: flash programming successful 0x10040000
Flash write completed in 0.198000 seconds, 0.946970kB/s
Flash write: Address= 0x100400c0, Length=2944
Programming flash..
STM32 device: flash programming successful 0x100400c0
Flash write completed in 0.301000 seconds, 9.551495kB/s
Flash write: Address= 0x10040c40, Length=2960
Programming flash..
STM32 device: flash programming successful 0x10040c40
Flash write completed in 0.305000 seconds, 9.477459kB/s
Flash write: Address= 0x100417d0, Length=2944
Programming flash..
STM32 device: flash programming successful 0x100417d0
Flash write completed in 0.304000 seconds, 9.457237kB/s
Flash write: Address= 0x10042350, Length=2944
Programming flash..
STM32 device: flash programming successful 0x10042350
Flash write completed in 0.307000 seconds, 9.364821kB/s
Flash write: Address= 0x10042ed0, Length=2944
Programming flash..
STM32 device: flash programming successful 0x10042ed0
Flash write completed in 0.311000 seconds, 9.244373kB/s
Flash write: Address= 0x10043a50, Length=1896
Programming flash..
STM32 device: flash programming successful 0x10043a50
Flash write completed in 0.275000 seconds, 6.732954kB/s
Flash write: Address= 0x100441b8, Length=108
Programming flash..
STM32 device: flash programming successful 0x100441b8
Flash write completed in 0.202000 seconds, 0.522123kB/s
Flash write: Address= 0x10044224, Length=48
Programming flash..
STM32 device: flash programming successful 0x10044224
Flash write completed in 0.264000 seconds, 0.177557kB/s
Flash write: Address= 0x10044254, Length=124
Programming flash..
STM32 device: flash programming successful 0x10044254
Flash write completed in 0.204000 seconds, 0.593597kB/s
Flash write: Address= 0x100442d0, Length=66
Programming flash..
STM32 device: flash programming successful 0x100442d0
Flash write completed in 0.214000 seconds, 0.301183kB/s
Flash write: Address= 0x10044312, Length=16
Flash write completed in 0.057000 seconds, 0.274123kB/s
Reading 0x20 bytes of memory from addr 0xf0000fd0
Reading 0x4 bytes of memory from addr 0xffffffff
Reading 0x4 bytes of memory from addr 0xffffffff
Enter STM32_AppReset() function
NVIC_DFSR_REG = 0x0000000B
XPSR = 0xC1000000


Startup Scripts -> Target Software Startup Scripts

Code: Select all

# Set flash parallelism mode to 32, 16, or 8 bit when using STM32 F2/F4 microcontrollers
# Uncomment next line, 2=32 bit, 1=16 bit and 0=8 bit parallelism mode
#monitor flash set_parallelism_mode 2

# Set character encoding
set host-charset CP1252
set target-charset CP1252

# Reset to known state
monitor reset

# Load the program executable
load      

# Reset the chip to get to a known state. Remove "monitor reset" command
#  if the code is not located at default address and does not run by reset.
monitor reset

# Enable Debug connection in low power modes (DBGMCU->CR)
set *0xE0042004 = (*0xE0042004) | 0x7
# Set a breakpoint at main().
tbreak main

# Run to the breakpoint.
continue
You do not have the required permissions to view the files attached to this post.

dilbert
Posts: 2
Joined: Fri Sep 14, 2018 3:54 pm

Re: BlueNRG-2 | Unable to debug over STLINK/V2 | Multiple Issue

Postby dilbert » Sat Sep 15, 2018 1:53 pm

I have having same issue using debugger to run the code on board.
Do you have any luck how to get it working ?

ntitley
Posts: 5
Joined: Tue Jan 22, 2019 10:50 am

Re: BlueNRG-2 | Unable to debug over STLINK/V2 | Multiple Issue

Postby ntitley » Wed Jan 23, 2019 2:46 pm

I'm also having problems with debugging a STEVAL-IDB008V2 with an STLINK/V2. Has anyone actually successfully done this? I'm currently unable to even use the STLINK utility to connect to the board.

Steeeker
Posts: 2
Joined: Sun Dec 02, 2018 11:27 pm

Re: BlueNRG-2 | Unable to debug over STLINK/V2 | Multiple Issue

Postby Steeeker » Tue Feb 05, 2019 6:45 am

Hi,

I can see posts dating back many months regarding this issue. I have a custom designed board using BlueNRG-2, and I use an external BlueNRG programming tool to load the device; this is cumbersome, but it works.

Not being able to single-step, or set breakpoints for debugging is a major pain!

Mattias or Markus, can you please give us an update regarding progress with Debugging with BlueNRG-2 via STLINK/V2? Is there a Beta version of Atollic that we can try?

SteveK

ntitley
Posts: 5
Joined: Tue Jan 22, 2019 10:50 am

Re: BlueNRG-2 | Unable to debug over STLINK/V2 | Multiple Issue

Postby ntitley » Tue Feb 05, 2019 10:55 am

I eventually gave in and bought a Segger J-Link. This works fine, programs the board and lets me single step and put breakpoints and examine variables. The STLINK seems to be a waste of time and money, at least for the BlueNRG-2

Steeeker
Posts: 2
Joined: Sun Dec 02, 2018 11:27 pm

Re: BlueNRG-2 | Unable to debug over STLINK/V2 | Multiple Issue

Postby Steeeker » Wed Feb 06, 2019 5:18 am

Excellent, thank you for the tip. I'll purchase a J-Link too, that'll help a lot.

Steve


Return to “TrueSTUDIO for STM32 discussions”

Who is online

Users browsing this forum: No registered users and 1 guest