Reply
Posts: 17
Registered: ‎08-07-2015
Accepted Solution

Breakpoints not working with custom EFR32 and IAR compiler

Hello,

 

I have a problem where I cannot get my code to break on a breakpoint in the C code.

 

I am using:

Simplicity Studio V4

IAR compiler

BlueGecko module wireless starter kit (PCB4003 revA3)

Debug adaptor (BRD8010A revA01)

Custom board with BGM121

 

I can compile my project in debug mode with no errors. 

 

I can program my custom board with said compiled code with the Debug button.

 

I can pause execution while in debug, BUTI only see the paused line of code in the Disassembly window.  There is no indication in the C code where the program is paused.

 

I can set a breakpoint in the C code (right-click -> Add breakpoint... -> Class: C/C++ Line Breakpoint, Type = Regular, Enabled = True) BUT the program never pauses on that breakpoint.  I have tried several (many) different locations for the breakpoint - locations which I know are being traversed, but still it never pauses.  The "Disable Breakpoints" option is not enabled.

 

I can set an in-line breakpoint by typing "__BKPT(0);" which DOES pause execution, but again, only visible in the Disassembly window and not the C code file.  Once paused in this fashion, I do not have access to the variables (in the C code) to see what values they hold.

 

I have turned off optimizations (they were already set to off) in Project -> Properties -> C/C++ Build -> Settings -> IAR C/C++ Compiler for ARM -> Optimizations -> Optimization level = None.

 

Can someone offer suggestions which would allow me to pause execution while debugging via a breakpoint on a line in my C code which allows me to view the variables and the values they hold?

 

Thank you,

-Ted

 

Posts: 518
Registered: ‎12-05-2016

Re: Breakpoints not working with custom EFR32 and IAR compiler

Hi @tfalasco,

 

Which operating system is the PC running?

 

When you say the "Disable Breakpoints" option is not enabled do you mean the "Skip all Breakpoints" option? (CTRL-ALT-B).  If you build an example project for the BRD4003 and debug that application on that board do the breakpoints work correctly on the example? Just trying to narrow done the issue, because what you are doing should be working.

 

Thank you,

jpitt

Posts: 17
Registered: ‎08-07-2015

Re: Breakpoints not working with custom EFR32 and IAR compiler

Hello @jpitt,

 

Thank you for your reply.

 

My operating system is Windows 10.  And I was indeed referring to the "Skip all breakpoints (Ctrl + Alt + B)" option.  That button is not selected.

 

I should say I had a typo in my original post - The wireless starter kit is PBC4001 RevA03, not PCB4003.  Sorry about that.

 

I tried your suggestion.  I plugged a BGM121 demo board into the wireless starter kit, switched the debug mode of my Simplicity Debugger from "OUT" to "MCU," then built and ran the "SOC - Thermometer" example. 

 

I am seeing the same behavior.  When I create a breakpoint in Main then run in debug mode, the program does not pause execution at the line of code with the breakpoint.  But if I type "__BKPT(0);" just below the line with that break point, then rerun in debug mode, the program halts execution on the in-line breakpoint, but only shows the context in the Disassembly window, not in the C code.

 

I'm glad to hear you say it should work.  I began to doubt I would be able to debug properly.  Do you have any other thoughts as to what could be causing this particular issue?  Is there some configuration option that I have inadvertently set which only debugs in disassembly?  Maybe I am not creating the breakpoints correctly?

 

Thanks,

-Ted

 

Posts: 518
Registered: ‎12-05-2016

Re: Breakpoints not working with custom EFR32 and IAR compiler

Hi Ted,

 

Maybe you could zip up the program folder for the SOC Thermometer example and attach that to this forum thread so we can try and see what is going on.  I don't see an option to set a breakpoint if I right click on a line in the 'C' file.  I normally set a breakpoint by double clicking at the beginning of the line (far left margin).  But in the disassembly window the 'C' code is interspersed with the assembly code, there is a small "Show Source" icon at the top of the dissembly window (looks like a sheet of paper with some code on it and a small yellow arrow pointing to the right, I've highlighted it in red in this screenshot:

disassemblyWindow.PNG

 

But the fact that the breakpoints don't seem to be working correctly makes me think that probably isn't the issue.  There is a project property setting for the Linker in the Output section "Include debug information in output", but if that isn't checked there is a warning when launching the debugger, so I doubt that is the issue.  In the debug configuration (right click on the project folder and select [Debug As] > [Debug Configurations...] is the executable the ".out" file? (IAR ARM - Debug/soc-thermometer.out).

 

Thanks,

jpitt

Posts: 17
Registered: ‎08-07-2015

Re: Breakpoints not working with custom EFR32 and IAR compiler

Hi jpitt,

 

I have attached the zipped project to this post.  Hopefully this will help troubleshoot this issue.

 

When I said I right-click the line, I was right-clicking the line number to create the breakpoint.  I repeated the test creating a breakpoint by double-clicking as you do and the results were the same.

 

My disassembly window is not interspersed with C code.  Here is an image of the window after stopping on an in-line breakpoint:

disassembly.png

Note the "Show Source" icon is selected.

 

I double-checked that the "Include debug information in output" checkbox was checked in the Linker output settings page.  It was already checked.

 

I also verified that the executable is indeed the .out file.  It is listed as "IAR ARM - Debug/soc-thermometer.out" in the Debug Configuration for that project.

 

Thank you for looking into this.

 

-Ted

 

 

Posts: 518
Registered: ‎12-05-2016

Re: Breakpoints not working with custom EFR32 and IAR compiler

Hi @tfalasco,

 

It looks like you are using version 8.1.1 of the IAR compiler and Simplicity Studio only works with versions up to 7.80.x.  There is a known issue trying to debug projects built with the 8.1.x version of the IAR compiler with Simplicity Studio.  All of the libraries that Silicon Labs provides (for example stack.a, binstack.o) are also built with version 7.80 of the compiler.  IAR lets you install different versions in parallel, so the 7.80 version can be installed and used with Simplicity Studio.  I don't have a time table on when Silicon Labs will add support for IAR version 8.1.1.  The other option would be to use the efr32.ewp file in the project to launch the IAR Workbench and build and debug the project from the IAR Workbench.

 

Thank you,

jpitt

Highlighted
Posts: 17
Registered: ‎08-07-2015

Re: Breakpoints not working with custom EFR32 and IAR compiler

Bingo!  That was indeed the problem.  I installed IAR license 7.80 instead of 8.11 and the debugging is now working as expected.

 

Terrific sleuthing, jpitt.  Thank you for your help.