STM32 Firmware Programming System for HVAC devices with DID flash support
Project description
HVAC DID Flash
STM32 펌웨어 프로그래밍 시스템 - HVAC 장치를 위한 DID 플래시 지원
자동화된 STM32 펌웨어 프로그래밍 시스템으로, HVAC 애플리케이션에 특화된 DID(Data Identifier) 플래시 지원을 제공합니다.
주요 기능
- 자동화된 STM32 펌웨어 프로그래밍: ST-Link를 통한 완전 자동화된 프로그래밍
- 지능형 플래시 검증: 프로그래밍 전후 플래시 메모리 검증
- 시리얼 통신 검증: UART를 통한 펌웨어 동작 확인
- 음성 안내: 프로그래밍 진행 상황을 음성으로 안내
- 배치 처리: 여러 펌웨어 파일의 일괄 처리
- 성능 모니터링: 상세한 성능 분석 및 리포팅
- 오류 복구: 강력한 오류 처리 및 자동 재시도
시리얼 번호 관리
- did_serial.csv 파일에 기록된 serial number는 "이전 출력된 번호"입니다.
- 예를 들어, csv에 0000이 기록되어 있으면, 다음 수행 시 0001이 자동으로 생성되어 사용됩니다.
설치
PyPI에서 설치 (권장)
pip install hvac-did-flash
소스에서 설치
git clone https://github.com/your-org/hvac-did-flash.git
cd hvac-did-flash
pip install -e .
개발자 설치
git clone https://github.com/your-org/hvac-did-flash.git
cd hvac-did-flash
pip install -e ".[dev]"
2. Slack 설정 (선택사항)
Slack으로 펌웨어를 자동 업로드하려면 다음 단계를 따르세요:
2.1 Slack App 생성
- https://api.slack.com/apps 로 이동
- "Create New App" → "From scratch" 클릭
- App 이름 입력 (예: "HVAC Firmware Upload Bot")
- 워크스페이스 선택
2.2 권한 설정
- 좌측 메뉴에서 "OAuth & Permissions" 클릭
- "Scopes" 섹션으로 스크롤
- "Bot Token Scopes"에서 "Add an OAuth Scope" 클릭
- 다음 권한을 추가:
files:write- 파일 업로드 (필수)chat:write- 메시지 전송 (선택사항)
- 권한 추가 후 페이지 상단의 노란색 배너에서 "reinstall your app" 클릭
- 워크스페이스에 재설치 승인
2.3 App 설치
- "OAuth & Permissions" 페이지 상단의 "Install to Workspace" 클릭
- 권한 승인
- "Bot User OAuth Token" 복사 (xoxb-로 시작)
2.4 채널에 Bot 추가
- Slack에서 파일을 업로드할 채널로 이동
- 채널에서
/invite @[Bot 이름]입력
2.5 환경 변수 설정
.env.example파일을.env로 복사- 다음 값을 설정:
SLACK_BOT_TOKEN=xoxb-your-bot-token-here
SLACK_CHANNEL_ID=C1234567890
채널 ID 찾는 방법:
- Slack 웹/데스크톱에서 채널 우클릭 → "View channel details"
- 하단의 Channel ID 복사
사용법
명령줄 인터페이스
# 기본 사용법 - 배치 모드로 모든 펌웨어 파일 처리
hvac-flash --batch
# 단일 파일 처리
hvac-flash --single-file firmware.bin
# 설정 파일 지정
hvac-flash --config config.ini --batch
# 드라이런 모드 (실제 프로그래밍 없이 테스트)
hvac-flash --dry-run
# ST-Link 시리얼 번호 지정
hvac-flash --batch --stlink-sn 123456789
Python API 사용
from hvac_did_flash import STM32ProgrammingSystem, Config
# 설정 로드
config = Config()
# 프로그래밍 시스템 초기화
system = STM32ProgrammingSystem(config)
# 배치 처리
firmware_files = system.scan_firmware_directory()
stats = system.process_batch_files(firmware_files)
print(f"처리 완료: {stats['successful']}/{stats['total']} 성공")
고급 사용법
# 검증 활성화
hvac-flash --batch --verify
# 검증 비활성화
hvac-flash --batch --no-verify
# 특정 ST-Link 시리얼 번호 사용
hvac-flash --batch --stlink-sn 066DFF383638424E43172239
# 사용자 정의 설정으로 실행
hvac-flash --config my_config.ini --batch
명령줄 인수
repeat(선택사항): 빌드 반복 횟수 (기본값: 1)start_serial(선택사항): 시작 시리얼 번호 또는 "auto" (기본값: auto)model(선택사항): 모델명 (기본값: QZ25)--slack: Slack으로 ZIP 파일 업로드
출력 파일
- 개별 펌웨어 파일:
firmware/hvac-main-stm32f103@CYBER-QZ25_{serial}_{tag}.bin - 압축 파일:
{model}_{start_serial}_{count}.zip
문제 해결
Slack 업로드 오류
-
missing_scope:
- 오류 메시지:
'error': 'missing_scope', 'needed': 'files:write' - 해결 방법:
- https://api.slack.com/apps 에서 앱 선택
- "OAuth & Permissions" → "Scopes" → "Bot Token Scopes"
files:write권한 추가- 페이지 상단에서 "reinstall your app" 클릭
- 재설치 완료 후 다시 시도
- 오류 메시지:
-
invalid_auth: SLACK_BOT_TOKEN이 올바른지 확인
-
channel_not_found: SLACK_CHANNEL_ID가 올바른지 확인
-
not_in_channel: Bot을 채널에 초대 (
/invite @bot-name) -
file_too_large: Slack 파일 크기 제한 (1GB) 확인
환경 변수 문제
.env파일이 프로젝트 루트에 있는지 확인.env파일이.gitignore에 포함되어 있는지 확인 (보안)
주의사항
- Slack Bot Token을 절대 코드에 직접 입력하지 마세요
.env파일을 Git에 커밋하지 마세요- 대용량 파일 업로드 시 네트워크 상태 확인
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hvac_did_flash-1.2.5.tar.gz.
File metadata
- Download URL: hvac_did_flash-1.2.5.tar.gz
- Upload date:
- Size: 567.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7028def9062ef89fd629552b2c59807c49755fda7431afb3cb20db7fd172d3f8
|
|
| MD5 |
575a07eae9f4735cc8618f9c3063a057
|
|
| BLAKE2b-256 |
23f028f62f4a8d821516ab1e43babc26e71b3bae6e20dce6d6e635aabea6a101
|
File details
Details for the file hvac_did_flash-1.2.5-py3-none-any.whl.
File metadata
- Download URL: hvac_did_flash-1.2.5-py3-none-any.whl
- Upload date:
- Size: 65.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5652abe0d6b410c5c3506103ab50618953fb395e0a70a9e3dc034ba99cc2b1f
|
|
| MD5 |
ae09c3903d723a7233c1661970fc5d2f
|
|
| BLAKE2b-256 |
9ca5e729a733fbe77a4fa55ed951597d57e032205e33fc7286b9ac8711116cfa
|