error: pointer value used where a floating-point was expected

조회 수: 18 (최근 30일)
Ben Hudson
Ben Hudson 2024년 8월 16일
답변: Pratyush 2024년 8월 20일
Hello,
I'm using Simulink Embedded Coder to generate C code from my model to be deployed on an STM32 Nucleo-H753ZI board via the STM32CubeIDE. I've attached the Simulink Configuration file I have been using below.
Shown in Simulink_Implementation.png is a function in Simulink that is fed with inputs from a non-virtual bus. Generated_Code.png shows this function in the generated C file. For some reason, input variables that are not arrays are being specified as pointers. The code generates without error in Simulink but when I then attempt to build and deploy this to the board in the STM32CubeIDE I get the error shown in STM32CubeIDE_Error.png.
Does anyone know what is causing this difference between single values and arrays in the function inputs in the generated code? Is it a setting in my configuration file or the way I have implemented the model? I would appreciate any help people can provide!

답변 (1개)

Pratyush
Pratyush 2024년 8월 20일
Hi Ben,
When generating C code from Simulink models using Embedded Coder for deployment on an STM32 board, inputs may appear as pointers due to configuration settings or model implementation. To address this:
1. Configuration Parameters:
- Check Code Interface settings to ensure inputs are passed correctly.
- Verify data types and signal attributes.
- Review Optimization settings that might affect input representation.
2. Model Implementation:
- Ensure non-virtual buses are defined correctly.
- Use Signal Conversion blocks if needed.
- Verify function block configurations.
3. STM32CubeIDE Debugging:
- Review compiler settings and error messages.
- Simplify the model to isolate issues.
I hope this could help you resolve issues with input representation in the generated code.

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by