TASKING SWAT meets SAFERTOS®

TASKING SWAT meets SAFERTOS®

Your code com­piles. Tests pass. Every­thing looks solid.

You flash it onto the SoC… and some­thing feels off.

You add logs. You step through with a debug­ger - every­thing behaves per­fect­ly…. until you let it run freely again

Now imag­ine this is a crash detec­tion task in an airbag con­troller: a sin­gle mil­lisec­ond delay, caused by inter­fer­ence from anoth­er task, could have cat­a­stroph­ic con­se­quences. Rare. Silent. Invis­i­ble to tra­di­tion­al debug­ging.

This is the kind of bug that frus­trates even expe­ri­enced embed­ded devel­op­ers- not a logic error, but a tim­ing prob­lem.

Many devel­op­ers turn to hard­ware trace, which cap­tures instruc­tion exe­cu­tion and task events with pre­cise tim­ing. It can show what your sys­tem is doing - and when. But not every SoC sup­ports it. Some lack the required fea­tures. Oth­ers can’t expose trace pins due to design con­straints. Sud­den­ly, that pow­er­ful tool is out of reach.
So, what do you do when your SoC doesn’t give you hard­ware trace?

What? SWAT.


This is where soft­ware-based trac­ing comes in.

Soft­ware trace bridges the gap by using exist­ing debug inter­faces to pro­vide run­time pro­fil­ing and trace data—without requir­ing addi­tion­al hard­ware.

At its core, soft­ware trac­ing means gen­er­at­ing trace mes­sages in soft­ware. You add instru­men­ta­tion to the code, buffer the gen­er­at­ed events in mem­o­ry, and then send them off-chip - using, for instance, Blue­Box over a stan­dard debug port.

This approach extends trace capa­bil­i­ties to plat­forms that couldn’t sup­port hard­ware trace.

SWAT, from TASKING, brings this capa­bil­i­ty into prac­tice.

Here’s how it works in prac­tice:

Inte­grate SWAT into your appli­ca­tion - a library that enables your soft­ware to gen­er­ate trace events dur­ing run­time. Then down­load the appli­ca­tion to the SoC and start record­ing. Dur­ing run­time, trace events are gen­er­at­ed and trans­mit­ted to Blue­Box via the debug port, thanks to SWAT. Blue­Box acts as a bridge between the SoC and the PC, cap­tur­ing the trace data and for­ward­ing it to the host. On the PC, winIDEA, an IDE for debug­ging and soft­ware analy­sis, receives the incom­ing data and lets you visu­al­ize and ana­lyze the record­ing.

How SAFERTOS® comes into the picture

Embed­ded sys­tems are designed for spe­cif­ic tasks and run in envi­ron­ments with lim­it­ed resources such as mem­o­ry and pro­cess­ing power. To man­age these con­straints effi­cient­ly, they rely on a spe­cial­ized oper­at­ing sys­tem.

An oper­at­ing sys­tem is respon­si­ble for sched­ul­ing tasks and allo­cat­ing hard­ware resources like sen­sors and actu­a­tors. In many appli­ca­tions, it is not enough to sim­ply exe­cute tasks - the sys­tem must exe­cute them at the right time.

This is exact­ly the role of SAFERTOS®.

It is a light­weight, reli­able, and deter­min­is­tic RTOS used in safe­ty-crit­i­cal sys­tems where fail­ure is not an option. Com­ply­ing with lead­ing inter­na­tion­al func­tion­al safe­ty stan­dards, it is avail­able pre-cer­ti­fied for IEC 61508 and ISO 26262. SAFERTOS® is also deliv­ered with the Design Assur­ance Pack (DAP) that pro­vides all doc­u­men­ta­tion need­ed for cer­ti­fi­ca­tion.

The perfect couple of your application

Under­stand­ing run­time behav­ior is key. Appli­ca­tion com­plex­i­ty can mask sub­tle design con­flicts that only sur­face once all soft­ware com­po­nents are inte­grat­ed.

With the com­bined power of SWAT and SAFERTOS®, you can achieve safe and pre­dictable appli­ca­tion behav­ior.

Togeth­er, they pro­vide RTOS-aware trac­ing, giv­ing you vis­i­bil­i­ty in how tasks are sched­uled, when they exe­cute, and how your appli­ca­tion inter­acts with the OS. Every task state tran­si­tion, con­text switch, and key appli­ca­tion event is cap­tured in real time - with­out stop­ping the SoC and with min­i­mal impact on its per­for­mance.

What you can see

Once SWAT receives data from the SoC and trans­fers them via the debug port, analy­sis fol­lows in winIDEA.

  • OS Sched­ul­ing analy­sis

The pro­fil­er time­line allows you to view every­thing record­ed over the time. It dis­plays all oper­at­ing sys­tem tasks and shows, at any given moment, whether a task is run­ning, ready, blocked, or sus­pend­ed - and for how long.

This pro­vides an imme­di­ate overview of what is hap­pen­ing across the dif­fer­ent cores of your SoC, enabling rapid root-cause analy­sis of tim­ing issues.

  • CPU load and resource usage
    Under­stand how much pro­cess­ing time each task con­sumes, iden­ti­fy high-pri­or­i­ty task inter­fer­ence, and pin­point why cer­tain tasks may not be exe­cut­ing as expect­ed.
  • Tim­ing met­rics

Derive tim­ing rel­e­vant met­rics and sta­tis­tics - such as net, gross, call, and peri­od times.
Mon­i­tor exe­cu­tion times, peri­od­ic­i­ty and tim­ing anom­alies. Detect sub­tle delays or jit­ter in peri­od­ic tasks, which is essen­tial for safe­ty-crit­i­cal appli­ca­tions such as auto­mo­tive con­trollers.

  • Cus­tomiz­able report­ing and analy­sis

Trace data can be export­ed ​for fur­ther analy­sis. winIDEA allows you to export data in for­mats such as BTF and MDF4 export for­mat for use in third-party tools.

You can also gen­er­ate con­fig­urable HTML reports in winIDEA to demon­strate tim­ing com­pli­ance, CPU load, and task behav­ior to man­age­ment or cus­tomers.

Alter­na­tive­ly, export the data as e.g. CSV and use the winIDEA SDK to auto­mate test­ing pro­ce­dures and per­form addi­tion­al analy­sis of trace record­ings.

Key takeaway

In embed­ded sys­tems, cor­rect­ness isn’t just about what the soft­ware does - it’s also about when and how it does it.

With the com­bined power of SWAT and SAFERTOS®, you can achieve safe and pre­dictable appli­ca­tion behav­ior and gain the run­time vis­i­bil­i­ty need­ed to sup­port safe­ty cer­ti­fi­ca­tion activ­i­ties.

Ready to see what your sys­tem is real­ly doing at run­time?

Explore TASKING SWAT.

Scroll to Top