modelica-3rdparty / Modelica_DeviceDrivers

Free library for interfacing hardware drivers to Modelica models. There is support for joysticks, keyboards, UDP, TCP/IP, LCM, MQTT, shared memory, AD/DA converters, serial port and other devices.
BSD 3-Clause "New" or "Revised" License
76 stars 31 forks source link

Can it generate atomic code like embedded coder in matlab ? #387

Open parthmpatel1110 opened 6 months ago

parthmpatel1110 commented 6 months ago

Hi, You did great work developing the library. I am trying to use it smt32G4. I have generated a base-level driver from stm32cubeide and modified it to suit my needs. Is there any way this library generates atomic code for the Modelica function? If there is another way to do that, please provide a reference.

bernhard-thiele commented 6 months ago

Hm, this library doesn't generate C code. It's the Modelica tool which generates the code. MDD just uses the Modelica external function interface for interfacing to C code which finally accesses the hardware device. There is a relevant paper which describes some experimental work targeting STM32F4 Boards (https://doi.org/10.1145/3158191.3158204). It used an experimental code generator target from OpenModelica which probably comes close to what you need in respect of the code structure, but it was very limited in terms of supported Modelica code. I haven't checked for long time what the status of that target is.