null
vuild_
Nodes
Flows
Hubs
Login
MENU
GO
Notifications
Login
⌂
AUTOSAR 개발자 실전 가이드
Structure
overview
•
AUTOSAR가 필요한 이유
•
AUTOSAR 레이어드 아키텍처 구조
components
•
Core, Partition, OS Application 관계
•
SWC와 Runnable — 실행 단위 이해
rte-ports
•
P-Port, R-Port와 인터페이스 설계
•
Explicit vs Implicit Write — 언제 무엇을 쓰나
autosar-os
•
AUTOSAR OS Task와 ISR 설계
•
Alarm, Counter, Schedule Table 정리
•
OS Application과 메모리 보호 설정
spec-practice
•
MUST vs SHALL vs SHOULD — 스펙 용어 해석법
•
DET 에러 처리 — Det_ReportError와 RuntimeError
com-stack
•
ComSignal에서 PduR까지 — 신호가 CAN 프레임이 되는 경로
•
CanIf부터 CanNm까지 — CAN 통신 스택 계층 분리
diagnostics
•
DEM으로 DTC 관리하기 — 이벤트 상태와 고장 이력
•
DCM과 UDS 서비스 — 진단 통신의 실전 구조
ecum-bswm
•
EcuM 시동/종료 시퀀스 — ECU가 켜지고 꺼지는 순서
•
BswM 모드 전환 — 규칙 기반 상태 관리
nvm-schm
•
NvM 읽기/쓰기 패턴 — 비휘발성 메모리를 안전하게 다루는 방법
•
SchM Exclusive Area — 인터럽트와 Task 간 공유 자원 보호
Flow Structure
DEM으로 DTC 관리하기 — 이벤트 상태와 고장 이력
15 / 19
EcuM 시동/종료 시퀀스 — ECU가 켜지고 꺼지는 순서
☆ Star
↗ Full
DCM과 UDS 서비스 — 진단 통신의 실전 구조
#autosar
#dcm
#uds
#iso14229
#diagnostic
@devpc
|
2026-05-04 12:39:29
|
GET /api/v1/flows/24/nodes/436?fv=1&nv=1
Context:
Flow v1
→
Node v1
0
Views
1
Calls
# DCM과 UDS 서비스 — 진단 통신의 실전 구조 ## DCM이 하는 일 DCM(Diagnostic Communication Manager)은 외부 진단기(스캐너, 플래시 툴)의 요청을 받아 처리하는 모듈이다. UDS(ISO 14229) 프로토콜을 구현한다. ``` 진단기 ──── CAN/DoIP ──── CanTp/DoIP ──── DCM ──┬── DEM ├── NvM ├── SWC (데이터 읽기/쓰기) └── Flash 부트로더 ``` --- ## 핵심 UDS 서비스 | Service ID | 이름 | 용도 | |-----------|------|------| | `0x10` | DiagnosticSessionControl | 세션 전환 (Default/Extended/Programming) | | `0x11` | EcuReset | ECU 리셋 | | `0x14` | ClearDiagnosticInformation | DTC 클리어 | | `0x19` | ReadDTCInformation | DTC 목록/상태 조회 | | `0x22` | ReadDataByIdentifier | DID 읽기 (센서값, 버전 등) | | `0x2E` | WriteDataByIdentifier | DID 쓰기 (설정값, 캘리브레이션) | | `0x27` | SecurityAccess | 보안 잠금 해제 (Seed/Key) | | `0x31` | RoutineControl | 기능 실행 (테스트, 캘리브레이션 시작/종료) | | `0x34`/`0x36`/`0x37` | RequestDownload/TransferData/RequestTransferExit | 펌웨어 플래시 | --- ## DID(Data Identifier) 구현 `0x22` 서비스로 읽을 수 있는 데이터는 DID로 식별한다. AUTOSAR DCM에서 DID 구현은 콜백 함수를 등록하는 방식: ```c /* DID 0xF190: VIN 번호 읽기 */ Std_ReturnType Dcm_ReadVIN( uint8 *Data, Dcm_OpStatusType OpStatus, uint16 *DataLength, Dcm_NegativeResponseCodeType *ErrorCode) { if (OpStatus == DCM_INITIAL) { memcpy(Data, vin_buffer, 17U); *DataLength = 17U; return E_OK; } return DCM_E_PENDING; } ``` 긴 처리가 필요하면 `DCM_E_PENDING`을 리턴하고 다음 호출 시 완료 처리한다. --- ## SecurityAccess — Seed/Key 구조 `0x27` 서비스는 중요한 쓰기 작업(NvM 쓰기, 플래시) 전에 보안 잠금을 해제한다. ``` 진단기 → RequestSeed(Level 01) → ECU: Seed 값 (랜덤) ECU 계산: Key = f(Seed, SecretKey) 진단기 → SendKey(Key) → ECU 검증 → 잠금 해제 ``` ```c /* Seed 생성 콜백 */ Std_ReturnType Dcm_GetSeed( Dcm_SecLevelType SecurityLevel, uint8 *Seed, Dcm_OpStatusType OpStatus, Dcm_NegativeResponseCodeType *ErrorCode) { /* 랜덤 시드 생성 */ uint32 random = GetHardwareRandom(); seed_buffer = random; Seed[0] = (uint8)(random >> 24); Seed[1] = (uint8)(random >> 16); Seed[2] = (uint8)(random >> 8); Seed[3] = (uint8)(random); return E_OK; } /* Key 검증 콜백 */ Std_ReturnType Dcm_CompareKey( Dcm_SecLevelType SecurityLevel, const uint8 *Key, Dcm_OpStatusType OpStatus, Dcm_NegativeResponseCodeType *ErrorCode) { uint32 expected_key = ComputeKey(seed_buffer); uint32 received_key = ((uint32)Key[0] << 24) | ((uint32)Key[1] << 16) | ((uint32)Key[2] << 8) | Key[3]; if (expected_key == received_key) { return E_OK; } *ErrorCode = DCM_E_INVALIDKEY; return E_NOT_OK; } ``` --- ## RoutineControl — 기능 실행 `0x31` 서비스로 ECU 내부 기능을 원격 실행한다. 캘리브레이션 초기화, 자가 진단 테스트, 학습값 리셋 등에 쓴다. ```c /* Routine 0x0200: 캘리브레이션 리셋 */ Std_ReturnType Dcm_RoutineReset( uint8 *InBuffer, uint8 *OutBuffer, uint16 *CurrentDataLength, Dcm_OpStatusType OpStatus, Dcm_NegativeResponseCodeType *ErrorCode) { NvM_WriteBlock(NvMConf_NvMBlockDescriptor_CalibBlock, default_calib); *CurrentDataLength = 0U; return E_OK; } ```
DEM으로 DTC 관리하기 — 이벤트 상태와 고장 이력
EcuM 시동/종료 시퀀스 — ECU가 켜지고 꺼지는 순서
// COMMENTS
Newest First
ON THIS PAGE
No content selected.