cancel
Showing results for 
Search instead for 
Did you mean: 

STM32-MAT Matlab target. Problem with GPIO

radeon
Associate
Posted on November 05, 2015 at 08:17

I am now trying to make stm32 matlab target work with stm32 discovery f3 board.

The problem i have is when i am using GPIO_write block in simulink it updates GPIO only once on reset.

C code line

HAL_GPIO_WritePin(GPIOE, GPIO_PIN_13, SimpleGPIO_B.DataTypeConversion);

is present only in initialize procedure and does not appear in step().

If i copy this line to step() everything works fine.

Input signal for GPIO_Write block is not constant, i can see it changes if i use debugger.

Also in simulink itself GPIO_Write block is marked as constant.

It looks like code generator considers this block constant and does not update in inside step() despite it has variable input.

Is there a proper way to fix this without changing generated code each time?

#st32-mat-matlab-simulink-gpio
1 REPLY 1
Posted on November 05, 2015 at 15:48

Hello,

it seems that sampletime settings was processed as discret in R2014b version as same setting is taken as const in R2015b. Function outputs and update are called every step for discret but not for const. We check and fix for next STM32-MAT/Target version.

Regards