Add STM32 UDS diagnostic services#422
Draft
nhuvaoanh123 wants to merge 11 commits into
Draft
Conversation
9aa85e7 to
8f823e2
Compare
ad85e80 to
cc0db82
Compare
Import the STM32F4 and STM32G4 CMSIS device headers from STMicroelectronics' dedicated RIM-tracked repositories. Keep only the F413 and G474 headers needed by the STM32 MCU foundation and record the unused upstream headers as RIM ignores.
Add the STM32 platform entry point, chip CMake files, bspMcu startup code, a software reset wrapper, and the STM32 unit-test presets. The platform reuses the shared CMSIS core from libs/3rdparty/cmsis instead of carrying a local copy.
Add STM32 BSP modules for clock, UART, GPIO, timer, ADC, and EEPROM, plus interrupt handling primitives and the ETL platform glue.
daee3aa to
b84cd89
Compare
Add bxCAN and FDCAN device drivers with STM32 CAN tests. Add the bxCAN transceiver adapter and unit-test registration.
Add the FDCAN transceiver implementation and STM32 test coverage. Wire the FDCAN transceiver into the chip-family CMake selection.
Add the STM32 hard fault handler with RAM dump region and the IWDG watchdog driver. Add the G474RE safety manager sources and watchdog unit tests.
b84cd89 to
e13f30a
Compare
Add the NUCLEO-F413ZH reference application board: BSP configuration, board main with FreeRTOS and ThreadX variants, bxCAN CAN system, and the board presets.
Introduce two feature flags set by the STM32 board options: PLATFORM_SUPPORT_OBD_UDS_ADDRESSING selects 0x7E0/0x7E8 tester CAN IDs and logical address 0x0600, and PLATFORM_SUPPORT_PROGRAMMING_SESSION adds an application-level programming session. The BSW ProgrammingSession disables the UDS dispatcher on entry (bootloader handover), so the application session keeps the dispatcher alive and uses session index 0x02 to avoid matching PROGRAMMING_SESSION() in switchSession().
Add demo UDS services for the STM32 boards behind the PLATFORM_SUPPORT_UDS_DEMO_SERVICES board option: ECU reset, an in-memory DTC store with read/clear/control services, security access, VIN write, and demo routine control. The UDS dispatcher accepts functional requests when the demo services are enabled.
e13f30a to
37a3be1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose of this PR
Description
Final PR in the 10-part STM32 platform series. Adds 9 UDS diagnostic services with full HIL test qualification.
UDS Services implemented
Qualification
405 HIL tests passing across 5 test suites on NUCLEO-G474RE:
📊 Test dashboard: https://nhuvaoanh123.github.io/openbsw/
Architecture
PLATFORM_SUPPORT_UDS=ONcompile flagStm32-prefixed files are STM32-specific — existing posix/S32K UDS untouchedComplete series
Depends on #421 (PR 9: DoCAN transport). PR 10 of 10.
Related Issues
Completes the STM32 platform port started in #408.
Breaking Changes
Test Plan
CC=arm-none-eabi-gcc CXX=arm-none-eabi-g++ cmake --preset nucleo-g474re-freertos-gcc && cmake --build --preset nucleo-g474re-freertos-gcc3E 00→ expect7E 0010 01→ expect50 01 ...27 01→ expect67 01 <seed>Regression Tests
Have tests been added/updated? [x] Yes — 405 HIL tests [ ] No