Hello!
I've been working with the SEGGER_RTT suite for a while on our cortex-M4 without any problems, however I cannot get the same working on the M0 of our bluetooth module (DA14580).
In a little more detail:
The working setup on the M4
We use Eclipse IDE and work on Mac OSX, where we are able to load binaries, stop, start, add breakpoints etc. and inspect local/global variables and registers. In our (C++) code on the M4, one of the first calls in main() is SEGGER_SYSVIEW_Conf();. Later on, calls to functions like SEGGER_RTT_printf(0,"some formatstring"); occur. After loading the code with Eclipse the program JLinkRTTClient is able to identify that there is a GDB connection to the device and we receive output.
The problematic setup on the M0
On the bluetooth chip, it is possible to load the binary using Eclipse in the same way and inspection of variables also works. The JLinkRTTClient can again identify that there is a debug probe, and it reports the serial number of the attached probe. After that, JLinkRTTClient show no output.
The code base of the bluetooth module is written in C and the SYSVIEW library is not used. Therefor, the first call to the RTT library is SEGGER_Init(); and from inspection of the memory it seems that everything is perfectly fine. The address of the rtt control block can be found this way and coincides with the .map file of the build.
Tried fixes
Since the (Telnet?) JLinkRTTClient can connect to the jlink gdb server it seemed to us that the rtt control block could not be located so we tried to provide a hint to JLinkRTTClient by adding "monitor exec SetRTTSearchRanges 0x20000000 0x10000" to Eclipses settings "Debug Configurations > GDB SEGGER J-Link Debugging > myconf > Startup > Run/Restart Commands", knowing that the actual address is 0x20008004 and that its size is far less than 0x7ffc (= 0x10000 - 0x8004). This has no effect.
We also tried to initialise the memory of the control block to zero right before calling SEGGER_RTT_Init, because it seemed that the bss memory wasn't always zeroed on startup. This neither made a difference.
As a side note: the bluetooth module that we use has one-time-programmable flash memory, which on most of our devices has been used for other purpose (before we started to include segger rtt features).
Moreover, we also use the options:
"set mem inaccessible-by-default off" and
"set remote memory-read-packet-size 64" in Eclipses settings "Debug Configurations > GDB SEGGER J-Link Debugging > myconf > Debugger > GDB Client Setup > Commands"
Could anyone provide new ideas for troubleshooting, or (hint at) a possible solution?
Best!
Arend
I've been working with the SEGGER_RTT suite for a while on our cortex-M4 without any problems, however I cannot get the same working on the M0 of our bluetooth module (DA14580).
In a little more detail:
The working setup on the M4
We use Eclipse IDE and work on Mac OSX, where we are able to load binaries, stop, start, add breakpoints etc. and inspect local/global variables and registers. In our (C++) code on the M4, one of the first calls in main() is SEGGER_SYSVIEW_Conf();. Later on, calls to functions like SEGGER_RTT_printf(0,"some formatstring"); occur. After loading the code with Eclipse the program JLinkRTTClient is able to identify that there is a GDB connection to the device and we receive output.
The problematic setup on the M0
On the bluetooth chip, it is possible to load the binary using Eclipse in the same way and inspection of variables also works. The JLinkRTTClient can again identify that there is a debug probe, and it reports the serial number of the attached probe. After that, JLinkRTTClient show no output.
The code base of the bluetooth module is written in C and the SYSVIEW library is not used. Therefor, the first call to the RTT library is SEGGER_Init(); and from inspection of the memory it seems that everything is perfectly fine. The address of the rtt control block can be found this way and coincides with the .map file of the build.
Tried fixes
Since the (Telnet?) JLinkRTTClient can connect to the jlink gdb server it seemed to us that the rtt control block could not be located so we tried to provide a hint to JLinkRTTClient by adding "monitor exec SetRTTSearchRanges 0x20000000 0x10000" to Eclipses settings "Debug Configurations > GDB SEGGER J-Link Debugging > myconf > Startup > Run/Restart Commands", knowing that the actual address is 0x20008004 and that its size is far less than 0x7ffc (= 0x10000 - 0x8004). This has no effect.
We also tried to initialise the memory of the control block to zero right before calling SEGGER_RTT_Init, because it seemed that the bss memory wasn't always zeroed on startup. This neither made a difference.
As a side note: the bluetooth module that we use has one-time-programmable flash memory, which on most of our devices has been used for other purpose (before we started to include segger rtt features).
Moreover, we also use the options:
"set mem inaccessible-by-default off" and
"set remote memory-read-packet-size 64" in Eclipses settings "Debug Configurations > GDB SEGGER J-Link Debugging > myconf > Debugger > GDB Client Setup > Commands"
Could anyone provide new ideas for troubleshooting, or (hint at) a possible solution?
Best!
Arend