Hello NXP Community,
I am developing an integrated BMS using S32K388-Q289 and FRDM-MC33771B-SPI-EVB via SPI communication, targeting a real lithium-ion battery pack. While researching, I noticed that there are relatively few BMS-specific example projects and reference implementations available for the S32K3 series, so it has been challenging to confirm the recommended workflow and supported toolchain for this type of application.
My goal is to implement the full embedded BMS stack on the MCU, including:
Cell voltage / temperature monitoring (via BCC)
Cell balancing control
SOC / SOH estimation algorithms (including deep learning-based approaches)
Real-time operation on the MCU
Model-Based Design workflow if possible (otherwise an S32DS C project)
I plan to use MATLAB/Simulink Model-Based Design Toolbox (MBDT) first, and if full support is not available for my setup, I will proceed with S32 Design Studio (S32DS).
I would appreciate guidance on the questions below:
1) MBDT support and training materials for S32K3 BMS applications
Is there any official documentation, user guide, training course, or application note for using MBDT with the S32K3 series specifically for BMS-related development (e.g., SPI-based BCC communication, sampling/processing, protection logic, and real-time monitoring)?
2) Integrating MBDT models with Deep Learning models and code generation
If I develop the BMS logic in Simulink (MBDT) and add a SOC/SOH model built using Deep Learning Toolbox:
- Can these be combined into a single integrated Simulink model?
- If yes, can the integrated model be automatically generated into C code (or other supported embedded code) using Embedded Coder for deployment on S32K388?
3) Real-time inference feasibility on S32K388
If code generation in (2) is feasible:
- Can the deployed model perform real-time inference (SOC/SOH estimation) using live battery data (voltage/current/temperature) on the MCU?
- Are there recommended constraints or best practices (e.g., fixed-point vs floating-point, supported layer types, model size limits, inference timing considerations) for S32K388?
4) Safety constraints / protection logic in MBDT
For safety, I need to implement protection logic such as:
- Over-voltage / under-voltage thresholds
- Over-temperature / under-temperature thresholds
- Fault handling and safe-state behavior
Is it possible to implement these limits and protection logic directly in MBDT/Simulink and include them in the generated embedded code?
If there are any reference examples (BMS or safety logic) for S32K targets, please share.
5) S32K388 compatibility with FRDM-MC33771B-SPI-EVB and alternatives
Is S32K388-Q289 officially supported/recommended to work with MC33771B via SPI for BMS applications?
If this combination is not recommended, could you suggest an officially supported BCC + reference platform (SPI or TPL) for S32K3-based BMS development?
6) On-device training (online learning) vs inference-only workflow
From an embedded AI perspective:
- Is on-device training (online learning using real-time battery data) supported or recommended on S32K3 MCUs?
- Or is the recommended approach offline training on PC + inference-only on the MCU?
If offline training is recommended, are there any official references describing a recommended workflow?
7) Performance / memory guidance for AI inference on S32K388
Are there any benchmarks or guidelines for running AI inference on S32K3 (especially S32K388) regarding:
- Flash/RAM usage expectations
- Typical inference latency ranges
- Optimization approaches (fixed-point, quantization, lightweight architectures)
Preferred alternative workflow if MBDT + DL integration is not recommended
If full integration and auto code generation are not recommended/supported, what is the preferred workflow to deploy an AI model on S32K3? For example:
- Converting the model to lightweight C inference code manually
- Using CMSIS-NN-like approaches (if applicable)
- Using any NXP middleware / recommended libraries / examples (e.g., eIQ)
Thank you for your support. Any documentation links, training references, SDK examples, or best-practice recommendations would be very helpful.
Best regards,