Error in code generation with Embedded Coder Support Package for STMicroelectronics when implementing an ADC hardware interrupt

11 Ansichten (letzte 30 Tage)
I followed the example to implement the FOC on an STM32 microcontroller.
In contrast to your example, the following hardware is used:
  • NUCLEO-H755ZI-Q Evaluation Board with STM32H755ZIT6 dual core CPU https://www.st.com/resource/en/user_manual/um2408-stm32h7-nucleo144-boards-mb1363-stmicroelectronics.pdf
  • X-NUCLEO-IHM08M1 motor driver expansion board https://www.st.com/resource/en/data_brief/x-nucleo-ihm08m1.pdf
The hardware configuration was performed using CubeMX following the example and adapted to the STM32H755ZIT6. The software is intended to run on the M4 CPU core, so the following hardware configuration was set up in Simulink:
The interrupt routine for the ADC was implemented in Simulink and STM32CubeMX as shown in the example. However, code generation in Simulink is not possible. After each build, the following error message appears as soon as the analog-to-digital converter blocks are implemented in the model:
Output argument "ret" (and possibly others) not assigned a value in the execution with "stm32cube.blocks.internal.addH7DualCoreFlagsAndPaths>isSoftwareTrigger" function.
What is this error message and how can I fix it?
  3 Kommentare
Bill
Bill am 27 Okt. 2025 um 21:37
Can you please explain the fix for this? I can't get injected conversions to work either. I'm unable to wait for the next release.
Daniel Krebold
Daniel Krebold am 28 Okt. 2025 um 7:03
Hi Bill, Mathworks helped me with a fix within a Support Case. In the end one assignment of the variable ret was missing in the addH7DualCoreFlagsAndPaths function was missing. Here's the fix:
This seems to be a bug on our end when ADC injected mode is configured to use an external trigger. The fix for the problem can be applied by following the steps below:
1) cd to the following directory: cd(fullfile(matlabshared.supportpkg.getSupportPackageRoot(), 'toolbox', 'shared', 'supportpackages', 'stm32', '+stm32cube', '+blocks', '+internal'))
2) Delete the addH7DualCoreFlagsAndPaths.p file. Create a backup of addH7DualCoreFlagsAndPaths.m. Replace with the addH7DualCoreFlagsAndPaths.m file in the attachment.
3) Run the following commands in the MATLAB command window:
>> rehash toolbox;
>> rehash toolboxcache;
4) Try rebuilding the model; the build error shouldn't appear.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Produkte


Version

R2025a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by