These are good questions that are often coming up.
The first thing to know if that all GPIOs including your ePWM pins are set to GPIO inputs by default. In that mode, the pin is floating, but reads high most of the time you hook a scope probe to it (I don't have an explanation for this). There will be some time before you can take control of the pins where your system will have to accept this state. In the demo you are referring to (c28035pmsmfoc_cla), the motor driver chip DRV8312 is disabled by default. We enable it inside the "FOC Alogrithm" subsystem by setting GPIO pins 1, 3 and 5 to high. Anything that happens prior to this has not effect on the state of the power transistors. More info in the power-up section of the SLES256 document (DRV8312).
There is an internal pull-up register that allows a weak pull-up on pins, but it is disabled by default on all pins on the F28377S (not on all pins for older devices).
Here is the start up sequence, my recommendation is to look for yourself in the generated code:
- Simulink Coder block System Start Function Execution Code
- C2000 Driver blocks initialization
- Simulink Coder block System Start Function Exit Code
- Simulink Coder block System Initialize Function Execution Code
- Initialize Function subsystem (User-Defined Functions)
- Simulink Coder System Initialize Function Exit Code
- Enable interrupts (triggers the scheduler).
Therefore, interrupts are disabled during the execution of the System Start block.
The terminate function are called when you press the stop button during "External mode" simulations. There are ways to stop the execution of the model by using rtmSetErrorStatus function in the generated code. Look for this function name in the documentation.
More info in:
I hope it helps,