Sunday, February 25th 2018, 6:37pm 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.

JLuc

Beginner

Date of registration: Oct 25th 2011

Posts: 7

1

Thursday, November 19th 2015, 12:07pm

EmbOS V4.12a and SystemView V2.10: struct OS_TRACE_API size mismatch

Hi All,
I'm trying to implement SystemView V2.10 with EmbOS V4.12a libraries.
IDE is IAR's EWARM 7.20.
Target CORTEX M3 STM32F101
Project based on EmbOS 'Start' blinking 2 leds in 2 tasks, running fluently w/o System View.

When compiling with System View files, i get this error:

Updating build tree...
SEGGER_SYSVIEW_embOS.c
Error[Pe146]: too many initializer values C:\...\System Viewer 2.10\TargetSrc\Sample\OS\SEGGER_SYSVIEW_embOS.c 139
Error while running C/C++ Compiler

It's due to the structure OS_TRACE_API size mismatch between RTOS.h in EmbOS and const OS_TRACE_API embOS_TraceAPI_SYSVIEW initialization in SEGGER_SYSVIEW_embOS.c.


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
38
39
40
41
42
43
44
45
46
47
**********************************************************************
*                                                                	*
*   	OS version: 4.12a                                        	*
*                                                                	*
**********************************************************************

----------------------------------------------------------------------
Licensing information

Licensor:             	SEGGER Microcontroller GmbH & Co. KG

File	: RTOS.h
Purpose : Include file for the OS,
      	to be included in every C-module accessing OS-routines

NOTE	: NONE OF THE DEFINITIONS IN THIS FILE MAY BE MODIFIED
      	as long as embOS libraries are used.

typedef struct {
  //
  // Specific Trace Events
  //
  void (*pfRecordEnterISR)       	(void);
 ....
  OS_U32 (*pfPtrToId) 	(OS_U32 Ptr);
} OS_TRACE_API;

**********************************************************************
*                                                                	*
*   	SystemView version: V2.10                                	*
*                                                                	*
**********************************************************************
----------------------------------------------------------------------
File	: SEGGER_SYSVIEW_embOS.c
Purpose : Interface between embOS and System View.
// embOS trace API that targets SYSVIEW

const OS_TRACE_API embOS_TraceAPI_SYSVIEW = {
//
// Specific Trace Events
//
SEGGER_SYSVIEW_RecordEnterISR,            	//  void (*pfRecordEnterISR)    	(void);
....
SEGGER_SYSVIEW_ShrinkId,                  	//  OS_U32  (*pfPtrToId)    	(OS_U32 Ptr);
SEGGER_SYSVIEW_RecordEnterTimer,          	//  void	(*pfRecordEnterTimer)   	(OS_U32 TimerID); <---- These 2 elements are not in RTOS.h declaration
SEGGER_SYSVIEW_RecordExitTimer            	//  void	(*pfRecordExitTimer)    	(void);
};



As explained in System View manual, V4.12a should be the best version. Any idea ?
Regards
Jluc

SEGGER - Martin

Super Moderator

Date of registration: Jul 1st 2014

Posts: 34

2

Thursday, November 19th 2015, 12:15pm

Dear JLuc,

This is a known issue with SystemView V2.10, which is missing a check for the embOS version in use, thus resulting in the observed incompatibility.
However, this was already fixed with SystemView V2.20, which is available for download at: https://www.segger.com/systemview.html .
Please kindly excuse any inconvenience caused.

Best regards,
Martin

JLuc

Beginner

Date of registration: Oct 25th 2011

Posts: 7

3

Thursday, November 19th 2015, 2:19pm

Hello Martin,
I've downloaded and compiled 2.20 release:

SEGGER_SYSVIEW.c
Error[Pe018]: expected a ")" C:\Projets EWARM 7.20\EmbOs V4.12a STLib V3.50 - System Viewer 2.20\System Viewer 2.20\TargetSrc\Config\SEGGER_SYSVIEW_Conf.h 75
Remark[Pe193]: zero used for undefined preprocessing identifier "SEGGER_SYSVIEW_CORE_M3" C:\Projets EWARM 7.20\EmbOs V4.12a STLib V3.50 - System Viewer 2.20\System Viewer 2.20\TargetSrc\Config\SEGGER_SYSVIEW_Conf.h 101
Remark[Pe193]: zero used for undefined preprocessing identifier "SEGGER_SYSVIEW_CORE_M3" C:\Projets EWARM 7.20\EmbOs V4.12a STLib V3.50 - System Viewer 2.20\System Viewer 2.20\TargetSrc\Config\SEGGER_SYSVIEW_Conf.h 120
Remark[Pe193]: zero used for undefined preprocessing identifier "SEGGER_SYSVIEW_CORE_M3" C:\Projets EWARM 7.20\EmbOs V4.12a STLib V3.50 - System Viewer 2.20\System Viewer 2.20\TargetSrc\Config\SEGGER_SYSVIEW_Conf.h 122
Fatal Error[Pe035]: #error directive: "SEGGER_SYSVIEW_GET_INTERRUPT_ID has to be defined!" C:\Projets EWARM 7.20\EmbOs V4.12a STLib V3.50 - System Viewer 2.20\System Viewer 2.20\TargetSrc\Config\SEGGER_SYSVIEW_Conf.h 125
Error while running C/C++ Compiler

outch !

In SEGGER_SYSVIEW_Conf.h,
(1) parenthesis is missing in line 74,
(2) definitions SEGGER_SYSVIEW_CORE_M3 & SEGGER_SYSVIEW_CORE_M0 are not correct: they should be SEGGER_SYSVIEW_CORE_CM3 & SEGGER_SYSVIEW_CORE_CM0 as defined at the
top of the file.

C/C++ Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
#if (defined __SES_ARM) || (defined __CROSSWORKS_ARM) || (defined __GNUC__)
  #ifdef __ARM_ARCH_6M__
	#define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_M0 <-----------------
  #elif (defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__))
	#define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_M3 <-----------------
  #endif
#elif defined(__ICCARM__)
  #if (defined (__ARM6M__) && (__CORE__ == __ARM6M__))
	#define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_M0 <-----------------
  #elif ((defined (__ARM7M__) && (__CORE__ == __ARM7M__)) || (defined (__ARM7EM__) && (__CORE__ == __ARM7EM__)))<--- this one is missing
	#define SEGGER_SYSVIEW_CORE SEGGER_SYSVIEW_CORE_M3 <-----------------
  #endif
#endif

The firmware is now running, but I can't get trace in SystemView :wacko:
It fails at connection: Cannot start recording. My jlink release is : dll V5.03i, hardware V8.0, JLink V8 Nov 28 2014
It's connected to the target (checked in JLink commander)

Any idea ?
JLuc

SEGGER - Martin

Super Moderator

Date of registration: Jul 1st 2014

Posts: 34

4

Thursday, November 19th 2015, 4:52pm

Hello JLuc,


outch !

In SEGGER_SYSVIEW_Conf.h,
(1) parenthesis is missing in line 74,
(2) definitions SEGGER_SYSVIEW_CORE_M3 & SEGGER_SYSVIEW_CORE_M0 are not correct: they should be SEGGER_SYSVIEW_CORE_CM3 & SEGGER_SYSVIEW_CORE_CM0 as defined at the
top of the file.


Thanks for pointing this out! We'll apply the appropiate fixes for the next release of the software.


The firmware is now running, but I can't get trace in SystemView :wacko:
It fails at connection: Cannot start recording. My jlink release is : dll V5.03i, hardware V8.0, JLink V8 Nov 28 2014
It's connected to the target (checked in JLink commander)

Any idea ?
JLuc


Did you call SEGGER_SYSVIEW_Conf() from within your application?
Furthermore, did you configure the appropiate device in SystemViewer?

Regards,
Martin

JLuc

Beginner

Date of registration: Oct 25th 2011

Posts: 7

5

Friday, November 20th 2015, 9:59am

Dear Martin,

Quoted

Did you call SEGGER_SYSVIEW_Conf() from within your application?
Yes. My program is more or less a copy paste of the user manual example:

C/C++ Source code

1
2
3
4
5
6
7
8
9
10
11
int main(void) {
  OS_IncDI();                  	/* Initially disable interrupts  */
  OS_InitKern();               	/* Initialize OS             	*/
  OS_InitHW();                 	/* Initialize Hardware for OS	*/
  BSP_Init();                  	/* Initialize LED ports      	*/
  SEGGER_SYSVIEW_Conf();       	/* Configure and initialize SystemView */
  OS_CREATETASK(&TCBHP, "HP Task", HPTask, 100, StackHP);
  OS_CREATETASK(&TCBLP, "LP Task", LPTask,  50, StackLP);
  OS_Start();                  	/* Start multitasking        	*/
  return 0;
}


Quoted

Furthermore, did you configure the appropiate device in SystemViewer?
Let me know what should I configure. TODO: add a paragraph in the manual regarding JLink connection.

Here's the parameters in the connection to JLink window:
Connection to JLINK : USB
Target Device: Unspecified
Target Interface & Speed = SWD @2000kHz (same as EmbOSView, works fine)
RTT Control block detection : Auto detection

It's difficult to debug because Sysview and debugger are exclusive.


Best regards
JLuc

SEGGER - Martin

Super Moderator

Date of registration: Jul 1st 2014

Posts: 34

6

Friday, November 20th 2015, 11:14am

Hi JLuc,


Let me know what should I configure. TODO: add a paragraph in the manual regarding JLink connection.

I have forwarded your request to the developers assigned with SystemView. They'll add the requested information to upcoming releases.


Here's the parameters in the connection to JLink window:
Connection to JLINK : USB
Target Device: Unspecified
Target Interface & Speed = SWD @2000kHz (same as EmbOSView, works fine)
RTT Control block detection : Auto detection

Your configuration seems fine except for "Unspecified": When no debug session is running in parallel, you'd need to specify the target device inside SystemViewer, e.g. STM32F101VG.


It's difficult to debug because Sysview and debugger are exclusive.

For a Cortex-M3 using SWO, both the IAR C-SPY debugger and SEGGER SystemView should be able to run in parallel. Did you experience an error message telling "Second debugger connection to the same J-Link detected"?

Best regards,
Martin

JLuc

Beginner

Date of registration: Oct 25th 2011

Posts: 7

7

Friday, November 20th 2015, 11:22am

Dear Martin,
finally it works !
The problem is in the RTT connection. When in AUTO mode, RTT can't find the buffers, even in range mode. I've to fill the address manually, in address mode.
You can find it in the map file, look for _SEGGER_RTT, something like 0x20000D5C.

By the way, the tip (help) for this field doesn't appear if the connection fails.

Waiting for the V2.30....
Regards
JLuc

JLuc

Beginner

Date of registration: Oct 25th 2011

Posts: 7

8

Friday, November 20th 2015, 11:39am

Dear Martin,

Quoted

For a Cortex-M3 using SWO, both the IAR C-SPY debugger and SEGGER
SystemView should be able to run in parallel. Did you experience an
error message telling "Second debugger connection to the same J-Link
detected"?
It doesn't work, even with the correct address, no message.

Quoted

Your configuration seems fine except for "Unspecified": When no debug
session is running in parallel, you'd need to specify the target device
inside SystemViewer, e.g. STM32F101VG.
In fact, I get 'CORTEX-M3' and UNSPECIFIED in the combo box after a valid connection.
It looks like a recursive problem: you can't get all parameters for connection until you get a connection.

I hope that helps.

Best regards.

SEGGER - Martin

Super Moderator

Date of registration: Jul 1st 2014

Posts: 34

9

Friday, November 20th 2015, 11:44am

Hi JLuc,

Dear Martin,
finally it works !
The problem is in the RTT connection. When in AUTO mode, RTT can't find the buffers, even in range mode. I've to fill the address manually, in address mode.

Glad to hear it is finally working! I'll push the devs to release V2.30 soon. ;)

Regards,
Martin

Martin

Beginner

Date of registration: Mar 9th 2011

Posts: 11

10

Thursday, November 26th 2015, 1:22pm

I have the same problem with OS_TRACE_API size mismatch using embOS V4.12 (that's the newest version for Cortex-M for Keil) and SystemView V2.20.
The OS_TRACE_API definition in RTOS.h missmatches with it's using in SEGGER_SYSVIEW_embOS.c.
The SystemView documentation says that it will work with embOS since V4.12 but that seams to be wrong. Do I need a newer version of embOS (which is not released for Keil at the moment!).

SEGGER - Martin

Super Moderator

Date of registration: Jul 1st 2014

Posts: 34

11

Thursday, November 26th 2015, 4:43pm

Hi Martin,

The SystemView documentation says that it will work with embOS since V4.12 but that seams to be wrong. Do I need a newer version of embOS (which is not released for Keil at the moment!).

You're correct, a more recent embOS version is required. While SystemView support was in deed implemented with embOS V4.12, recent versions of SystemView require V4.12a of embOS. We expect to release an updated version of embOS for Cortex-M and KEIL MDK within the next week, which will provide full support for the most recent version of SystemView. Please kindly excuse the inconvenience.

Best regards,
Martin

Martin

Beginner

Date of registration: Mar 9th 2011

Posts: 11

12

Friday, February 19th 2016, 11:15am

We expect to release an updated version of embOS for Cortex-M and KEIL MDK within the next week, which will provide full support for the most recent version of SystemView. Please kindly excuse the inconvenience.

Best regards,
Martin
Hello Martin,

I can't see an update for the embOS object Code on Cortex-M and KEIL MDK until now. The actuall version is 4.12 with NO SystemView support.
When will the update be available for Cortex-M and KEIL? Some other embOS Sources using already 4.16!

SEGGER - Til

Super Moderator

Date of registration: Nov 14th 2007

Posts: 264

13

Friday, February 19th 2016, 2:41pm

Hello Martin,

sorry for the delay, we were pretty busy last week (EW2016 is coming!).
We always try to keep all embOS ports up to date which needs some time with so many ports (currently we have over 80 embOS ports :) ).
Anyhow I will give this high priority now and keep you informed.

Btw.: In such a case and since your are in support please don't hesitate to contact us via the embOS support email address or give as a call.

Best regards,
Til

SEGGER - Martin

Super Moderator

Date of registration: Jul 1st 2014

Posts: 34

14

Friday, March 11th 2016, 10:23am

embOS V4.16 has now been released for Cortex-M and Keil MDK. Please kindly excuse any inconvenience caused.

Best regards,
Martin