Hello, I am currently developing a new product using the BGM13P22F512GA, but I have a problem using the debug. I followed different posts to try to solve the problem, but it still doesn't work. I use the GNU ARM V7.2.1 with the SDK V2.6.3. I have set my DEBUG_LEVEL to 1 and set the Target interface to SWD. But nothing to do the console remains empty despite my printLog in the beginning of the loop while. I don't know what to do anymore, if you could help me, I would be very grateful.
The console output shows output from the swo port, by default the Bluetooth software examples print the debug output on the VCOM port and that can be accessed by right clicking on the J-Link line in the Debug Adapters window and selecting [Launch Console...]. Then in the resulting window select the Serial 1 tab, click inside the window and click the Enter key to make the connection. After that reset the board and the output should be displayed:
To use the SWO port to see the output on "Console" output instead of the VCOM and the Launch Console, configure the project to use the swo port by following the instructions in this forum thread: https://www.silabs.com/community/software/simplicity-studio/forum.topic.html/swo_debug_printfin-V8bh
The main difference is that the retargetswo.c & .h and bsp_trace.c & .h files will be added to the project instead of the retargetserial.c file and RETARGET_SwoInit() is called instead of RETARGET_SerialInit(). Besides copying the files into the project from the SDK (default location C:\SiliconLabs\SimplicityStudio\v4\developer\sdks\gecko_sdk_suite\v2.6\hardware\kit\common\drivers) the other changes can be made by editing app.h. This is what I did while verifying that the above suggestion does work.
#define initLog() RETARGET_SerialInit()
#define flushLog() RETARGET_SerialFlush()
#define initLog() RETARGET_SwoInit()
#define printLog(...) printf(__VA_ARGS__)
I hope the above helps.