Embedded Systems Internship — Real-Time Firmware and CAN Integration

Building Real-Time Firmware Around CAN

I developed C/C++ real-time embedded software for an electric-vehicle traction system, combining RTOS tasks, CAN communications, and operating-state logic.

RoleReal-time firmware and CAN integration
ControllerSTW ESX.4cs-gw
ToolsopenSYDE · logi.CAD3
DiagnosticsPCAN
System context

Controller integration in an existing controls environment.

PAL-K’s electric-truck controls environment used CAN communication among motor-control, vehicle-control, DC-DC, and logging contexts. My work focused on making the selected gateway-controller implementation function within that existing context.

My role

From selection to controller behavior.

I helped select the STW ESX.4cs-gw gateway controller and wrote its application software in C/C++ using STW BIOS/C libraries. I used openSYDE and logi.CAD3 in the compilation, configuration, and deployment workflow, integrated CAN matrices, and worked with a PCAN/DB9/USB laptop diagnostic path.

Tasks, events, and shared state.

I created periodic and event-driven RTOS tasks. Incoming CAN messages triggered callbacks and events, while shared variables, flags, and inter-task communication kept the application’s operating-state model up to date. The software used that CAN-derived state to coordinate runtime control behavior and outbound communication with external controllers.

The high-voltage control work had sub-second response requirements. I worked within the controller’s proprietary real-time environment; the application work did not involve designing an RTOS scheduler.

The CAN configuration included 23 message-direction entries. A dedicated fourth CAN port fed a PC listener/parser for logging and a browser-facing status monitor.

Debugging and lab work

Initialization required a deeper method.

The controller initialization was a major learning curve relative to my STM32 and ESP32 experience. I worked through topology configuration and generated platform support, then configured message reservation, pointers, RX/TX behavior, callbacks, DLC, RTR, identifiers, and data handling.

The normal system rate was 500 kbps. I also used a 125 kbps configurability test; later, an ARAI dynamometer environment operated at 250 kbps, making bitrate flexibility practically relevant. In the described lab setup, the Daimler VCU was unavailable, so a laptop generated VCU commands while I tested the communications path.

What I learned

Documentation became a practical debugging tool.

This was my first substantial exposure to CAN. Working through an unfamiliar industrial controller and vendor toolchain showed me that embedded integration depends on understanding both the protocol and the configuration details around it. Each initialization step became easier to isolate once I understood how the topology, generated support, and controller settings fit together.

Current status

C/C++ application implementation, real-time task and operating-state logic, controller integration, initialization debugging, and the described lab testing.

Technical context
C/C++RTOSOperating-state logicCAN / J1939 / CAN 2.0BSTW ESX.4cs-gwopenSYDElogi.CAD3PCAN diagnostic interfaceCAN diagnostics
Bench setup and integration testing
ARAI test setup used during PAL-K project work
CAN interface bench setup

Bench setup and integration testing — PAL-K gateway-controller integration work. Video shown without audio.