Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: [1]  Send TopicPrint
Hot Topic (More than 8 Replies) Build errors with STM32 (Read 15367 times)
Bambo
Member
***
Offline


Posts: 146
Location: Liverpool, UK
Joined: Jan 13th, 2020
Build errors with STM32
Jan 26th, 2021 at 3:30pm
Print Post  
I have created an empty project to build and debug on the STM32. The build fails due to some strange errors, here is the end of the attached log. Its building and uploading to an STM32l452RE/

Code
Select All
Uploading 'Sketch1' to 'Nucleo-64' using 'COM3'
Uploader started for board Nucleo-64
Upload method will be: bootloader
Uploading via Bootloader
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_f3.cfg" -c "echo -n {****[vMicro]**** Uploading ELF :}" -c "reset_config; telnet_port disabled; program lf} reset;reset_config;shutdown"
Open On-Chip Debugger 0.10.0+dev-01058-g853a05287 (2020-02-13-16:41)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
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
****[vMicro]**** Uploading ELF :Info : clock speed 1000 kHz
Info : STLINK V2J37M26 (API v2) VID:PID 0483:374B
Info : Target voltage: 6.072079
Info : stm32f3x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : Listening on port 3333 for gdb connections
Info : Unable to match requested speed 1000 kHz, using 950 kHz
Info : Unable to match requested speed 1000 kHz, using 950 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08032af0 msp: 0x20028000
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
The uploader process failed
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
** Programming Started **
Info : device id = 0x20016462
Warn : Cannot identify target as a STM32 family.
Error: auto_probe failed
embedded:startup.tcl:510: Error: ** Programming Failed **
in procedure 'program'
in procedure 'program_error' called at file "embedded:startup.tcl", line 575
at file "embedded:startup.tcl", line 510
 

« Last Edit: Jan 26th, 2021 at 3:52pm by Bambo »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Bambo
Member
***
Offline


Posts: 146
Location: Liverpool, UK
Joined: Jan 13th, 2020
Re: Build errors with STM32
Reply #1 - Jan 26th, 2021 at 4:13pm
Print Post  
By adding the following to the board.txt, it builds ok however when uploading it doesn't work


Code
Select All
} 

 

The error popup says "Unable to start debugging. Unexpected GDB output from command "-target-select remote loclahost:3333". Remote communication error. Target disconnected.: No connection could be made because the target machine actively refused it.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Bambo
Member
***
Offline


Posts: 146
Location: Liverpool, UK
Joined: Jan 13th, 2020
Re: Build errors with STM32
Reply #2 - Jan 26th, 2021 at 4:19pm
Print Post  
Using the STLink-2.1 OpenOCD uploader the build output is "stlink-2.1-openocd.txt" and using STM32CubeProgrammer the build output is attached as "stm32cubeprogrammer.txt".

stm32cubeprogrammer results in an error message:
Quote:
"Unable to start debugging. Unexpected GDB output from command "-target-select remote localhost:3333". Remote connection closed.


stlink-2.1-openocd results in athe error message:
Quote:
"Unable to start debugging. Unexpected GDB output from command "-target-select remote loclahost:3333". Remote communication error. Target disconnected.: No connection could be made because the target machine actively refused it. "
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2707
Joined: Feb 13th, 2019
Re: Build errors with STM32
Reply #3 - Jan 26th, 2021 at 4:21pm
Print Post  
Thanks for the report.

This is incorrect configuration in vMicro as it is selecting the F3x board instead of F0x.

If you add the below to the local board.txt in the project, it should resolve the issue before we release an update:
Code
Select All
tools.stlinkv2.server.targetCmd= -f "board/st_nucleo_f0.cfg" 

  
Back to top
IP Logged
 
Bambo
Member
***
Offline


Posts: 146
Location: Liverpool, UK
Joined: Jan 13th, 2020
Re: Build errors with STM32
Reply #4 - Jan 26th, 2021 at 4:51pm
Print Post  
It is an STM32L452RE connected to with a Nucleo-64 external board for debugging

With these board.txt settings
Quote:
# Sketch1 build property overrides
#


tools.stlinkv2.path={runtime.tools.xpack-arm-none-eabi-gcc.path}/bin
tools.stlinkv2.server.targetCmd= -f "board/st_nucleo_f0.cfg" 


Openocd log:
Quote:
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 1000 kHz
Info : STLINK V2J37M26 (API v2) VID:PID 0483:374B
Info : Target voltage: 6.082431
Warn : unexpected idcode: 0x2ba01477
Error: expected 1 of 1: 0x0bb11477


The output is:
"Unable to start debugging, GDB exited unexpectedly with exit code 1 (0x1).

The debug console prints:
Quote:
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"
SystemClock_Config () at nts\NUCLEO_F030R8\variant.cpp:145
145          while (1);
Note: automatically using hardware breakpoints for read-only addresses.

Program received signal SIGINT, Interrupt.
SystemClock_Config () at nts\NUCLEO_F030R8\variant.cpp:145
145          while (1);
Kill the program being debugged? (y or n) [answered Y; input not from terminal]
[Inferior 1 (Remote target) killed]
The program '' has exited with code 0 (0x0).




With these board.txt commands
Quote:
# Sketch1 build property overrides
#


tools.stlinkv2.path={runtime.tools.xpack-arm-none-eabi-gcc.path}/bin
tools.stlinkv2.server.targetCmd= -f "board/st_nucleo_l4.cfg"
tools.stlinkv2.server.initCmd=-c "init" 


The DebugOpenOCD.log contains

Quote:
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.079260
Info : stm32l4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : Listening on port 3333 for gdb connections
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : accepting 'gdb' connection on tcp/3333
target halted due to debug-request, current mode: Thread 
xPSR: 0x21000000 pc: 0x08001e30 msp: 0x20001f90
Info : device idcode = 0x20016462 (STM32L45/L46xx - Rev: Y)
Info : flash size = 256kbytes
Info : flash mode : single-bank
Info : dropped 'gdb' connection

The Debug log:
Quote:
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"
SystemClock_Config () at nts\NUCLEO_F030R8\variant.cpp:145
145          while (1);
Note: automatically using hardware breakpoints for read-only addresses.

Program received signal SIGINT, Interrupt.
SystemClock_Config () at nts\NUCLEO_F030R8\variant.cpp:145
145          while (1);
Kill the program being debugged? (y or n) [answered Y; input not from terminal]
[Inferior 1 (Remote target) killed]
The program '' has exited with code 0 (0x0).
« Last Edit: Jan 26th, 2021 at 4:59pm by Bambo »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2707
Joined: Feb 13th, 2019
Re: Build errors with STM32
Reply #5 - Jan 26th, 2021 at 5:19pm
Print Post  
Apologies, I was going on the logs uploaded, both show the F03x board selected in the previous 2 sets of logs.

So to confirm the L4 board/chip is connected via the STLink on the F03x Nucleo board?

The final set of logs with the L4 configuration set look correct, is this functioning as expected?

Also if you have mutliple STLink devices connected to your machine at the same time, it can cause the wrong one to be connected from OpenOCD without giving it additional flags.
  
Back to top
IP Logged
 
Bambo
Member
***
Offline


Posts: 146
Location: Liverpool, UK
Joined: Jan 13th, 2020
Re: Build errors with STM32
Reply #6 - Jan 26th, 2021 at 5:43pm
Print Post  
Simon@Visual Micro wrote on Jan 26th, 2021 at 5:19pm:
Apologies, I was going on the logs uploaded, both show the F03x board selected in the previous 2 sets of logs.

So to confirm the L4 board/chip is connected via the STLink on the F03x Nucleo board?

The final set of logs with the L4 configuration set look correct, is this functioning as expected?

Also if you have mutliple STLink devices connected to your machine at the same time, it can cause the wrong one to be connected from OpenOCD without giving it additional flags.


The L452 chip is connected to an NUCLEO-L452RE-P, which is then connected via usb to my PC. I've set up all the jumpers seen here https://www.visualmicro.com/page/STM32-Debugging.aspx and it was working around September 2020.

With the L4 configuration set it does not function correctly no.
  
Back to top
 
IP Logged
 
Bambo
Member
***
Offline


Posts: 146
Location: Liverpool, UK
Joined: Jan 13th, 2020
Re: Build errors with STM32
Reply #7 - Jan 27th, 2021 at 9:38am
Print Post  
With this board.txt for some reason its using the Nucleo-F030R8 board variant
Quote:

# Sketch1 build property overrides
#


tools.stlinkv2.path={runtime.tools.xpack-arm-none-eabi-gcc.path}/bin
tools.stlinkv2.server.targetCmd= -f "board/st_nucleo_l4.cfg"
tools.stlinkv2.server.initCmd=-c "init"


Micro debug output:
Quote:
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"
SystemClock_Config () at nts\NUCLEO_F030R8\variant.cpp:145
145          while (1);
Note: automatically using hardware breakpoints for read-only addresses.

Program received signal SIGINT, Interrupt.
SystemClock_Config () at nts\NUCLEO_F030R8\variant.cpp:145
145          while (1);
Kill the program being debugged? (y or n) [answered Y; input not from terminal]
[Inferior 1 (Remote target) killed]
The program '' has exited with code 0 (0x0).


OpenOCD log:
Quote:
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.080952
Info : stm32l4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : Listening on port 3333 for gdb connections
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : accepting 'gdb' connection on tcp/3333
target halted due to debug-request, current mode: Thread 
xPSR: 0x21000000 pc: 0x08001e30 msp: 0x20001f90
Info : device idcode = 0x20016462 (STM32L45/L46xx - Rev: Y)
Info : flash size = 256kbytes
Info : flash mode : single-bank
Info : dropped 'gdb' connection


Full build log is attached
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Bambo
Member
***
Offline


Posts: 146
Location: Liverpool, UK
Joined: Jan 13th, 2020
Re: Build errors with STM32
Reply #8 - Jan 27th, 2021 at 9:52am
Print Post  
Aha! I missed out the Board Part Number option! I've put it to STM32L452RE and now it is almost running, but it keeps throwing an exception inside the arduino library.

Quote:
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 3
63        ldr   sp, =_estack    /* Set stack pointer */
Note: automatically using hardware breakpoints for read-only addresses.

Breakpoint 1, main () at \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).


If i add "tools.stlinkv2.server.initCmd=-c "init"" to the boards.txt i get this:
Quote:
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"
0x08002f3e in serialEventRun () at \arduino\WSerial.cpp:56
56        if (serialEventLP1 && SerialLP1.available()) {
Note: automatically using hardware breakpoints for read-only addresses.



OpenOCD debug log
Quote:
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.084127
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


Build log attached

« Last Edit: Jan 27th, 2021 at 10:12am by Bambo »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Bambo
Member
***
Offline


Posts: 146
Location: Liverpool, UK
Joined: Jan 13th, 2020
Re: Build errors with STM32
Reply #9 - Jan 27th, 2021 at 10:20am
Print Post  
With this board.txt:
Quote:
# Sketch1 build property overrides
#

tools.stlinkv2.path={runtime.tools.xpack-arm-none-eabi-gcc.path}/bin


And the settings attached as image

The micro build output is attached, interestingly even though i'm using the STM32-L452RE-P as a debugger to an STM32-L452RE (without -P) it says here
Quote:
     -------------------------------------------------------------------
                       STM32CubeProgrammer v2.6.0                  
      -------------------------------------------------------------------
ST-LINK SN  : 0663FF525750877267234013
ST-LINK FW  : V2J37M26
Board       : NUCLEO-L452RE-P


The board is NUCLEO-L452RE-P, i'm not sure whether this is correct, but the target chip is an L452RE without a P?

« Last Edit: Jan 27th, 2021 at 10:21am by Bambo »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Bambo
Member
***
Offline


Posts: 146
Location: Liverpool, UK
Joined: Jan 13th, 2020
Re: Build errors with STM32
Reply #10 - Jan 27th, 2021 at 10:38am
Print Post  
Cross reference here to try to figure out whats wrong:
https://www.stm32duino.com/viewtopic.php?f=12&t=886&p=5854
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2707
Joined: Feb 13th, 2019
Re: Build errors with STM32
Reply #11 - Jan 27th, 2021 at 11:02am
Print Post  
Thanks for the feedback and detail.

When it lands on the initVariant() with an exception, can you press Continue to continue debugging?
Are you using "Debug > Start" or Debug > "Attach to Process"?
Have you tried changing the Debugger Optimization to "No Project + Libraries" (needs clean rebuild and upload)?

The -P Identifier on the board is to denote whether the "STM32 has external SMPS function" according to the [url=https://www.st.com/resource/en/user_manual/dm00387966-stm32-nucleo-64-p-boards-stmicroelectronics.pdf]ST Docsp/url], so expect the board.cfg in use is correct.
  
Back to top
IP Logged
 
Bambo
Member
***
Offline


Posts: 146
Location: Liverpool, UK
Joined: Jan 13th, 2020
Re: Build errors with STM32
Reply #12 - Jan 27th, 2021 at 11:11am
Print Post  
Ah! Yes, when i hit continue it operates normally.

I'm using "Debug > Start", i just tried it with the "No Project + Libraries" option turned on but no different.

Edited:
When moving back to my main project solution, it comes up with the old errors attached


« Last Edit: Jan 27th, 2021 at 11:29am by Bambo »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Bambo
Member
***
Offline


Posts: 146
Location: Liverpool, UK
Joined: Jan 13th, 2020
Re: Build errors with STM32
Reply #13 - Jan 27th, 2021 at 11:44am
Print Post  
if i add "tools.stlinkv2.server.initCmd=-c "init" to the board.txt i get the attached result
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2707
Joined: Feb 13th, 2019
Re: Build errors with STM32
Reply #14 - Jan 27th, 2021 at 12:05pm
Print Post  
The "tools.stlinkv2.server.initCmd=-c "init" command simply changes whether OpenOCD will reset the board as it connects (init; reset halt;), or whether it just initializes the connection to wherever the CPU is in the code currently (just init).

This wont change what errors are seen when stepping into or over Library and Core code.

Can you try the "No Optimization" option with a rebuild+re-upload as this will disable all optimization for the core code as well?

  
Back to top
IP Logged
 
Bambo
Member
***
Offline


Posts: 146
Location: Liverpool, UK
Joined: Jan 13th, 2020
Re: Build errors with STM32
Reply #15 - Jan 27th, 2021 at 12:17pm
Print Post  
Same result with "No Optimization" enabled and complete clean and rebuild. I have sent the micro build output to the email address at the top of the page. Here is the output of the OpenOCD debug log.

Note: "The Debugger was unable to continue the process." is me trying to continue after the exception is thrown.

Quote:

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 3
63        ldr   sp, =_estack    /* Set stack pointer */
Note: automatically using hardware breakpoints for read-only addresses.
Debugger was unable to continue the process.

Debugger was unable to continue the process.

Debugger was unable to continue the process.

Debugger was unable to continue the process.

Debugger was unable to continue the process.

Debugger was unable to continue the process.

Kill the program being debugged? (y or n) [answered Y; input not from terminal]
[Inferior 1 (Remote target) killed]
The program '' has exited with code 0 (0x0).



Quote:
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.096825
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: 0x08032af0 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
Error: Can not find free FPB Comparator!
Error: can't add breakpoint: resource not available
Error: Can not find free FPB Comparator!
Error: can't add breakpoint: resource not available
Error: Can not find free FPB Comparator!
Error: can't add breakpoint: resource not available
Error: Can not find free FPB Comparator!
Error: can't add breakpoint: resource not available
Error: Can not find free FPB Comparator!
Error: can't add breakpoint: resource not available
Error: Can not find free FPB Comparator!
Error: can't add breakpoint: resource not available
Info : dropped 'gdb' connection
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2707
Joined: Feb 13th, 2019
Re: Build errors with STM32
Reply #16 - Jan 27th, 2021 at 12:40pm
Print Post  
Thanks for the detail, and we will look further to see if there is further advice we can give.

The Error "Can not find free FPB Comparator!" often appears when too many breakpoints are set.  The STLink supports up to 6 concurrent breakpoints, with 4 watches (at most).

Just to check, is this the same scenario we worked through previously on this thread, or are there differences in the setup/boards in use?
  
Back to top
IP Logged
 
Bambo
Member
***
Offline


Posts: 146
Location: Liverpool, UK
Joined: Jan 13th, 2020
Re: Build errors with STM32
Reply #17 - Jan 27th, 2021 at 12:48pm
Print Post  
Simon@Visual Micro wrote on Jan 27th, 2021 at 12:40pm:
Thanks for the detail, and we will look further to see if there is further advice we can give.

The Error "Can not find free FPB Comparator!" often appears when too many breakpoints are set.  The STLink supports up to 6 concurrent breakpoints, with 4 watches (at most).

Just to check, is this the same scenario we worked through previously on this thread, or are there differences in the setup/boards in use?


Aha! you are right, i had 6 breakpoints set, now it finally gets to the initVariant() exception, if i press continue, the program runs normally  Smiley

Is there any way to prevent it from stopping at the initVariant()?
  
Back to top
 
IP Logged
 
Bambo
Member
***
Offline


Posts: 146
Location: Liverpool, UK
Joined: Jan 13th, 2020
Re: Build errors with STM32
Reply #18 - Jan 27th, 2021 at 1:00pm
Print Post  
For some reason after it debugs the intellisense breaks?

« Last Edit: Jan 27th, 2021 at 1:01pm by Bambo »  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2707
Joined: Feb 13th, 2019
Re: Build errors with STM32
Reply #19 - Jan 27th, 2021 at 5:13pm
Print Post  
Is there any way to prevent it from stopping at the initVariant()?
I assume OpenOCD's reset it causing this at present, the equivalent reset can be performed via GDB with the below properties

Code
Select All
# Just have OpenOCD Connect and not reset when Debug > Start Debugging is used
tools.stlinkv2.server.initCmd=-c "init"
# Get GDB to reset the board on startup (happens on Start and Attach Debug)
tools.stlinkv2.args=-ex \"mon reset\" 



Intellisense Breaks After Debugging
Does adding the below to Board.txt improve this issue?
Code
Select All
intellisense.tools.path={runtime.tools.xpack-arm-none-eabi-gcc.path} 


  
Back to top
IP Logged
 
Bambo
Member
***
Offline


Posts: 146
Location: Liverpool, UK
Joined: Jan 13th, 2020
Re: Build errors with STM32
Reply #20 - Jan 27th, 2021 at 7:04pm
Print Post  
For some reason the arduino project wont compile in Visual Micro but will compile in the native Arduino IDE? See the issue here https://github.com/stm32duino/STM32SD/issues/37 Any ideas on how to fix this one? i'm trying to clean the build on visual micro but it doesn't seem to change it? - managed to fix this by deleting previously cached cores Smiley



"intellisense.tools.path={runtime.tools.xpack-arm-none-eabi-gcc.path} " didn't fix the intellisense errors. edit: i think it did help a bit though

Code
Select All
# Just have OpenOCD Connect and not reset when Debug > Start Debugging is used
tools.stlinkv2.server.initCmd=-c "init"
# Get GDB to reset the board on startup (happens on Start and Attach Debug)
tools.stlinkv2.args=-ex \"mon reset\"
 



Did work Smiley
« Last Edit: Jan 27th, 2021 at 7:33pm by Bambo »  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 
Send TopicPrint