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.
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). 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). 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 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.