- Silicon Labs Community
- Welcome and Announcements
- Silicon Labs Knowledge Base
- 8-bit MCU
- 32-bit MCU
- Bluetooth / Wi-Fi
- Other Products Category
- Optical/RH/Temp Sensor
- Other Products
- Hardware and Software Tools
- Simplicity Studio and Software
- General Discussions and Suggestions
- Chinese Forum
- Software Libraries
- Development Kits
- Reference Designs
- Third Party Tools
- White Papers
- Official Blog of Silicon Labs
- Chinese Blog
07-10-2017 02:20 AM
I am having a problem with debugging firmware.
Everything worked fine until last week and debugging as well as flashing was ok.
Then at some point (seemingly out of the blue) the debugging stopped working. I can flash the image using debug, but I cannot halt at any breakpoints. Also if I pause the debugger stops at some unknown state. A device-reset does not seem to have any effect.
I then tried to use older firmware that worked, but the same behaviour there. Even the SOC-Examples did not work anymore.
Hardware is BGM121 (EFR32BG1B232F256GM56) with wireless dev-kit. Also BGM123.
There is no error message or warning. Also the firmware does not work and it stays stuck at two locations where it loads something into a working reguster and compares it with 0x2 and 0x3. Maybe some kind of trap interrupt? I do not know. I attached an image of a halted debug-state.
I then tried reinstalling the complete IDE and started with a new soc-example. But the problem persists.
Thanks for any information!
07-10-2017 09:46 AM
It seems the problem has something to do with missing resets.
If I flash a board, it will not start, no matter what I do (see post above). Only by power cycling the board will the new firmware become active. Still not possilbe to debug, though.
07-10-2017 10:09 AM
Is the IAR or the GCC compiler being used for the project? If IAR, which version of the compiler is being used? Also in the project properties under [C/C++ Build] > [Settings] > [Optimization] is the Optimization level set to None? The compiler optimizations will make it harder to debug a project as the program flow is changed by the optimizations.
07-11-2017 01:20 AM
I am using the GCC compiler. The optimization level was set to 02, which was preset, as I am just trying to get a sample project to debug again (using soc-thermometer_2).
I set it to None, but this has not changed anything. No breakpoints are halted at all, also no break after pressing "Reset the Device". Only halting by sending pause, then it is stuck in some unknown loop as seen on the picture.
I am thinking, this might be a hardware fault and I have somehow broken my eval-board.
I am just missing any error or warning regarding this, since compilation and flashing/verification are done without any problem mentioned.
07-11-2017 07:26 AM
Hi @jpitt and @JStolle
I have a similar problem using a EFM32WG330F256 custom board and with an EFM32 Wonder Gecko Starter Kit. For me also breakpoints have no more effect, more or less out of the blue. Even worse, i can no longer connect to my custom board, on any up to date version (fresh install or updated version). Even though the board is detected, I get the message:
"The board EFM32 Wonder Gecko Starter Kit board (BRD2400A Rev A00) is not compatible with this operation; The part EFM32WG330F256 is not compatible with this operation". (see attached screenshot)
Older versions on different machines also show similar breakpoint issues but at least i can connect there. Contrary to @JStolle, on these machines my device runs normally besides not stopping at breakpoints. I also checked the optimization level and it was set to none.
Thanks in advance
07-11-2017 08:40 AM
I will try and find out if there is a way to reset the board, so that it works properly for you again. I know you are not able to debug with this board, but I do want to clarify if the applications are running correctly or not. At one point you mentioned that after power cycling a board the new image becomes active, so does that mean that the image runs correctly, you just can't debug it? Have you tried reloading the WSTK Adapter firmware on the board? You could also try putting the WSTK into boot mode and then reloading the WSTK firmware. Hold down both PB0 and PB1 while plugging in the USB cable. The board will revert to an older version of the adapter firmware and the latest version can then be reinstalled.
@Kaster, The screenshot looks like a EFM32 Wonder Development Kit (EFM32WG-DK3850) is selected instead of a WG Starter Kit (EFM32WG-STK3800) can you confirm, they are very different boards, can you confirm which is being used and which is selected?
07-11-2017 08:54 AM
I put the Eval-board into boot mode, and it reverted to the oldest hardware adapter.
Then I installed the newest one 1v0p3b689.
However the problem still persists.
Uploaded the soc_smartphone demo, but no breakpoints and stuck in infinite loop.
After Power-Reset: HTM/KEYFOB in Display, so then it works.
I then installed 1v0p2b678 from the menu.
Still the same. Always stuck in that same loop comparing register 0.
07-11-2017 09:23 AM
First of all thank you for your quick response.
I am using the EFM32WG-STK3800 and it is also selected in the Device View on the Launcher Perspective (see Screenshot). The switch on the board is set to DBG and the Debug Mode is set to OUT.
07-11-2017 09:45 AM
yes i did and it is also set to the EFM32 Wonder Gecko Starter Kit board (BRD2400A Rev A00) and the EFM32WG330F256.
As said, I can connect to the board and "debug" on a different machine with an older Version (latest update 05/11/17), thus i made sure to have the exact same settings on the most recent Version.
However my code is not halting on any breakpoint there either.
07-11-2017 10:14 AM
From the addresses shown in the disassembly view in the first screenshot you attached, it appears the program is in the bootloader on the BGM121. Did you ever load a different bootloader onto the board? If you click the "Instruction Stepping Mode" at the top of the debug window does the program then step through the instructions on the disassembly window? You mentioned the debugger seemed to be stuck in a loop checking register r0, but the disassembly code shows several assembly instructions should be happening and if the debugger is put in Instruction Stepping Mode you should see them execute. I'm asking for help on the bootloader, i.e. if you should build and / or load a specific bootloader or something.
You mentioned a BGM123 I believe, can you debug programs correctly on it? I'm trying to determine if the issue is with that specific BGM121 you are using or not.
07-11-2017 10:17 AM
The last screenshot shows the debug interface is set to JTAG, is that what the custom board is laid out to use (instead of a SWD interface)?
Can you share what the project properties show for the C/C++ Build Board / Part / SDK settings?
07-11-2017 11:02 AM
Actually it is an SWD interface, i am just using a JTAG adapter... and this solved my debug problem on the different machine! I do not believe i messed that up...
Sadly it did not solve my connection issue on the latest version.
07-12-2017 01:24 AM
I never used any bootloader on those boards.
The problem first happened, while debugging an external BGM123 Board via JTAG Interface of the Eval-board (also no bootloader). At some point the debugging stopped working. I first thought I had some firmware issues, went back to an older version, but no luck. Then I exchanged the external BMG123 Board with another, but the same problem.
At that point I put the BGM121 Module on the eval board, switched to MCU Debugging and it also showed the same problems.
I have ordered a new eval-board which should arrive tomorrow, so I can maybe check if the eval-board is faulty (which is kinda my guess) or there is some setting (ported even through a reinstall) shooting down all my BGMs.
07-12-2017 12:15 PM
Okay, I hope the new WSTK takes care of the issue. I haven't heard of any thing else to try on the existing board to try to get it working correctly, but if I do I will post an update.
07-12-2017 12:49 PM
I think you are correct about the issue being related to reset not working. In the image in your first post the code is running from RAM. My guess is that this is the flashloader that was used to flash your application, and that device was never reset to start running your code afterwards.
This could be caused by some damage to the WSTK mainboard that has somehow caused the reset line to become disconnected or pulled high. Do your code start running if you press the reset button on the board, or is a power cycle required? It will be interesting to see if a new board solves your problem, please let me know!
07-13-2017 01:27 AM
the Reset Button is also not working.
I do not see any visible problems on the board, but maybe the input-port is damaged.
If you can tell me where the reset pin is located I could trace it with an oscillator image to verify if the reset-signal is arriving.
07-13-2017 07:05 AM
I got the new evalkit and it works out of the box with the old BMG121 board.
That would verify the broken reset-line hypothesis. How it got broken is another thing, since at the time it stopped working I was just debugging not soldering. Maybe stray EMV or something.
As long as the new board does not get the same error, everything is fine.
Btw. one thing I noticed: the adapter firwmware on the board is newer (1v0p4b737) than what i downloaded just a three days ago (1v0p3b689).
07-13-2017 07:18 AM
Thanks for the follow-up, and I'm glad the new board works.
Regarding the firmware version - we sometimes do fixes related to production test that is used during production, but doesn't really affect regular use. The 1.0.4 version you have is one of these cases, and is functionally equal to the 1.0.3 release that's available through Studio.
07-14-2017 04:02 AM
it must be something I am doing wrong with the board. I had the BMG121 running ok, as stated yesterday. Today I attached my external board via the JTAG Interface again and started the debugging, now I have the same problem again! If I reset to example-firmware now also no debugging possilbe. >_<
I could send you the project-data I had flashed into the board ( maybe via confidential e-mail or PN?) and if it helps the layout of the JTAG-Adapter, though that is nothing special.
Otherwise only things I did:
Attach new Eval-board with BMG121 Kit. Flash SOC-Smartphone into the BGM -> Debugging was ok.
Then today disattach Eval-Board. Dislodge BMG121 Kit. Attach external BGM123 Board via JTAG (not SWD) Interface. BGM123 Board has its own power supply.
Change Debug settings in Launcher from MCU to Out.
Check Device via Simplicity Commander (Preferences Bare run - connect -> Device is fould) no Flashing.
Change Device hardware in Launcher Device Window to EFR32BG1B132F256GM56.
Flash my custom hardware into the board via debug.
Then I got the same problem as I had before.
On the old board before the problem occured I had the firmware working on the external board, so there must be some kind of setting or small change which kills (?) the eval-board.
07-14-2017 04:20 AM
Sorry, too early.
I got it working again after following the same steps again (without simplicity commander this time).
I had Debug Interface set to SWD this time, though I am actually using the JTAG Interface on the right side. Also the Debug interface says the board is not compatible.
I am a bit confused, why this is working now.
I will countercheck this with the old board later.
07-14-2017 04:38 AM
Breakpoints work right now, but pressing Reset (on new board) gets me an error message:
TCF error report:
Command: DeviceSupport reset "root.000440095746", "core"
Time: 2017-07-14 11:21:57.335
Error text: Command is not recognized
Error code: 25
I did not get this message with the old board.
07-14-2017 06:52 AM - edited 07-14-2017 06:52 AM
I think this is expected behavior.
When you press the reset button, the debugger's state and context information about the chip is no longer valid, and the connection will fail. I guess this didn't happen on the old board because reset didn't work.
07-15-2017 06:45 AM
@jpitt, @Audun Thanks for your help earlier and for pointing out the SWD mistake, however as said this did not solve the connection issue with the latest version of Simplicity Studio (reverting to an older version unfortunately is not possible with this one). Do you have any other ideas why i can not connect to my board on an updated machine or how to get a working version for that machine?
@JStollesorry for hijacking your post again. Btw, did you find out whether the reset pin is getting the signal on your old board (eg. via oscilloscope)?
07-17-2017 01:39 AM
07-17-2017 08:40 AM
Please enable adapter pack logging ([Window] > [Preferences] > [Simplicity Studio] > [Adapter Packs] and then check the box next to "Adapter pack log:") then recreate the problem of connecting to the target. After that please generate a zip file of the Simplicity Studio Logs - [Help] > [Report Bug...] make sure "Export Simplicity Studio log files" is selected, then hit [Next] twice and [Finish] and upload the resulting zip file to either this forum thread or to a support case created using your SiLabs account. Also if it would be possible to zip up and share a project that the issue is occurring with that might be helpful as well.
07-17-2017 09:34 AM
Thanks again for the quick reply. I did as you requested and added the files as attachments.
I cleared out the project of sensitive files, so it is more or less a bare project now (with no effect on the Issue). I hope this will be of help.
07-27-2017 10:56 AM
I didn't realize this was running on Linux, which distribution is being used? The logs files did not include the adapter pack logging, are you sure that was enabled in the preferences? If so can you look at the location specified and send us the adapter pack log file separately?
The error log files do show a lot of file not found errors for the Simplicity Studio cache directory. Please exit Simplicity Studio and then delete this directory:
Then restart Simplicity Studio. I have also shared the log files with a developer to try and get other ideas on what the issue might be.
07-28-2017 04:18 AM
thanks again for the quick response. The OS of the problematic machine is Ubuntu 14.04.5 LTS. Apparently the adapter log file was not included in the files i send to you even though i enabled them in the preferences. As you asked i attached it separately and deleted the cache (though it did not resolve the issue unfortunately). The adapter log file shows multiple unsuccessful connections since i tried the procedure every few days in case an update in simplicity v4 solved the issue by chance.