Author Topic: Segger JLink - Worth it for hobby use ?  (Read 6268 times)

0 Members and 1 Guest are viewing this topic.

Offline hans

  • Frequent Contributor
  • **
  • Posts: 998
  • Country: nl
Re: Segger JLink - Worth it for hobby use ?
« Reply #25 on: August 23, 2017, 09:54:22 pm »
Just had taken a look at the JLink SystemViewer software. It was easy to integrate into any RTOS, even experimental ones ('it just works'), and it gives a nice level of detail using fairly limited system resources. Combine that with a fast timestamped serial terminal , and overall it's quite nice. Thanks @mac.6 !

1 limitation is the number of events it can record per second. With a 1kB buffer on the chip, it seems to peak out at 500kbit/s of traffic  @ 4000kHz with my JLINK EDU, which is ~16k events/second. Still not bad though considering you get microsecond level timestamping.

Now if only the software a bit more stable... It seems the safest bet is to reset the target chip and replug the Jlink probe upon switching between OpenOCD GDB server and the SystemViewer software. Other the firmware is not properly flashed and you get spontaneous crashes and weird HardFaults.
 

Offline Sal Ammoniac

  • Frequent Contributor
  • **
  • Posts: 729
  • Country: us
Re: Segger JLink - Worth it for hobby use ?
« Reply #26 on: August 26, 2017, 01:37:42 am »
For debugging, Ozone and SES are probably pretty close. I know folks who use SES and like it a lot. For me, I prefer to use emacs for editing and use gmake for builds, so all I need is a debugger. Ozone fits that bill nicely.

I downloaded and installed Ozone and it seems to work well. I like its interface a lot.

One thing I couldn't find, however, is how to display peripheral registers. It'll display Cortex-M peripheral registers (like the NVIC, MPU, etc.) but I can't find a way to display non-Cortex registers such as for the I2C, SPI, and UART peripherals. The startup sequence asked me what kind of MCU I had (an Infineon XMC4700), so it knows that--is there a way to get Ozone to display these registers? If not, its usefulness to me is nearly zero because debugging driver code without being able to see these registers is a pain in the ass. Sure, I could dump the registers in raw form in the memory display by providing their start address, but all modern debuggers I've used display peripheral registers while interpreting their contents and breaking them down into their individual bit fields.
Never trust a government that doesn't trust you.
 

Offline Sal Ammoniac

  • Frequent Contributor
  • **
  • Posts: 729
  • Country: us
Re: Segger JLink - Worth it for hobby use ?
« Reply #27 on: August 26, 2017, 02:24:12 am »
For debugging, Ozone and SES are probably pretty close. I know folks who use SES and like it a lot. For me, I prefer to use emacs for editing and use gmake for builds, so all I need is a debugger. Ozone fits that bill nicely.

I downloaded and installed Ozone and it seems to work well. I like its interface a lot.

One thing I couldn't find, however, is how to display peripheral registers. It'll display Cortex-M peripheral registers (like the NVIC, MPU, etc.) but I can't find a way to display non-Cortex registers such as for the I2C, SPI, and UART peripherals. The startup sequence asked me what kind of MCU I had (an Infineon XMC4700), so it knows that--is there a way to get Ozone to display these registers? If not, its usefulness to me is nearly zero because debugging driver code without being able to see these registers is a pain in the ass. Sure, I could dump the registers in raw form in the memory display by providing their start address, but all modern debuggers I've used display peripheral registers while interpreting their contents and breaking them down into their individual bit fields.

Partially answered my own question: need an MCU-specific SVD file. Point Ozone to that and it'll display the peripheral registers.

Now I have a different problem. The register display is incomplete. Ozone displays the overall value of a 32-bit peripheral register, but when that register is expanded to show individual fields it sometimes shows the contents of each field and sometimes shows nonsense info like "value1" and "value2". Anyone seen this? Is there a fix, or is this a bug in Ozone or the SVD file?

Never trust a government that doesn't trust you.
 

Offline Sal Ammoniac

  • Frequent Contributor
  • **
  • Posts: 729
  • Country: us
Re: Segger JLink - Worth it for hobby use ?
« Reply #28 on: August 26, 2017, 04:28:14 am »
Now I have a different problem. The register display is incomplete. Ozone displays the overall value of a 32-bit peripheral register, but when that register is expanded to show individual fields it sometimes shows the contents of each field and sometimes shows nonsense info like "value1" and "value2". Anyone seen this? Is there a fix, or is this a bug in Ozone or the SVD file?

Found the answer to this one too... The SVD file has enumerations defined for individual bit positions in the registers, and it defines them like this:

Code: [Select]
<field>
<name>CLKSEL</name>
<description>Clock Selection</description>
<lsb>0</lsb>
<msb>1</msb>
<access>read-write</access>
<enumeratedValues>
<enumeratedValue>
<name>value1</name>
<description>The fractional divider frequency fFD is selected.</description>
<value>#00</value>
</enumeratedValue>
<enumeratedValue>
<name>value3</name>
<description>The trigger signal DX1T defines fPIN. Signal MCLK toggles with fPIN.</description>
<value>#10</value>
</enumeratedValue>
<enumeratedValue>
<name>value4</name>
<description>Signal MCLK corresponds to the DX1S signal and the frequency fPIN is derived from the rising edges of DX1S.</description>
<value>#11</value>
</enumeratedValue>
</enumeratedValues>
</field>

The "<name>value1</name>" tags cause Ozone to display this as a literal "value1" rather than the binary bits. Deleting this tag causes Ozone to display the right thing, e.g. b'01. It's going to be a pain editing the 123,000 line SVD file to remove all these tags.  :palm:
Never trust a government that doesn't trust you.
 

Offline thm_w

  • Frequent Contributor
  • **
  • Posts: 810
  • Country: ca
Re: Segger JLink - Worth it for hobby use ?
« Reply #29 on: August 26, 2017, 08:32:13 am »
The "<name>value1</name>" tags cause Ozone to display this as a literal "value1" rather than the binary bits. Deleting this tag causes Ozone to display the right thing, e.g. b'01. It's going to be a pain editing the 123,000 line SVD file to remove all these tags.  :palm:

Notepad++ find and replace, regex, something like this:

<name>value\d<\/name>
 

Offline Sal Ammoniac

  • Frequent Contributor
  • **
  • Posts: 729
  • Country: us
Re: Segger JLink - Worth it for hobby use ?
« Reply #30 on: August 26, 2017, 09:06:58 am »
The "<name>value1</name>" tags cause Ozone to display this as a literal "value1" rather than the binary bits. Deleting this tag causes Ozone to display the right thing, e.g. b'01. It's going to be a pain editing the 123,000 line SVD file to remove all these tags.  :palm:

Notepad++ find and replace, regex, something like this:

<name>value\d<\/name>

It's more complicated than that. Some of the name tags need to remain while others need to be deleted. It's not just a matter of deleting all of them.

I'll have to study the file in more detail to see if there's a pattern I can exploit when deleting these things. It's just strange that Ozone handles them this way... IAR and Eclipse use the same .svd files and they handle exploded views of the peripheral registers correctly.

EDIT: Turns out there was an easily identifiable pattern and I was able to delete the offending tags and now everything works as expected.
« Last Edit: August 26, 2017, 09:20:21 am by Sal Ammoniac »
Never trust a government that doesn't trust you.
 

Offline andyturk

  • Frequent Contributor
  • **
  • Posts: 873
  • Country: us
Re: Segger JLink - Worth it for hobby use ?
« Reply #31 on: August 26, 2017, 09:56:00 am »

It's more complicated than that. Some of the name tags need to remain while others need to be deleted. It's not just a matter of deleting all of them.

I'll have to study the file in more detail to see if there's a pattern I can exploit when deleting these things. It's just strange that Ozone handles them this way... IAR and Eclipse use the same .svd files and they handle exploded views of the peripheral registers correctly.

EDIT: Turns out there was an easily identifiable pattern and I was able to delete the offending tags and now everything works as expected.

Which probably means there might be an easy fix that Segger could make. In my experience, they've been pretty responsive to bug reports.
 

Offline MT

  • Frequent Contributor
  • **
  • Posts: 845
  • Country: fo
Re: Segger JLink - Worth it for hobby use ?
« Reply #32 on: August 26, 2017, 11:09:05 am »
@Sal Amoniac:

Are you using Ozone in eval mode?
 

Offline Sal Ammoniac

  • Frequent Contributor
  • **
  • Posts: 729
  • Country: us
Re: Segger JLink - Worth it for hobby use ?
« Reply #33 on: August 26, 2017, 05:38:09 pm »
@Sal Amoniac:

Are you using Ozone in eval mode?


No. I have a J-Link Plus, which is one of the supported devices.
Never trust a government that doesn't trust you.
 
The following users thanked this post: MT

Offline andyturk

  • Frequent Contributor
  • **
  • Posts: 873
  • Country: us
Re: Segger JLink - Worth it for hobby use ?
« Reply #34 on: August 27, 2017, 04:13:35 am »
No. I have a J-Link Plus, which is one of the supported devices.

For the record, I have a J-Trace Pro, which is also one of the supported/licensed debug probes. But I also use Ozone with STM32 Disco/Nucleo boards where the ST-Link has been replaced with JLink. Without using a supported probe from Segger, Ozone complains a little at startup, but still functions.

The debugger works well with both forms of J-Link, but it's potentially a lot more interesting with the J-Trace because there it can show detailed instruction history.
 
The following users thanked this post: trevwhite

Offline MT

  • Frequent Contributor
  • **
  • Posts: 845
  • Country: fo
Re: Segger JLink - Worth it for hobby use ?
« Reply #35 on: August 27, 2017, 11:03:26 pm »
I tried Ozone with a ST Nucleo reprogrammed with that Jlink soft and the only thing i can change in Ozone is register values in the target. Ozone is neat but are there more functional differences between eval and licenced mode then detailed instruction history.? Segger dont say much on their website  (STNucleo reprogrammed v.s J-Link PLUS, ULTRA+, PRO and J-Trace).
« Last Edit: August 27, 2017, 11:15:02 pm by MT »
 

Offline rsjsouza

  • Super Contributor
  • ***
  • Posts: 2586
  • Country: us
    • Vbe - vídeo blog eletrônico
Re: Segger JLink - Worth it for hobby use ?
« Reply #36 on: August 28, 2017, 03:02:11 am »
I like the Jlink I have, and using Ozone with the MSP432 is ok. I still need to find the missing peripheral registers, though.

Just like others mentioned, at these prices it is not worth getting thr clones.
Vbe - vídeo blog eletrônico http://videos.vbeletronico.com

Oh, the "whys" of the datasheets... The information is there not to be an axiomatic truth, but instead each speck of data must be slowly inhaled while carefully performing a deep search inside oneself to find the true metaphysical sense...
 

Offline andyturk

  • Frequent Contributor
  • **
  • Posts: 873
  • Country: us
Re: Segger JLink - Worth it for hobby use ?
« Reply #37 on: August 28, 2017, 05:55:45 am »
I tried Ozone with a ST Nucleo reprogrammed with that Jlink soft and the only thing i can change in Ozone is register values in the target. Ozone is neat but are there more functional differences between eval and licenced mode then detailed instruction history.? Segger dont say much on their website  (STNucleo reprogrammed v.s J-Link PLUS, ULTRA+, PRO and J-Trace).
I use Ozone with Nucleo boards and also via Segger's J-Trace probe. As far as I can tell, it's the same functionality in both scenarios. Ozone is a debugger (only), so you won't be able to modify source code or anything like that. But you can modify registers as the program runs, set breakpoints, data watchpoints, etc.
 
The following users thanked this post: MT

Offline Sal Ammoniac

  • Frequent Contributor
  • **
  • Posts: 729
  • Country: us
Re: Segger JLink - Worth it for hobby use ?
« Reply #38 on: August 29, 2017, 04:03:48 am »
I like the Jlink I have, and using Ozone with the MSP432 is ok. I still need to find the missing peripheral registers, though.

Ozone uses SVD files to decode the peripheral registers. You can find the SVD file for the MSP432 in the device family pack here:

http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/msp432cmsis/latest/index_FDS.html
Never trust a government that doesn't trust you.
 
The following users thanked this post: rsjsouza

Offline Sal Ammoniac

  • Frequent Contributor
  • **
  • Posts: 729
  • Country: us
Re: Segger JLink - Worth it for hobby use ?
« Reply #39 on: August 29, 2017, 09:10:25 am »
I tried Ozone with a ST Nucleo reprogrammed with that Jlink soft

Here's a link to the Segger software used to re-program the built-in debugger on Nucleo and Discovery boards to behave like a J-Link:

https://www.segger.com/products/debug-probes/j-link/models/other-j-links/st-link-on-board/
Never trust a government that doesn't trust you.
 

Offline ElektroQuark

  • Supporter
  • ****
  • Posts: 1206
  • Country: es
    • ElektroQuark
Re: Segger JLink - Worth it for hobby use ?
« Reply #40 on: August 29, 2017, 05:01:00 pm »
Most of the Kinetis Freedom boards from Freescale NXP can be "upgraded" to J-LINK.

Offline richardman

  • Frequent Contributor
  • **
  • Posts: 384
  • Country: us
Re: Segger JLink - Worth it for hobby use ?
« Reply #41 on: September 02, 2017, 11:43:43 am »
One problem with re-programmed JLINK is that it still complains about lack of purchased license. The Black Magic Probe may be a good alternative...
// richard http://imagecraft.com/
JumpStart C++ for Cortex (compiler/IDE/debugger): the fastest easiest way to get productive on Cortex-M.
REXIS: RTOS for the IoT
 

Offline thm_w

  • Frequent Contributor
  • **
  • Posts: 810
  • Country: ca
Re: Segger JLink - Worth it for hobby use ?
« Reply #42 on: September 06, 2017, 09:22:30 am »
One problem with re-programmed JLINK is that it still complains about lack of purchased license. The Black Magic Probe may be a good alternative...

I did the bluepill/stlink to blackmagic conversion, its not hard *once* you have the firmware, which for some reason no one uploads, all instructions have you compile it yourself.
Can load it with the built in stm32 serial bootloader or with a stlink.

It worked well until I did something to "kill" the chip (SAM D21). Of course, its atmel so they are fragile with the fuse settings, so its probably that. Currently I see no simple way to fix it with the blackmagic probe. The built in functions for D21 are limited (?), basically mass erase and read/write. It may be possible to run a program from memory that resets the fuses, I haven't tried that yet. Ended up ordering a jlink clone to see if that recovers it.
 

Offline mubes

  • Regular Contributor
  • *
  • Posts: 199
  • Country: gb
  • Do Not Boil
Re: Segger JLink - Worth it for hobby use ?
« Reply #43 on: September 06, 2017, 05:19:53 pm »
You will find bluepill BMP (with support for SWO at up to 2.25mbps too) and optimised pinouts at https://github.com/mubes/blackmagic

There are readmes in there too for the bluepill conversion.

You will also find utilities for using the SWO output in the orbuculum repository at the same account.

Regards

Dave
 
The following users thanked this post: thm_w

Offline royalt

  • Newbie
  • Posts: 1
Re: Segger JLink - Worth it for hobby use ?
« Reply #44 on: April 12, 2018, 01:59:52 am »
I'd get the 15 Euro real JLINK mini from Segger unless the 60$ version was really better for my needs somehow(?).
 
Or a real STLINK if applicable. 

I would not touch an ebay clone.

The only good ebay / generic ones could in my opinion be something that is a "clone" of something that is based on a fully open hardware specification / schematic / firmware anyway, and that's probably the case for several debuggers like the TI XDS100/XDS110 or Cypress KitProg  for instance I think all the schematics / firmware codes for the programming units are openly available for people to make their own debuggers or targets with integrated programming.  So in such cases there is less to worry about getting something from eBay or whatever as long as credible people independent of the vendor have verified that the product is really "just" the usual open HW device built from the open schematics with non counterfeit parts.


Thank you for the replies, what I have concluded for now is that the best solution is to wait and see what I will need when I will need it.

One last thing, do you think that the eBay clones are worth it (8 pounds instead of 60) or there are garbage ?

Alin
I've been using a Segger J-Link Base clone from Ebay for months now and it is terrific. In fact, it actually has all the functionality of the Plus version. The only thing is you get a popup frequently saying the J-Link may be defective. But it works absolutely fine down the line: J-Flash, GDB Server, etc. For $15 as opposed to, what, $1000? It is an absolute gem. It's only a few bucks. I don't know why you're worried about "trusting" it. It works or it doesn't. Not a big investment.

Sent from my Pixel 2 XL using Tapatalk

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf