Who is SEGGER’s most demanding customer?

OK, who do you think, major auto manufacturer, titan of industrial networking or a household name?

Well, no, it is closer to home, SEGGER itself.

SEGGER is best known for our market-leading J-Link debuggers, development tools, middleware, and Flasher production programmers. There are not many embedded engineers who do not currently have or previously used a SEGGER J-Link, but what makes SEGGER J-Link stand out from the crowded development tool market?

Many would say the bulletproof reliability, innovative features and market leading speed of the debugger.

This raises the question about how SEGGER achieved this, so during this case study we will take a look to see how the J-Link developers pushed for the very best middleware to enable them to build their debugger firmware.

J-Link and embOS

SEGGER is known best for its market-leading debug probes!

As in many (if not all) designs, J-Link firmware required a number of prioritized tasks to be run on the embedded J-Link microcontroller. The natural choice was to use a Real-Time Operating System (RTOS) to isolate time critical applications from background housekeeping and communication routines. Initial J-Link firmware used the SEGGER embOS RTOS offering state-of-the-art fast and memory efficient multitasking.

J-Link: from embOS to embOS-Ultra

As the main debugger task has become more and more time critical due to target devices get faster, working with a typical 1 millisecond system tick became a critical bottleneck. So, the J-Link team put pressure on the embOS developers to come up with a solution and

embOS-Ultra was born offering processor clock cycle resolution for time critical events such as task delays and software timers. This means on a typical low-end 100MHz system, that would be 10ns, with a task switch close to 300 cycles, that would make 3µs for a full context switch. It also allows periodic tasks to be scheduled faster than 1KHz and with finer resolution, such as 5KHz.

J-Link and J-Trace it all is about fast signal generation, so higher precision for the rising signal means higher possible speeds.

By eliminating the periodic tick interrupt, embOS-Ultra reduced the CPU load and also saved energy. Considering that billions of devices currently use a traditional RTOS, this represents huge potential energy savings world-wide.

J-Link ecosystem ongoing enhancements: RTT, Ozone, and SystemView

Unique insights provided by event tracing tool SystemViewOK, so once we made the commitment to use embOS in the J-Link firmware, how do we go about debugging multitasking issues such as priority inversion, task starvation and performance bottlenecks?

Answer, SystemView, RTT, Ozone debugger, and Embedded Studio.

SystemView, utilizing multiple graphical views, valuable information about the operating system (not only SEGGER embOS but third-party solutions such as uC/OS-III, Micrium OS Kernel, and FreeRTOS) status can be displayed.

Using minimal code instrumentation, information about tasks, interrupts, timers, resources, API calls, and even user events etc. can be extracted from the embedded system via J-Link, SEGGER RTT (Real Time Transfer) Technology or IP to achieve continuous real time recording.

Finally, pulling together our Ozone graphical debugger and performance analyzer in conjunction with Embedded Studio IDE and compiler, forms a full & efficient development ecosystem for embedded C/C++ applications.

J-Link and communication stacks

Gone are the days of UART communication when connecting to a debugger, so a tight, efficient and flexible USB Device stack was needed. Again, the natural choice was to use the SEGGER emUSB-Device offering a full range of speeds including Full (12Mb/s), High (480Mb/s) and SuperSpeed (5Gb/s).

As development teams are now more often home based or at least based in multiple locations (especially post COVID) the ability to make a remote connection to a debugger and often limited target hardware is important, making the J-Link & J-Trace remote connectivity extremely valuable.

To help unlock remote debug capability, the SEGGER emNet was developed to implement a small footprint TCP/IP connection along with the industry standard protocols such as IPV4/6, IEEE 1588 PTP, DHCP and extensions such as MQTT.

Fast reliable communication stacks are essential when looking at real time streaming trace offered for example by J-Trace. Dropping any trace data could mean hiding that elusive bug or failing to tune an embedded design for the very best performance.

J-Link and remote firmware update

As the ever-expanding list of silicon suppliers release new devices (on an almost weekly basis), along with product enhancements and new features, it opened up the need for remote update management of the embedded J-Link firmware. Multiple software components were needed to manage this securely, efficiently and reliably using industry standard protocols.

Again, the J-Link developers turned to the SEGGER software team’s middleware, such as emLoad and emFile.

It quickly became clear that data compression would be of an advantage to reduce download times and data storage requirements, hence the development of emCompress that allows firmware images on a host to be compressed and then decompressed on the embedded side. This not only minimizes the download speed but also reduces the memory requirements during firmware updates as images can be decompressed directly into code flash. High end J-Link and J-Trace units run time FPGA images are decompressed at power up, saving considerable non-volatile storage.

J-Link and Cross host user interfaces

Graphical User Interfaces (GUI) across multiple host operating systems has become essential, especially with the growing popularity of Linux. Two options have emerged, embedded graphical displays (such as TFT display) or the use of a host browser to access embedded HTML.

A good example of the embedded Graphical display is the SEGGER Flasher Portable (which shares significant hardware and software DNA with J-Link) that includes a TFT to display user feedback on the programming cycle and status information which uses emWin. To speed up and test the GUI development, AppWizard was used to first simulate the functionality on the host before embedding the generated C code into the final emWin firmware.

The J-Link debuggers also needed a way to interact with users independently from any integrated development environment (IDE) on multiple hosts. The emWeb HTML server was developed and integrated into the J-Link firmware to offer status information /configuration via web browsers rather than dedicated host applications.

J-Link and secure and anti-cloning production programming

It is an unfortunate truth that embedded firmware images are open to abuse during manufacture and while performing in field updates. J-Link itself has historically been vulnerable to cloning and action was needed to secure the valuable firmware during manufacture as well as assuring it would only run on SEGGER produced hardware.

Once more, the SEGGER software team developed solutions to prohibit cloning during manufacture as well as validation of firmware and hardware combinations during field updates.

The emSecure software package is a digital signature suite that allows the creation and verification of digital assets, making it impossible to create a clone by simply copying hardware and firmware of an embedded device. That is of course just the beginning: it also secures firmware updates to embedded devices and authenticates licenses, serial numbers and other sensitive data.

Conclusion

SEGGER’s continued enhancement of the industry leading J-Link debugger for embedded cores such as Arm, RISC-V and RX, has driven or been built upon the powerful, fast, reliable and efficient SEGGER middleware, of which the embedded engineers of the world can now take full advantage.

SEGGER middleware, developed, tested and implemented for the most challenging of embedded environments.