Wednesday, December 13th 2017, 12:11pm UTC+1

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

jasonob

Beginner

Date of registration: Mar 24th 2017

Posts: 2

1

Friday, March 24th 2017, 5:21pm

Name lookup with custom events not working correctly

I'm running SystemView 2.42 and capturing events from an STM32F469 system, running FreeRTOS 9. I've merged the SystemView patch (and adjusted appropriately so it works)

I'm trying to add my own events via ModuleRegister. That works, but I'm having problems with the address lookup feature.

I'm registering events like this

C/C++ Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#define SV_MAX_EVENTS 2
#define SV_WATCH_RECEIVE_EVENT 1

SEGGER_SYSVIEW_MODULE_STRUCT systemViewEventModule =
{
"M=EventMgr, " \
"0 WP_EVENT_Post Queue=%I Event=%u arg0=%u arg1=%u, " \
"1 WP_EVENT_Receive Queue=%I Event=%u arg0=%u arg1=%u res=%u", // sModule
SV_MAX_EVENTS,
0, // Offset - set by SEGGER_SYSVIEW_Register_Module()
systemViewEventModuleDesc,
NULL // pNext - set by SEGGER_SYSVIEW_Register_Module()
};

void systemViewEventModuleDesc(void)
{
SEGGER_SYSVIEW_NameResource((uint32_t)&EventMgr::GetInstance().guiEvents, "GUI EVENT QUEUE");
}

...

InitCode()
{
...
SEGGER_SYSVIEW_Conf();  	// Configure and initialize SystemView

...

SEGGER_SYSVIEW_RegisterModule(&systemViewEventModule);
}

RunningCode()
{
...

SEGGER_SYSVIEW_RecordU32x5(SV_WATCH_RECEIVE_EVENT + systemViewEventModule.EventOffset, (U32) this, msg.cmd, msg.args1, msg.args2, res);
}

I see my event in SystemView

WP_EVENT_Receive Queue=0x04002134 Event=0 arg0=0 arg1=0 res=0

However, the address of this (i.e. guiEvents) is 0x200084D0

There are a couple of oddities I've seen

* I had originally defined SEGGER_SYSVIEW_ID_BASE to be 0x20000000, but I found that the SystemView log always reported TimeBase as 0x10000000, regardless of how the firmware was configured, so I changed the firmware so SEGGER_SYSVIEW_ID_BASE is 0x10000000
* The reported address above (0x04002134) is 0x200084D0 in its ShrinkId form (i.e. - 0x10000000, and then >> 2)
* The address doesn't appear to be getting converted back to its regular form by the GUI (which means its useless for debugging, even without the address name lookup working)
* If I set SEGGER_SYSVIEW_ID to 0, it still doesn't work (and the GUI log continues to report TimeBase as 0x10000000)
* In the GUI log, I see it reporting a module as being registered, but I don't see any names be registered (I do see task & ISR names being registered)

Any guidance much appreciated

Cheers!

Jason