Simulink defines uint16 as uint32.
Mostrar comentarios más antiguos
Hi everybody!
I'm buidling a model to use with the c2000 f28379D launchpad. To optimise a couple of processis I wanted to use c-code. Things were going well but now i am getting errors that I frankly don't really understand:

I'm using uint16_T in my code but it seems that Simulink has redefined that to uint32_T, and then gets confused when the pin type is uint16 in Simulink. I don't know why it's doing this as the launchpad has 16 bit characters and I've configured that correctly (I think). What is going on here? I have the same issues with both my r2024a and r2023b installation. Thanks in advance!
Included are all the relevant files, a version for r2024a and one I created for r2021b which gives me the same error
Respuestas (1)
surya venu
el 10 de Jul. de 2024
Editada: surya venu
el 10 de Jul. de 2024
Hi,
The error you're encountering suggests that there is a mismatch between the data types defined in your custom C code and the data types expected by Simulink. Specifically, it seems that Simulink is expecting "uint32_T" while your C code is using "uint16_T".
Check Data Type Definitions: Ensure that the data types are consistently defined across your C code and Simulink model. In your C code, you might have something like:
typedef unsigned short uint16_T;
typedef unsigned int uint32_T;
I see that in "rtwtypes.h" file you've shared, "uint16_T" is defined as "int". But ideally it should be "short".
Hope it helps.
1 comentario
Onno Twisk
el 10 de Jul. de 2024
Categorías
Más información sobre Texas Instruments C2000 Processors en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
