- Check Compiler Compatibility: Ensure that you're using a compiler that is compatible with the STM32 microcontroller and that it understands the assembly instructions being used. The STM32 typically uses ARM Cortex processors.
- Review Custom Code Settings: In Simulink, make sure that the custom code settings, such as include paths, source files, and defines, are correctly specified. Also, ensure that the settings are compatible with the compiler you're using.
- Inline Assembly Syntax: If the C code contains inline assembly, ensure that the syntax is correct for the compiler you're using. Different compilers may have different syntax requirements for inline assembly.
- Assembly File Generation: The errors seem to be coming from an assembly file (*.s). Check whether the assembly file is generated by the compiler or provided as part of the library. If it's generated by the compiler, there might be an issue with the compiler's configuration or the C code itself.
- Simulink Model Configuration: Verify the Simulink model configuration parameters, specifically the hardware implementation settings. Make sure that you have selected the correct target hardware and that the toolchain settings align with your compiler.
- Update Libraries and Toolchain: Ensure that all libraries and the toolchain are up to date. Sometimes, compatibility issues can be resolved by updating to the latest versions.
Error link external C library
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Good morning,
I would like to ask for support in solving a problem that arises when updating a simulink model in which I would like to import external libraries written in C code for STM32 microcontrollers.
After having done all the includes, I can insert the functions in the library using C Caller (I see all the functions), but during the compilation phase I get an error that I report in the attached figure.
Thank you
0 comentarios
Respuestas (1)
arushi
el 13 de Feb. de 2024
Hi Mirko,
The errors you're encountering during the compilation phase in Simulink when trying to integrate external C libraries for STM32 microcontrollers suggest that there's a mismatch between the assembly code generated and what the assembler expects. This could be due to various reasons, including incorrect compiler settings, incompatible assembly syntax, or issues with the C code being compiled.
Here are some steps you can take to troubleshoot and resolve the issue:
By following these steps, you should be able to identify the source of the compilation errors.
Please refer to the below MathWorks documentation of working with STM32 controllers - https://www.mathworks.com/help/ecoder/stmicroelectronicsstm32f4discovery/ug/Getting-started-stm32cubemx.html
Hope this helps.
0 comentarios
Ver también
Categorías
Más información sobre STMicroelectronics Discovery Boards en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!