×

Happy to Help!

This website doesn't store cookies. Enjoy the experience, without worrying about your data!

Great, thanks!

Integration of J1939 Protocol Stack with Simulink Subsystems for an OEM

 

About the Customer

Our customer is an OEM, focused on building zero emission vehicles with innovation and sustainability as key driving force.

Business Challenge

Model-based design is the preferred method of developing automotive solutions in modern times. Our customer too, had developed the vehicle control units based on model-based design paradigm.

The challenge in this project emerged from the need to efficiently integrate J1939 CAN stack layers (Data Link, Transportation, Application, Diagnostic, Network) into Simulink for auto code generation. J1939 stack was built on the legacy C code which needed to be integrated to SIMULINK environment.

  • Integration Requirement: The SAE J1939 stack needed integration with the customer’s ECU model as a Simulink subsystem.
  • Challenge: Converting J1939 stack external APIs from legacy code to MATLAB script presented significant challenges.
  • Customer Profile: OEM focused on vehicle development required support with J1939 protocol stack and model-based design using MATLAB/Simulink.

Embitel is among the few automotive technology partners with a dedicated team on model-based design. Also, we have a comprehensive library of ready-to-integrate automotive protocol stacks such as J1939, CAN, OBD, UDS, DoIP etc, which reduces the overall project development time.

Since the customer required both the expertise- model-based design and SAE J1939 stack, we were an ideal partner for them.
 

Embitel’s Solution

We converted our existing ready-to-integrate J1939 stack into SIMULINK subsystems. Each layer of the J1939 stack- Data Link, Transportation, Application, Diagnostic, Network were converted to SIMULINK models.

Simulink

Software Architecture

Here’s a snapshot of how we achieved this conversion:

Step 1: Convert existing J1939 CAN stack external APIs to Simulink subsystems using Legacy Code Tool and MATLAB scripts according to function specifications.

Step 2: Use Legacy Code Tool to create S-functions that incorporate J1939 stack layer functions (Data Link, Transportation, Application, Diagnostic, Network) for integration into Simulink models.

J1939 Layer

Step 3: Specify function characteristics in the Legacy Code Tool to transform C code to C MEX S-functions for use in Simulink models, optimizing code without extra wrapper code.

Step 4: Use the legacy code function of the LGC Tool to specify S-function name, existing C function specifications, file paths, and options for S-function generation.

Step 5: Integrate J1939 Stack interfaces as subsystems within the VCU model, generating S-functions from legacy code structure definitions according to required function input/output specifications.

Similar to J1939 stack, we offer a library of network communication and diagnostics stacks such as CAN, UDS, DOIP, OBD, FlexRay etc. All these stack software can be integrated into SIMULINK environment by the legacy code converter tool.

 

Embitel’s Impact

Our readily available and pre-tested J1939 protocol stack was able to reduce the development time by at least 6 months. A dedicated Model-Based design team also helped manage the challenges related to converting legacy code to MATLAB code.
 

Tools and Technologies

MATLAB: Used to create SIMULINK models and auto-code generation

Raptor-CAL: Used for Flashing

Raptor-CAN: Used for CAN Bus message monitoring and DBC uploading