그동안 쌓여 있던 미커밋 파일들을 정리. 소스·자산만 올리고, 개인 데이터와 런타임 상태는 gitignore로 차단. 추가된 자산: - web-ui/audiomass, web-ui/wavacity — 자체 호스팅 오디오 에디터 - web-ui/drums — 드럼 샘플 - wol-gate — WOL 프록시 컨테이너(Dockerfile + server.js) - glm-1m-fix — GLM 1M 컨텍스트 설치 스크립트(linux/windows) - RENODE_FIXES_SUMMARY*.md, CCTV정보_서울특별시.csv, .claude/plans 수정: - edge_tts_synth.py: rate 인자 추가(말하기 속도 조절) - .smallclaw/config.json: google(gemini) provider 등록 — 키는 vault 참조 - assets/SmallClaw*.png 삭제분 반영 gitignore (중요): - .smallclaw/users/*/workspace/ 전체 차단. 기존 패턴이 memory/uploads와 일부 확장자만 막아서 detective/(고소장·통화녹취·의사소견서·가족관계증명서), generated-media/, music/, pptx/ 등 앱 생성 개인 데이터 403MB가 노출돼 있었음 - .smallclaw/active-sessions.json 차단 — 살아있는 bearer 토큰과 admin 역할이 평문으로 들어있어 커밋 시 게이트웨이 관리자 자격증명이 그대로 공개됨 - google-usage.json, config.json.bak-*, workspace/memory·weather-maps· task_result_*, voice/ 등 런타임 상태도 함께 차단 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
91 lines
3.9 KiB
Markdown
91 lines
3.9 KiB
Markdown
# Renode STM32 Emulator Fixes Summary
|
|
|
|
This document summarizes the fixes implemented to resolve issues with the Renode STM32 emulator in the HomeClaw project.
|
|
|
|
## Issues Identified
|
|
|
|
Based on the debugging log, the following issues were identified:
|
|
|
|
1. **Infinite Loop in Sketch Code**: The `while (!Serial)` construct in Arduino sketches causes an infinite loop in Renode because there's no USB Serial stack implementation.
|
|
|
|
2. **Incomplete Peripheral Mocks**: The RCC, PWR, and DBGMCU peripheral mocks were missing implementations for several registers that the STM32 HAL library attempts to access.
|
|
|
|
3. **Missing GPIO Support**: GPIO peripheral support was missing, which is essential for many Arduino sketches.
|
|
|
|
4. **UART Connection Issues**: Problems with UART socket connections between Renode and the web interface.
|
|
|
|
5. **Vector Table Reading Problems**: Renode was incorrectly reading vector table values from memory.
|
|
|
|
## Fixes Implemented
|
|
|
|
### 1. Enhanced Peripheral Mocks
|
|
|
|
Updated the Python scripts for RCC, PWR, and DBGMCU peripherals to handle all registers that the STM32 HAL library accesses:
|
|
|
|
- **RCC (Reset and Clock Control)**: Added support for all register offsets including APB2RSTR, APB1RSTR, AHBRSTR, and CFGR2.
|
|
- **PWR (Power Control)**: Added support for CSR register in addition to CR.
|
|
- **DBGMCU (Debug MCU)**: Added proper register offset handling.
|
|
|
|
### 2. Added GPIO Peripheral Support
|
|
|
|
Created a new GPIO mock script (`stm32f1_gpio.py`) that implements basic GPIO functionality for ports A, B, and C.
|
|
|
|
### 3. Improved REPL File
|
|
|
|
Created an enhanced REPL file (`stm32f103_improved.repl`) with better peripheral definitions and GPIO support. Fixed syntax issues to ensure compatibility with Renode's parser.
|
|
|
|
### 4. Enhanced Sketch Code Patching
|
|
|
|
Updated the sketch code patching logic to remove various forms of blocking loops that prevent execution in Renode:
|
|
- `while (!Serial) {}`
|
|
- `while (!Serial);`
|
|
- `while (!Serial) delay(1);`
|
|
|
|
### 5. Better UART Connection Handling
|
|
|
|
Improved the UART socket connection logic with:
|
|
- Extended retry mechanism (60 attempts instead of 30)
|
|
- Better error logging
|
|
- Periodic keepalive pings
|
|
- Proper error handling for socket events
|
|
|
|
### 6. Enhanced Error Handling and Logging
|
|
|
|
Added more comprehensive error handling and logging throughout the Renode session management code.
|
|
|
|
## Files Modified
|
|
|
|
1. `/home/kim/.local/lib/renode/scripts/pydev/stm32f1_rcc.py` - Enhanced RCC peripheral mock
|
|
2. `/home/kim/.local/lib/renode/scripts/pydev/stm32f1_flash.py` - Updated FLASH peripheral mock
|
|
3. `/home/kim/.local/lib/renode/scripts/pydev/stm32f1_pwr.py` - Enhanced PWR peripheral mock
|
|
4. `/home/kim/.local/lib/renode/scripts/pydev/stm32f1_dbgmcu.py` - Enhanced DBGMCU peripheral mock
|
|
5. `/home/kim/.local/lib/renode/scripts/pydev/stm32f1_gpio.py` - New GPIO peripheral mock
|
|
6. `/home/kim/homeclaw/stm32f103_improved.repl` - Improved REPL file
|
|
7. `/home/kim/homeclaw/src/gateway/routes-arduino.ts` - Updated Renode session handling
|
|
|
|
## Testing
|
|
|
|
A comprehensive test script was created to verify the fixes:
|
|
- `/home/kim/homeclaw/comprehensive_renode_test.sh`
|
|
|
|
The test compiles a sample sketch and prepares it for Renode execution.
|
|
|
|
## Usage
|
|
|
|
To test the fixes:
|
|
|
|
1. Open the web interface
|
|
2. Create a new sketch or use the test sketch at `/home/kim/homeclaw/test_sketches/renode_test.ino`
|
|
3. Select an STM32 board (e.g., Blue Pill F103C8)
|
|
4. Click the 'Emulator' button to start the Renode simulation
|
|
5. You should see output from the sketch in the serial monitor
|
|
|
|
## Future Improvements
|
|
|
|
1. Implement additional peripheral mocks as needed
|
|
2. Add support for more STM32 chip variants
|
|
3. Improve the GPIO implementation with more realistic behavior
|
|
4. Add support for interrupt handling
|
|
5. Implement more comprehensive peripheral functionality
|
|
|
|
These fixes should resolve the immediate issues with the Renode STM32 emulator and provide a more stable and functional emulation environment. |