Error on initVariant()?

All about boards manufactured by ST
Post Reply
Bambo
Posts: 75
Joined: Wed Jan 15, 2020 8:36 pm

Error on initVariant()?

Post by Bambo »

Hi,

I'm trying to upload and debug a program using openocd. The problem i have is that it keeps crashing at line 50 in main.cpp (C:\Users\X\AppData\Local\arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino\main.cpp) which is the statement initVariant().

I am using an NUCLEO-L452RE-P board as a debugger to a custom board which has an L452RE. Is there any way to debug this problem further to find out why it is crashing here?

The OpenOCD log is here:
openocd: Open On-Chip Debugger 0.10.0+dev-01058-g853a05287 (2020-02-13-16:41)
openocd: Licensed under GNU GPL v2
openocd: For bug reports, read
openocd: http://openocd.org/doc/doxygen/bugs.html
openocd: debug_level: 2
openocd:
=thread-group-added,id="i1"
GNU gdb (xPack GNU Arm Embedded GCC, 32-bit) 8.3.0.20190709-git
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=i686-w64-mingw32 --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
=cmd-param-changed,param="pagination",value="off"
Reset_Handler () at C:\Users\Richa\AppData\Local\arduino15\packages\STM32\hardware\stm32\1.9.0\system/Drivers/CMSIS/Device/ST/STM32L4xx/Source/Templates/gcc\startup_stm32l452xx.s:63
63 ldr sp, =_estack /* Set stack pointer */
Note: automatically using hardware breakpoints for read-only addresses.

Breakpoint 1, main () at C:\Users\Richa\AppData\Local\arduino15\packages\STM32\hardware\stm32\1.9.0\cores\arduino\main.cpp:50
50 initVariant();


Kill the program being debugged? (y or n) [answered Y; input not from terminal]
The program '' has exited with code 0 (0x0).
Cheers,
Richard
Attachments
Capture5.PNG
Capture5.PNG (28.12 KiB) Viewed 2551 times
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Error on initVariant()?

Post by fpiSTM »

Probably a wrong open ocd target config .
I guess you build with debug options.
Bambo
Posts: 75
Joined: Wed Jan 15, 2020 8:36 pm

Re: Error on initVariant()?

Post by Bambo »

fpiSTM wrote: Wed Jan 27, 2021 10:22 am Probably a wrong open ocd target config .
I guess you build with debug options.
Yes, i compile with the -g command, here is the openocd command used:
C:\ProgramData\vmicro\tools\openocd-0.10.0.20200213\bin\openocd.exe -d2 -s "C:\ProgramData\vmicro\tools\openocd-0.10.0.20200213/scripts/" -f "interface/stlink.cfg" -f "board/st_nucleo_l4.cfg" -c "echo -n {****[vMicro]**** Uploading ELF :}" -c "reset_config; telnet_port disabled; program {C:\Users\Richa\AppData\Local\Temp\VMBuilds\Sketch1\STM32_~1\Debug/Sketch1.ino.elf} reset;reset_config;shutdown"
Here is the open ocd log:
Warn : Interface already configured, ignoring
Error: already specified hl_layout stlink
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
srst_only separate srst_nogate srst_open_drain connect_deassert_srst

Info : clock speed 500 kHz
Info : STLINK V2J37M26 (API v2) VID:PID 0483:374B
Info : Target voltage: 6.087302
Info : stm32l4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : Listening on port 3333 for gdb connections
Info : Unable to match requested speed 500 kHz, using 480 kHz
Info : Unable to match requested speed 500 kHz, using 480 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0800290c msp: 0x20028000
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : accepting 'gdb' connection on tcp/3333
Info : device idcode = 0x20016462 (STM32L45/L46xx - Rev: Y)
Info : flash size = 256kbytes
Info : flash mode : single-bank
Info : dropped 'gdb' connection
Post Reply

Return to “STM boards (Discovery, Eval, Nucleo, ...)”