| Feature | Detail |
|---|---|
| Key slots | 17 slots: MASTER_ECU_KEY, BOOT_MAC_KEY, BOOT_MAC, KEY_1..KEY_10, RAM_KEY, wildcard slots |
| Write protection | SET_WRITE_PROTECTION flag per slot; write-once after production lock; prevents overwrite |
| Algorithm support | AES-128 ECB/CBC/CMAC only; no RSA/ECDSA; no SHA natively |
| Commands | CMD_LOAD_KEY, CMD_LOAD_PLAIN_KEY, CMD_GET_ID, CMD_INIT_RNG, CMD_GENERATE_MAC, CMD_VERIFY_MAC, CMD_ENC_ECB/CBC, CMD_DEC_ECB/CBC |
| Key loading | M1-M5 Miyaguchi-Preneel protocol; M3=CMAC auth proof; M4/M5=provisioning receipt archived in KMS |
| MCUs | Infineon Aurix TC2xx/TC3xx, NXP MPC57xx, Renesas RH850 -- embedded SHE cores |
SHE: Secure Hardware Extension (HIS SHE v1.1)
Full HSM: Aurix TC3xx eHSM vs SHE
| Feature | SHE | Aurix TC3xx eHSM (Full HSM) |
|---|---|---|
| Asymmetric crypto | No | RSA-2048/4096, ECDSA P-256/384/521 |
| AES key size | 128-bit only | AES-128 and AES-256 |
| Hash functions | No | SHA-256/384/512 |
| Isolated CPU | No dedicated core | ARM Cortex-M @ 200 MHz; dedicated 512 kB RAM; no shared memory |
| FIPS level | Not certified | FIPS 140-2/3 Level 2+ achievable |
| Key types | Symmetric only | Symmetric + asymmetric + certificates in secure storage |
Secure Boot Using HSM: Aurix TC3xx eHSM
/* Aurix TC3xx eHSM secure boot chain */
/* Boot ROM (OTP) → loads HSM FW from HSM flash partition
→ HSM boots on isolated Cortex-M
→ SSW requests HSM to verify Boot SW via CMAC (SHE BOOT_MAC_KEY)
→ on VALID: SSW executes Boot SW
→ Boot SW requests HSM to verify AUTOSAR SBL via ECDSA-P256
→ on VALID: SBL verifies BSW + Application via ECDSA manifest */
#include "HSM_Api.h"
#include "BswM.h"
Std_ReturnType SecBoot_VerifyStage_CMAC(uint32 flash_start, uint32 flash_len)
{
HSM_VerifyResult_t result = HSM_VerifyBootMAC(flash_start, flash_len,
SHE_BOOT_MAC_KEY);
if (result != HSM_VERIFY_OK) {
BswM_RequestMode(BSWM_USER_SECBOOT, BSWM_MODE_BOOT_FAILURE);
return E_NOT_OK; /* halt; DCM activates programming session for recovery */
}
return E_OK;
}
Std_ReturnType SecBoot_VerifyStage_ECDSA(const uint8* image, uint32 len,
const uint8* sig_r, const uint8* sig_s)
{
uint8 hash[32];
HSM_SHA256(image, len, hash);
HSM_VerifyResult_t result = HSM_ECDSAVerify_P256(hash, sig_r, sig_s,
HSM_SLOT_OTA_PUBKEY);
if (result != HSM_VERIFY_OK) {
BswM_RequestMode(BSWM_USER_SECBOOT, BSWM_MODE_BOOT_FAILURE);
return E_NOT_OK;
}
return E_OK;
}AUTOSAR Crypto Stack Integration
CryptoHSM_AES128_CMAC
AES
CMAC
128
/Crypto/HSM_Driver
CsmJob_SecOC_MAC_Generate
AES
CMAC
6
/Crypto/Keys/HSM_SecOC_KEY1
SYNC
Summary
SHE is the right choice for CAN-focused ECUs needing secure boot CMAC and SecOC key storage at low cost -- 17 key slots, AES-128, write-once protection. The Aurix TC3xx eHSM adds ECDSA, SHA-256, and a dedicated isolated CPU core for the full asymmetric signature verification needed in OTA and TLS. The AUTOSAR Crypto Stack (Csm → CryIf → CryptoDriver) provides a single API regardless of whether the underlying hardware is SHE or HSM -- future hardware migrations require only a new CryptoDriver, not application changes.
🔬 Deep Dive — Core Concepts Expanded
This section builds on the foundational concepts covered above with additional technical depth, edge cases, and configuration nuances that separate competent engineers from experts. When working on production ECU projects, the details covered here are the ones most commonly responsible for integration delays and late-phase defects.
Key principles to reinforce:
- Configuration over coding: In AUTOSAR and automotive middleware environments, correctness is largely determined by ARXML configuration, not application code. A correctly implemented algorithm can produce wrong results due to a single misconfigured parameter.
- Traceability as a first-class concern: Every configuration decision should be traceable to a requirement, safety goal, or architecture decision. Undocumented configuration choices are a common source of regression defects when ECUs are updated.
- Cross-module dependencies: In tightly integrated automotive software stacks, changing one module's configuration often requires corresponding updates in dependent modules. Always perform a dependency impact analysis before submitting configuration changes.
🏭 How This Topic Appears in Production Projects
- Project integration phase: The concepts covered in this lesson are most commonly encountered during ECU integration testing — when multiple software components from different teams are combined for the first time. Issues that were invisible in unit tests frequently surface at this stage.
- Supplier/OEM interface: This is a topic that frequently appears in technical discussions between Tier-1 ECU suppliers and OEM system integrators. Engineers who can speak fluently about these details earn credibility and are often brought into critical design review meetings.
- Automotive tool ecosystem: Vector CANoe/CANalyzer, dSPACE tools, and ETAS INCA are the standard tools used to validate and measure the correct behaviour of the systems described in this lesson. Familiarity with these tools alongside the conceptual knowledge dramatically accelerates debugging in real projects.
⚠️ Common Mistakes and How to Avoid Them
- Assuming default configuration is correct: Automotive software tools ship with default configurations that are designed to compile and link, not to meet project-specific requirements. Every configuration parameter needs to be consciously set. 'It compiled' is not the same as 'it is correctly configured'.
- Skipping documentation of configuration rationale: In a 3-year ECU project with team turnover, undocumented configuration choices become tribal knowledge that disappears when engineers leave. Document why a parameter is set to a specific value, not just what it is set to.
- Testing only the happy path: Automotive ECUs must behave correctly under fault conditions, voltage variations, and communication errors. Always test the error handling paths as rigorously as the nominal operation. Many production escapes originate in untested error branches.
- Version mismatches between teams: In a multi-team project, the BSW team, SWC team, and system integration team may use different versions of the same ARXML file. Version management of all ARXML files in a shared repository is mandatory, not optional.
📊 Industry Note
Engineers who master both the theoretical concepts and the practical toolchain skills covered in this course are among the most sought-after professionals in the automotive software industry. The combination of AUTOSAR standards knowledge, safety engineering understanding, and hands-on configuration experience commands premium salaries at OEMs and Tier-1 suppliers globally.