This is especially problematic if you are using C++, because constructors get called for all of the statically allocated instances before main() gets called.
#Atollic truestudio debugging code#
I think this just moves bits around the bad memory location, if this is the case the problem will re-appear.Īnother thing to try is powering up the target in 'bootloader' mode and then trying to program it.Īdded 2/4/20: It also appears that anything that fails in the startup code before execution reaches main() can cause this. You can also sometimes get the loader to work by changing the code. BTW, the ST-LINK Utility does not seem to mind being plugged into the USB-C hub. In the past I have used a powered USB 3.0 hub with no problems but that may no longer work with Truestudio 9.3.1. (It may work a few times plugged into the hub, but this may be a ploy to lull you into complacency).
![atollic truestudio debugging atollic truestudio debugging](https://support.ambiq.com/hc/article_attachments/115003665311/mceclip2.png)
It wants to be plugged right into the computer. The ST-LINK seems to not like having the USB be plugged into a USB-C / Thunderbolt hub. You can verify this is the problem by downloading the STM32 ST-LINK Utility and trying to program the chip with verify. I'm guessing it is the default response when the 'load' command in the debugger script fails.Ī fault in the FLASH memory in the MCU. Please edit the debug configuration settings." appears to have multiple causes.
#Atollic truestudio debugging software#
The error "Failure at line:6 in 'Target Software Startup Scripts'. Has anyone experienced this before, or have any clue/idea for this situation? Thanks in advance. I briefly checked through the disassembly file of the executable elf file via objdump, the overall structure and the math library functions look fine (and runs correctly - again, except cannot debug).Īfter the debugger throwing error, its session is still alive, but when I tried to continue the program it ends up in HardFault_Handler (and stays there even after reset, by IDE or the pin).
![atollic truestudio debugging atollic truestudio debugging](https://i.ytimg.com/vi/w3XRrU9LeGw/maxresdefault.jpg)
Runtime library is set to Newlib-standard. Build was done by arm-atollic-eabi-gcc toolchain shipped with TrueStudio, with options: -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -std=gnu11 -D_weak=_attribute_((weak)) -D_packed=_attribute_((_packed_)) -DUSE_HAL_DRIVER -DSTM32H743xx -I./Inc -I./Drivers/STM32H7xx_HAL_Driver/Inc -I./Drivers/STM32H7xx_HAL_Driver/Inc/Legacy -I./Drivers/CMSIS/Device/ST/STM32H7xx/Include -I./Drivers/CMSIS/Include -Og -ffunction-sections -fdata-sections -g -fstack-usage -Wall The project and code template was generated with STM32CubeMX, with STM32's HAL driver. Interestingly, I checked the elf file with objdump, the program does NOT reach 0x08009158 instead, it stops at 0x08009152. STM32 device: flash programming successful 0x8009140 STM32 device: program flash memory at address 8009158, length 1512 Similarly for the consequent memory addresses. STM32 device: flash programming successful 0x8000000 STM32 device: program flash memory at address 8000000, length 664 Starting server with the following options: I further checked the debugger log and it gives me this: Atollic TrueSTUDIO gdbserver for ST-Link. In other words, everything else is fine except cannot debug. With the math library involved (say keeping the original undebuggable code return sin(rad) ), the project is still perfectly compliable, and the compiled program is working as expected if I load the executable with other tools, say STM32CubeProgrammer, or just press Ctrl+F11 inside the IDE (I configured the Run command with the STM32CubeProgrammer's CLI).
![atollic truestudio debugging atollic truestudio debugging](https://imgaz2.staticbg.com/thumb/large/oaupload/ser1/banggood/images/B1/0E/7fb25b67-8bd4-4add-b732-a6a234f3a866.jpg)
Here is the only occurrence of functions from math library. If I change the return sin(rad) to something without functions from math lib, for example return rad (but not return cos(rad) ), everything works fine again. I wrote the function above with the intention to test the math library's functionality on STM32H7 MCU. Return sin(rad) // This line gives me problem
![atollic truestudio debugging atollic truestudio debugging](https://i.stack.imgur.com/SW3yF.png)
Since everything works fine a while ago, I tried to revert my code and found that a particular line of code causes the problem. # Enable Debug connection in low power modes (DBGMCU->CR) # 2=32 bit, 1=16 bit and 0=8 bit parallelism mode The debugger startup script is just default: # Set flash parallelism mode to 32, 16, or 8 bit when using STM32 F2/F4 microcontrollers Please edit the debug configuration settings. When I try to debug my program within the TrueStudio IDE, it throws the following error to me: Failure at line:6 in 'Target Software Startup Scripts'. 9.0.0), using a ST-LINK debugger on a STM32F4-Discovery board (ST-LINK firmware ver. I am currently working on a STM32H743VIT6 chip (on a self-designed board), with the Atollic TrueStudio toolchain (ver.