Wednesday, December 13th 2017, 8:04am 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.

tadzik85

Beginner

Date of registration: Feb 3rd 2014

Posts: 24

Location: Bydgoszcz POLAND

1

Monday, May 9th 2016, 12:12pm

[SOLVED] Jlink Resettype, Monitor mode

Hello.

I put STM32f407IG into deepsleep mode. Then i can connect with jlink. WHY? Why reset metod for connection can be settable?

What i need to test Monitor debug mode? I try to use it with same STM. but i get info that this mode can be used with my JLINK.
In monitor mode it is posible to get real time variable watch?? (GDB +ECLIPSE).

SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,691

2

Monday, May 9th 2016, 1:35pm

Hello,

Quoted

Then i can connect with jlink. WHY? Why reset metod for connection can be settable?

Could you describe the situation, the expected outcome and the practical outcome in more detail?

Quoted

What i need to test Monitor debug mode?

Monitor mode is described here: https://www.segger.com/monitor-mode-debugging.html
Quote of the important part:

Quoted

How it works

In contrast to halt mode debugging, in monitor mode debugging the target CPU does not halt on a debug request but takes a debug interrupt instead and jumps to a specific debug interrupt handler which then handles the communication with J-Link and also some low-level application maintenance that may be needed to be done while the application is halted. So technically, the CPU is still running and executing code while the application itself is halted, allowing it to still handle some interrupts as well as some synchronous maintenance operation that can be done within the monitor code.

The monitor code consists of the following parts:
  • A generic monitor that handles communication with J-Link. This part is delivered by SEGGER and should not be modified by the user.
  • A custom monitor part providing some functions that can be filled in by the user. SEGGER delivers a template for this part.


The custom monitor part provides the following functions where the user can add functionality/maintenance which needs to be done in debug mode:

  • JLINK_MONITOR_OnExit(): Called once just before leaving the monitor and restarting the target application.
  • JLINK_MONITOR_OnEnter(): Called once just before entering the monitor. Target application is already stopped at this point.
  • JLINK_MONITOR_OnPoll(): Called periodically while the CPU is in debug mode.

The monitor modules simply need to be compiled, linked and downloaded with the application. For limitations to what can be done in the different functions of the custom monitor part, please refer to the J-Link User Guide.


Cortex-M4 is supported.

Quoted

I try to use it with same STM. but i get info that this mode can be used with my JLINK.

I do not understand this sentence.

Quoted

In monitor mode it is posible to get real time variable watch?? (GDB +ECLIPSE).

I am not really sure what exactly you want to know here either.
What technique do you currently use for "real time variable watch"?
RTT works with monitor mode.

Best regards,
Niklas
Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
Notification for Embedded Studio: Link

tadzik85

Beginner

Date of registration: Feb 3rd 2014

Posts: 24

Location: Bydgoszcz POLAND

3

Monday, May 9th 2016, 3:02pm

I use this all files from your site. Al it's OK. but when I connect by GDB server, I get message that this jlink (EDU V8 ) not support monitor mode.


Real time watch means that variable value will be visible with all changes when program runs not only when halt.

If CPU is in deep sleep, Jlink assumes that STM32 is locked. WHY? I don't now.

SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,691

4

Monday, May 9th 2016, 4:50pm

Hi,

Monitor mode is supported by
J-Link EDU* / BASE* / PLUS v9 or higher
J-Link ULTRA+ / PRO v4 or higher
*Evaluation only

Best regards,
Niklas
Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
Notification for Embedded Studio: Link

tadzik85

Beginner

Date of registration: Feb 3rd 2014

Posts: 24

Location: Bydgoszcz POLAND

5

Monday, May 9th 2016, 7:38pm

OK. From some time i thinking about buy jlink (not edu). But this connection problem is important to me. Usually I develop Low power aplications. If cennection with target will be impossible, i will need to find tool that can this.

Can someone tell me what ather futures have monitor debug mode? It's clear for me that i can set breakpoint without stoppig apllication. What else? (consider GDB).

What highiest SWD frequency for STM32F4 can be set? 4000kHz With Jlink EDU (software implementation) but with others?


I thinking about what i will get with full jlink version (ULTRA for example). I'm notice comersial usage, and some licences.

Acording JLINK documentation v5.12 rev 0 page 32 - cortex m4 aren't suporrted?, stange I work from 2 years with this version on M4. M7? (typo??)..

I wonna to check if STM32L011 i supported? i try to check this in beta version but manual looks like from stable release.

SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,691

6

Tuesday, May 10th 2016, 9:50am

Hi,

Quoted

Usually I develop Low power aplications. If cennection with target will be impossible, i will need to find tool that can this.

This depends on multiple thinks. In some cases, we can provide support to debug in low power mode (and we have been doing so).
In case a low power mode disables the debug unit - than there is not much a J-Link or any other debug probe can do.
Sometimes a debug probe can disable the low power mode by sending a special sequence via a debug interface and then connect to the target - but what is the point of turning the low power mode on in the first place?

Quoted

Can someone tell me what ather futures have monitor debug mode?

I do not have much to add to what is said on the website.
However, J-Link PLUS and ULTRA+ will come with licenses for
Ozone (J-Link Debugger) https://www.segger.com/ozone.html
J-Flash https://www.segger.com/jflash.html

Buying and current generation Debugger will granting you access to the following features:
SEGGER RTT https://www.segger.com/jlink-rtt.html
SEGGER System View https://www.segger.com/systemview.html (Awesome in order to optimize performance and power consumption)
SEGGER J-Scope https://www.segger.com/j-link-j-scope.html (Live global / static watch, up to 100k samples per second)

Differences between BASE / PLUS and ULTRA+ have also been listed by my colleague Johannes here: Hardware upgrade.

Quoted

What highiest SWD frequency for STM32F4 can be set? 4000kHz With Jlink EDU (software implementation) but with others?

J-Link BASE / PLUS v10: 15000 kHz
J-Link ULTRA+: 50000kHz possible. STM32F4 target: At least 25000 kHz - 30000 kHz

Quoted

Acording JLINK documentation v5.12 rev 0 page 32 - cortex m4 aren't suporrted?,

This is a mistake, thanks for pointing this out. Cortex-M4 is fully supported since Version 8.0

Quoted

I wonna to check if STM32L011 i supported?

This can be looked up on our website: https://www.segger.com/jlink_supported_devices.html?m=ST#sel
We currently do support the STM32L0 series, but not the STM32L011 device, as they are quit new.
Support for STM32L011 us planned for the future, but without a fixed release date yet.

Best regards,
Niklas
Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
Notification for Embedded Studio: Link

tadzik85

Beginner

Date of registration: Feb 3rd 2014

Posts: 24

Location: Bydgoszcz POLAND

7

Tuesday, May 10th 2016, 10:00am

Sometimes a debug probe can disable the low power mode by sending a special sequence via a debug interface and then connect to the target - but what is the point of turning the low power mode on in the first place?
In realease version i need do some measurments. With debeger connected it isn't posibble to do this (in STM we get extra 300uA consumption). But when i try to connet to device i LP mode i should be posiible.
STlink (Openocd give mi posiibility to connect under reset) In keil i it posible to set connect under reset (ResetType 3 - according to JLink dokumentation). Buy it is strange that this type of reset can be set before conection. This isn't logical.

Quoted

Differences between BASE / PLUS and ULTRA+ have also been listed by my colleague Johannes here: Hardware upgrade.
This is very general info, only JLINK related. My question is target related, becose maybe target will have some restrictions. And as you mention earlier, for example monitor mode will not work etc. Jlink support much more MCU i need so...

Try to understand. I want to know for what i will pay.

This post has been edited 1 times, last edit by "tadzik85" (May 10th 2016, 10:07am)


SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,691

8

Tuesday, May 10th 2016, 10:38am

Hi,

Quoted

This is very general info, only JLINK related. My question is target related, becose maybe target will have some restrictions. And as you mention earlier, for example monitor mode will not work etc. Jlink support much more MCU i need so...

Maybe I was not clear enough:
Monitor mode is not supported with Hardware version 8.0, but it is supported with Version 9 (BASE /PLUS) or higher or ULTRA+ / PRO version 4 or higher.
All features / tools I listed as an example (Ozone, J-Flash, RTT, Systemview, J-Scope) can be used with a J-Link ULTRA v4 and a STM32F4 target. (And with any other (and not limited to only that) Cortex-M0/M3/M4/M7 target listed here)

I also said you can expect a SWD speed of 15000 kHz with BASE / PLUS and 25000 kHz or higher using a J-Link ULTRA+/PRO with a STM32F4 target.

Best regards,
Niklas
Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
Notification for Embedded Studio: Link

tadzik85

Beginner

Date of registration: Feb 3rd 2014

Posts: 24

Location: Bydgoszcz POLAND

9

Tuesday, May 10th 2016, 11:29am

I also said you can expect a SWD speed of 15000 kHz with BASE / PLUS
Not 4000?,

What with connection under reset.

SEGGER - Niklas

Super Moderator

Date of registration: Oct 6th 2014

Posts: 1,691

10

Tuesday, May 10th 2016, 12:17pm

Hi,

Connect under reset should work even with version 8.0 - if you are using the newest software version https://www.segger.com/jlink-software.html .
You do not need to configure this, it connect under reset is executed as a fallback if normal connect does not work.

J-Link will force to hold the connection, even if the STM32 is running low power modes.

Best regards,
Niklas
Would you like to be added to the J-Link software update notification list, so you get informed automatically when a new version becomes available?
Just write me a PM or in case you want to subscribe to it yourself, please use this link: Link
Notification for J-Link, J-Link Debugger, SystemView & J-Scope: Link
Notification for Embedded Studio: Link

tadzik85

Beginner

Date of registration: Feb 3rd 2014

Posts: 24

Location: Bydgoszcz POLAND

11

Tuesday, May 10th 2016, 6:36pm

Code:

PWR->CR |= PWR_CR_PDDS;
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
__WFI();


In this mode cennection isn't posible.

tadzik85

Beginner

Date of registration: Feb 3rd 2014

Posts: 24

Location: Bydgoszcz POLAND

12

Monday, May 23rd 2016, 9:02am

Something?

SEGGER - Alex

Super Moderator

Date of registration: Dec 18th 2007

Posts: 1,514

13

Tuesday, May 24th 2016, 11:42pm

Hi,

J-Link makes sure that it does not loses connection to the STM32 if it enters a low power mode.
Fortunately, this is possible at all on an STM32. (On many CPUs the debug connection is simply lost in low power modes)

However, while the target is in a low power mode, you may not be able to watch variables etc. because the RAM might get be inaccessible (powered off).
This is something you have to live with or you use another low power mode while debugging (a one that does not remove power from the RAM).
In general, it does not make much sense to use low power modes during debug, because:
1) On almost all targets you will lose the connection to the target
2) On the ones where you do not (e.g. STM32), you will see a significantly higher power consumption while a debugger is connected, so it makes absolutely no sense to measure power consumption here


Best regards
Alex

tadzik85

Beginner

Date of registration: Feb 3rd 2014

Posts: 24

Location: Bydgoszcz POLAND

14

Friday, May 27th 2016, 9:15pm

J-Link makes sure that it does not loses connection to the STM32 if it enters a low power mode.
Fortunately, this is possible at all on an STM32. (On many CPUs the debug connection is simply lost in low power modes)

However, while the target is in a low power mode, you may not be able to watch variables etc. because the RAM might get be inaccessible (powered off).
This is something you have to live with or you use another low power mode while debugging (a one that does not remove power from the RAM).
In general, it does not make much sense to use low power modes during debug, because:
1) On almost all targets you will lose the connection to the target
2) On the ones where you do not (e.g. STM32), you will see a significantly higher power consumption while a debugger is connected, so it makes absolutely no sense to measure power consumption here


Best regards
Alex
I'm not talking about this. For this is relative bit in DBGMCU.

I'm talkich about connection stage , not debuggieng. This same behavior is when i try to reprogramo erace etc STM32. Jlink.exe once get warning about posibility that taget is blocked. But gdb server never will connect.

This is clear. Connect under reset not work.

tadzik85

Beginner

Date of registration: Feb 3rd 2014

Posts: 24

Location: Bydgoszcz POLAND

15

Wednesday, June 15th 2016, 9:21am

.....

SEGGER - Alex

Super Moderator

Date of registration: Dec 18th 2007

Posts: 1,514

16

Friday, December 16th 2016, 3:53pm

Quoted

I'm not talking about this. For this is relative bit in DBGMCU.

I'm talkich about connection stage , not debuggieng. This same behavior is when i try to reprogramo erace etc STM32. Jlink.exe once get warning about posibility that taget is blocked. But gdb server never will connect.

This is clear. Connect under reset not work.


Sorry, but I have no idea what you are trying to tell me here.

You write:

Quoted


PWR->CR |= PWR_CR_PDDS;
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
__WFI();

In this mode cennection isn't posible.


This is not true. Works fine.
Of course you need to have the reset pin of the CPU connected to J-Link, to allow it to do a "connect under reset" to gain control of the CPU again.
We have many customers using this.


Best regards
Alex