Segger JLink - Worth it for hobby use ? - Page 1
Forum section: electronics / general

author: alin_im
author_rank: Regular Contributor
timestamp: August 20, 2017, 12:19:31 pm
content: Hey guys,I am thinking of purchasing a Segger JLink EDU, is it worth it for hobby use ? I have some past experience with MCUs, but I want to get a little bit more serious with them.My job is not in embedded systems so I will purchase for personal use. I do not have any project in mind to do, so I will just experiment with it until an idea comes.Do you think I should buy it or just stick with some cheap development platform like Nucleo and don't bother. I think Nucleo already has a build in debugger.What I find very nice is that it doesn't matter what MCU you are using as long as it is an ARM M and you can program and debug it without the need of having individual programmers for each vendor.For 60 pounds it is a little bit pricey, but if I am going to focus on this in my free time it may be worth it. What do you think ?Regards,Alin

author: ataradov
author_rank: Super Contributor
timestamp: August 20, 2017, 02:04:03 pm
content: It all depends on your style of work.I personally would not get one for $10. But a lot of people think about then as "profesional" for some arbitrary reason.

author: filssavi
author_rank: Frequent Contributor
timestamp: August 20, 2017, 02:40:02 pm
content: The biggest advantage as you mentioned is the cross vendor compatibility is very nice, but It is not the only advantage, often the ICE you find on cheap Dev board are somewhat slow (very slow some times) and they might have less features and more often than not they are just cut down j-link's

author: Kjelt
author_rank: Super Contributor
timestamp: August 20, 2017, 02:52:28 pm
content: There is firmware to reprogram an stlink to segger jlink, you have to google it but for €20 for the st link that could be a better deal. However a genuine segger is always preferred IMO.

author: stmdude
author_rank: Frequent Contributor
timestamp: August 20, 2017, 02:53:45 pm
content: Yea, I've had the misfortune of recently being introduced to the Segger J-Links (not the EDU version, the bigger ones).The hardware seems alright, but their software is utter crap. At least the command-line stuff is, as I haven't tested their IDE integration..Even if you disregard the softwares lack of documentation, idiotic arguments to the commands (which the debugger could have figured out itself), and other idiosyncrasies, there's very, very little value-add to a JLink compared to a $20 ST-Link, or even a $2 clone of a ST-Link.Some people get hung up on Seggers "RTT" functionality, which on a powerpoint level looks great. Except, their software suck. As in, their logging-system _looses_ messages. Hint: The SEGGER_RTT.c files have no atomic functions or locking in place.Right now, I can only find two good things to say about the Seggers (when they work).First one: The time it takes to flash is slightly shorter, as they read out the flash, compare and then only writes the changed pages to flash.Second: Their RTOS integration in the GDBserver is actually pretty convenient.Oh, and in case you don't already know, the ST-Links (as all SWD DAPs) will work just fine with other vendors chips. You can use it to flash NXP, Nordic, Atmel, etc, etc. As long as they are Cortex-M with an SWD port (or JTAG for that matter), it'll work.I might have mentioned ST-Link more than a few times here, but that's just because they're very easy to get a hold of. Any other adapter will do the job as well, such as (for example) a CMSIS-DAP.

author: tszaboo
author_rank: Super Contributor
timestamp: August 20, 2017, 02:55:42 pm
content: I dont think so. First, you can buy about 5 STM Discovery, or the Nucleo boards for the same price. Or the boards that you like. I also find Jtag to be cumbersome for hobby projects, because of the connector. It is perfectly fine to have a 144 pin huge MCU with dedicated JTAG pins and 4 layer board routing everything nicely, but this is for hobby. The usual cheap demo boards will all have built in USB debug SWD or similar, and no JTAG interface. And that interface is enough for 95% of use cases.

author: stmdude
author_rank: Frequent Contributor
timestamp: August 20, 2017, 02:56:07 pm
content: Quote from: Kjelt on August 20, 2017, 02:52:28 pmWell, it comes with a "few" reservations..May be used with ARM based ST devices onlyOnly debugging on evaluation boards is allowed. Debugging on custom hardware is not supported and not allowedNo production flash programming supportUnlimited breakpoints in flash available for evaluation onlyNo support is given

author: alin_im
author_rank: Regular Contributor
timestamp: August 20, 2017, 03:16:45 pm
content: 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

author: alin_im
author_rank: Regular Contributor
timestamp: August 20, 2017, 04:32:38 pm
content: I do not see myself working with CPUs higher than M4 so I think that the JLINK mini is a much better choice. Do you know if it accepts it up to M4 ?

author: hans
author_rank: Super Contributor
timestamp: August 20, 2017, 06:43:15 pm
content: QuoteI.e. they dropped the 20-pin boxed JTAG header and went for the 10-pin Cortex-M debug only. That is fine for regular SWD usage, no need for trace, etc. It also drops support for some of the older ARM7TDMI cores, which some need the RTCK signal (I think LPC2100 does, not familiar with others). But if you only plan to use modern parts with Cortex m0+ and up, that's not a problem. Actually, I think it's a wicked deal considering it's a tiny debugger for a much better price.I would probably pick one up along a ST discovery board (or any other brand) anyway. Because with a vendor dev board you're locked in to them, and that's usually bad long term.For 20$ I wouldn't touch any Ebay knock off. Not worth it.

author: alin_im
author_rank: Regular Contributor
timestamp: August 20, 2017, 07:43:29 pm
content: Just realized I have a Silicon Zero Geckohttps://www.silabs.com/products/development-tools/mcu/32-bit/efm32-zero-gecko-starter-kitdev kit and in its specs says that contains Integrated SEGGER J-Link USB debugger/emulator with debug out functionality does this means that the 60 pounds device is already integrated into a 30 pounds platform ?Maybe you can clarify this for me, is this like the STLink which can program only S Labs MCUs ? Or can accept any vendor MCU ?

author: thm_w
author_rank: Super Contributor
timestamp: August 21, 2017, 11:25:23 pm
content: Quote from: alin_im on August 20, 2017, 07:43:29 pmThe cost is for the software not the hardware, the hardware is ~$2 of parts. If you care a lot about cost you can look at the mini EDU model already suggested, which is about $20.I suspect its limited, to test yourself: plug in your dev board, run J-Flash, choose a non-EFM32 part, and select target->connect. It will give you an error message if they've restricted access (most likely did).

author: hans
author_rank: Super Contributor
timestamp: August 22, 2017, 08:21:08 am
content: Quote from: alin_im on August 20, 2017, 07:43:29 pmYes, on the Giant gecko board I have the J-link debugger circuitry is hidden under the LCD. They have hidden it because I suspect they use a ST part for itThe functionality is quite extensive in that you can redirect the SWD offboard (but also turn the debugger off and use your own). However I haven't tried hooking it up to any non-Silicon Micro parts.

author: mac.6
author_rank: Regular Contributor
timestamp: August 22, 2017, 09:16:36 am
content: Lot of dev boards include debugger that can be flashed as a JLink debugger, most Kinetis parts are like this for example.It's not an exact EDU version as most are very slow (around 4/8MHz) so advanced debug is limited (like RTT or SystemView usage).RTT is a fine software, of course you need to provide some support for lock/unlock functions, it is far above uart and doesn't requires swo support. Only their linux support is lacking for the tools.

author: alin_im
author_rank: Regular Contributor
timestamp: August 22, 2017, 10:04:19 am
content: Thank you for all your responses, I will try the Jlink EDU mini because it super affordable and I will not see myself using more advanced MCUs then the ones with M4F, meaning that the Jlink EDU is too advanced for my purposes. Also, I think that 4 MHz is enough for my learning purposes, I do not intend to become an ARM guru, but to experiment and have an idea that is beyond using Mbed environment.

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: August 22, 2017, 06:00:22 pm
content: Several MCU manufacturers have licensed J-Link firmware from Segger and include it on their own debuggers. Some examples: the NXP LPC-Link 2 and the Infineon XMC Link.Most of these are better values than a Segger J-Link, and/or include features the J-Link doesn't. For example, an LPC-Link 2 is only $20, and the XMC Link is isolated, which is a $250 add-on board for a Segger J-Link.

author: plazma
author_rank: Frequent Contributor
timestamp: August 22, 2017, 06:37:53 pm
content: You can also direct printf() to the SWO pin. At least with EFM32 chips.

author: ElektroQuark
author_rank: Unknown
timestamp: August 22, 2017, 06:41:12 pm
content: Ozone is the debugger from SEGGER.Look at it, you can use it with a J-LINK.

author: andyturk
author_rank: Frequent Contributor
timestamp: August 22, 2017, 06:55:14 pm
content: Quote from: EdoNork on August 22, 2017, 06:41:12 pmThis.J-Link is worth it because you get to use Ozone. Technically, you're supposed to use one of Segger's hardware dongles with a "license" on it, but Ozone works just fine without that. You just have to acknowledge a dialog when you run it for the first time.Using the J-Link on-board firmware, you can reflash the debug side of a STM32 disco board to be a J-Link and then debug it with Ozone. For under $20 USD it's a really sweet setup. Grab GCC 6.x from ARM (for free), your favorite text editor and you're good to go.

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: August 23, 2017, 01:45:39 am
content: Quote from: andyturk on August 22, 2017, 06:55:14 pmWhat does Ozone do that Segger Embedded Studio doesn't?

author: andyturk
author_rank: Frequent Contributor
timestamp: August 23, 2017, 02:43:46 am
content: Quote from: Sal Ammoniac on August 23, 2017, 01:45:39 amPuts $1800 more dollars in your pocket?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.

author: ElektroQuark
author_rank: Unknown
timestamp: August 23, 2017, 06:36:43 am
content: I'm using CodeBlocks as IDE with Ozone for debugging. Nice combo.

author: ulix
author_rank: Regular Contributor
timestamp: August 23, 2017, 09:20:18 am
content: Quote from: stmdude on August 20, 2017, 02:56:07 pmProblem: the Jlink EDU is for education purpose only as well...

author: hans
author_rank: Super Contributor
timestamp: August 23, 2017, 11:54:22 am
content: 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.

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: August 25, 2017, 03:37:42 pm
content: Quote from: andyturk on August 23, 2017, 02:43:46 amI 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.

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: August 25, 2017, 04:24:12 pm
content: Quote from: Sal Ammoniac on August 25, 2017, 03:37:42 pmPartially 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?

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: August 25, 2017, 06:28:14 pm
content: Quote from: Sal Ammoniac on August 25, 2017, 04:24:12 pmFound 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:<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.

author: thm_w
author_rank: Super Contributor
timestamp: August 25, 2017, 10:32:13 pm
content: Quote from: Sal Ammoniac on August 25, 2017, 06:28:14 pmNotepad++ find and replace, regex, something like this:<name>value\d<\/name>

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: August 25, 2017, 11:06:58 pm
content: Quote from: thm_w on August 25, 2017, 10:32:13 pmIt'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.

author: andyturk
author_rank: Frequent Contributor
timestamp: August 25, 2017, 11:56:00 pm
content: Quote from: Sal Ammoniac on August 25, 2017, 11:06:58 pmWhich probably means there might be an easy fix that Segger could make. In my experience, they've been pretty responsive to bug reports.

author: MT
author_rank: Super Contributor
timestamp: August 26, 2017, 01:09:05 am
content: @Sal Amoniac:Are you using Ozone in eval mode?

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: August 26, 2017, 07:38:09 am
content: Quote from: MT on August 26, 2017, 01:09:05 amNo. I have a J-Link Plus, which is one of the supported devices.

author: andyturk
author_rank: Frequent Contributor
timestamp: August 26, 2017, 06:13:35 pm
content: Quote from: Sal Ammoniac on August 26, 2017, 07:38:09 amFor 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.

author: MT
author_rank: Super Contributor
timestamp: August 27, 2017, 01:03:26 pm
content: 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).

author: rsjsouza
author_rank: Super Contributor
timestamp: August 27, 2017, 05:02:11 pm
content: 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.

author: andyturk
author_rank: Frequent Contributor
timestamp: August 27, 2017, 07:55:45 pm
content: Quote from: MT on August 27, 2017, 01:03:26 pmI 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.

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: August 28, 2017, 06:03:48 pm
content: Quote from: rsjsouza on August 27, 2017, 05:02:11 pmOzone 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

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: August 28, 2017, 11:10:25 pm
content: Quote from: MT on August 27, 2017, 01:03:26 pmHere'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/

author: ElektroQuark
author_rank: Unknown
timestamp: August 29, 2017, 07:01:00 am
content: Most of the Kinetis Freedom boards fromFreescaleNXP can be "upgraded" to J-LINK.

author: richardman
author_rank: Frequent Contributor
timestamp: September 02, 2017, 01:43:43 am
content: 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...

author: thm_w
author_rank: Super Contributor
timestamp: September 05, 2017, 11:22:30 pm
content: Quote from: richardman on September 02, 2017, 01:43:43 amI 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.

author: mubes
author_rank: Regular Contributor
timestamp: September 06, 2017, 07:19:53 am
content: You will find bluepill BMP (with support for SWO at up to 2.25mbps too) and optimised pinouts athttps://github.com/mubes/blackmagicThere 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.RegardsDave

author: royalt
author_rank: Newbie
timestamp: April 11, 2018, 03:59:52 pm
content: Quote from: evb149 on August 20, 2017, 03:40:51 pmI'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