STM32CubeMX 6.17.0/6.18.1 - NullPointerException in RIFService.getExtraTableModel when enabling SDMMC2 as TF-A_BL2 boot device (STM32MP215)
MCU: STM32MP215DAN3 (custom board, STM32MP2 series)
STM32CubeMX versions tested: 6.17.0 and 6.18.1 — identical crash in both
STM32Cube FW_MP2: V1.3.1
Steps to reproduce:
- Open a working project where
SDMMC1is the boot device (A35 ROM+A35S(TF-A_BL2)runtime context checked) - In
SDMMC1Mode and Configuration: uncheckA35 ROMandA35S(TF-A_BL2) - In
SDMMC2Mode and Configuration: checkA35 ROMandA35S(TF-A_BL2)(making SDMMC2/eMMC the new boot device instead of the SD card) - Save project, click Generate Code
Result: Code generation crashes with the following exception, reproducible 100% of the time with this exact configuration:
at com.st.microxplorer.mcu.rif.RIFService.getExtraTableModel(RIFService.java:341)
at com.st.microxplorer.codegenerator.McuDataModel.getRIFInfo(McuDataModel.java:824)
at com.st.microxplorer.codegenerator.McuDataModel.initMcuData(McuDataModel.java:334)
at com.st.microxplorer.codegenerator.McuDataModel.<init>(McuDataModel.java:181)
at com.st.microxplorer.codegenerator.CodeGenerator.generateCode(CodeGenerator.java:1562)
at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.generateCode(ProjectBuilder.java:3469)
at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.createCode(ProjectBuilder.java:2272)
at com.st.microxplorer.plugins.projectmanager.engine.ProjectBuilder.createProject(ProjectBuilder.java:821)
at com.st.microxplorer.plugins.projectmanager.engine.GenerateProjectThread.run(GenerateProjectThread.java:61)
What I've already ruled out:
- Not caused by a stale/incomplete local database (re-downloaded MCU package files, same result)
- Not caused by not visiting the RIF configuration panel before generating (visited it, same result)
- Not caused by
BOOTDEVICE_LABELSinopenconnect.incbeing stale (updated it fromsdcardtoemmcper the file's own documented table, same result) - Not version-specific (reproduced identically in 6.17.0 and 6.18.1)
- Reverting the boot device config back to
SDMMC1(original) generates successfully every time — the crash only occurs withSDMMC2as boot device
Possible lead: In the generated optee-os RIF file, I noticed the RIMU section treats the current boot device (SDMMC1) differently from the others:
RIMUPROT(RIMU_ID(1), RIF_UNUSED, RIF_NSEC, RIF_PRIV, RIF_CIDSEL_P) /* RIMU IP = SDMMC1 */
RIMUPROT(RIMU_ID(2), RIF_CID1, RIF_NSEC, RIF_PRIV, RIF_CIDSEL_M) /* RIMU IP = SDMMC2 */
Wondering if the code generator is supposed to swap this CIDSEL_P/RIF_UNUSED role to the new boot device and is failing/nulling out somewhere in that recomputation. Any insight into what RifIPExtraTableModel is supposed to be populated from would help me work around this.
