30 second delay in starting project on STM32F769 Discovery

Discuss how to use the features of Atollic TrueSTUDIO, including the editor, assembler, C/C++ compiler, linker, debugger, static code analysis and team collaboration tools.

Moderators: Markus Girdland, Mattias Norlander

Antti@Hefio
Posts: 1
Joined: Fri Jun 29, 2018 12:45 pm

30 second delay in starting project on STM32F769 Discovery

Postby Antti@Hefio » Wed Sep 05, 2018 10:36 am

Hi,

Truestudio has suddenly started adding a 30 second delay before flash programming whenever I try to debug a project.

This started suddenly yesterday without any apparent cause. I've tried rebooting and disabling antivirus to no effect. The only suspicious thing I can see (with Sysinternals Process Explorer) is that arm-atollic-eabi-gdb.exe is sending data to ST-LINK_gdbserver.exe through local network connection at approximately 80 kB/s rate instead of much higher rate. Has anyone run into this before?

I'm using STM32F769-Discovery board. The OS is Windows 10.

My Target Software Startup Script is:

Code: Select all

monitor flash set_parallelism_mode 2
load      
# Enable Debug connection in low power modes (DBGMCU->CR)
set *0xE0042004 = (*0xE0042004) | 0x7
tbreak main
continue


Here's the relevant bit from gdbserver log:

Code: Select all

[0.000] init():  Atollic TrueSTUDIO gdbserver for ST-Link. Version 4.2.2 (WIN32 2018-02-26 16:20:21 15675)
[1.748] reset_hw_wtchpt_module():  Hardware watchpoint supported by the target
[1.755] createFlashParams():  STM32 device: Flash size =2048
[1.756] Stm32F7FlashModule():  STM32F7 Single bank: OPTCR=0xffffaafd
[1.757] Stm32F7FlashModule():  STM32F7 flash size id: 2048 KByte
[1.873] STM32_AppReset():  Enter STM32_AppReset() function
[1.987] STM32_AppReset():  NVIC_DFSR_REG = 0x00000009
[1.988] STM32_AppReset():  NVIC_CFGFSR_REG = 0x00000000
[1.989] STM32_AppReset():  XPSR = 0x01000000
[1.989] Device_Initialise():  ST_LINK Major version =2 Jtag version =31
[1.989] Device_Initialise():  ST_LINK VID=1155 PID=14155
[1.990] Device_Initialise():  ST_LINK device status: HALT_MODE
[1.990] Device_Initialise():  ST_LINK detects target voltage =3.22 Volt
[1.992] initServerContext():  ST-Link device initialization OK
[1.994] WaitConnection():  Waiting for connection on port 61234...
[2.127] WaitConnection():  Accepted connection on port 61234...
[2.128] Device_GetStatus():  ST_LINK device status: HALT_MODE
[2.196] handlePacket():  Reading 0x4 bytes of memory from addr 0x800d324
[2.197] handlePacket():  Reading 0x2 bytes of memory from addr 0x800d320
[2.198] handlePacket():  Reading 0x2 bytes of memory from addr 0x800d322
[2.199] handlePacket():  Reading 0x4 bytes of memory from addr 0x800d358
[2.230] handlePacket():  Reading 0x20 bytes of memory from addr 0xe00fdfd0
[2.235] handlePacket():  Reading 0x2 bytes of memory from addr 0x800b210
[2.256] STM32_AppReset():  Enter STM32_AppReset() function
[2.376] STM32_AppReset():  NVIC_DFSR_REG = 0x00000009
[2.377] STM32_AppReset():  NVIC_CFGFSR_REG = 0x00000000
[2.378] STM32_AppReset():  XPSR = 0x01000000
[31.861] handleFlashPacket():  Flash erase: Address= 0x8000000, Length=180224
[31.874] flash_f7_erase_one_sector():  STM32 device: Erase sector, Sector=0 CR=0x202
 

STM32rob
Posts: 2
Joined: Thu Oct 18, 2018 5:39 pm

Re: 30 second delay in starting project on STM32F769 Discovery

Postby STM32rob » Thu Oct 18, 2018 5:42 pm

My system just started to exhibit the same problem...but with a 53 second delay. :( It's a stock STM32F746 Discovery board.

My log suggests it's hanging up at the same spot as you:

[2.870] STM32_AppReset(): NVIC_DFSR_REG = 0x00000009
[2.870] STM32_AppReset(): NVIC_CFGFSR_REG = 0x00000000
[2.870] STM32_AppReset(): XPSR = 0x01000000
[55.419] handleFlashPacket(): Flash erase: Address= 0x8000000, Length=32768
[55.419] flash_page_erase(): FuncEntry

Mattias Norlander
Posts: 262
Joined: Fri Apr 29, 2016 10:01 am

Re: 30 second delay in starting project on STM32F769 Discovery

Postby Mattias Norlander » Fri Oct 19, 2018 10:58 am

Try downloading the new TS9.1.0? It comes with a new ST-LINK GDB-server which is much faster at flash operations since it uses CubeProgrammer for flash programming... Give us some feedback on how that works for you. Time needed with old vs new version. Benchmark please!

STM32rob
Posts: 2
Joined: Thu Oct 18, 2018 5:39 pm

Re: 30 second delay in starting project on STM32F769 Discovery

Postby STM32rob » Fri Oct 19, 2018 1:46 pm

I appreciate the quick reply, Mattias.

Before jumping over to 9.1, I dug a bit deeper and found the issue. Assigning variables into (uninitialized) SDRAM seems to cause GDB to timeout repeatedly as the linker output attempts to initialize all variables in that memory space.

The solution I chose was to mark the SDRAM section (NOLOAD), informing the linker to leave that memory device unwritten, and allowing the application code to manage the initial values for those variables and arrays. It now loads very quickly. There are certainly other ways, perhaps better, to accomplish a fix.

Thanks for your suggestion.

Mattias Norlander
Posts: 262
Joined: Fri Apr 29, 2016 10:01 am

Re: 30 second delay in starting project on STM32F769 Discovery

Postby Mattias Norlander » Tue Oct 30, 2018 1:35 pm

Ok - yes either you do NOLOAD or you write up a GDB-script that initializes the interface between SDRAM and MCU which is a bit more time consuming. There is no built-in support in the GDB-server to handle SDRAM.


Return to “Atollic TrueSTUDIO tool discussions”

Who is online

Users browsing this forum: No registered users and 1 guest