Skip to main content
radeon
Visitor II
November 5, 2015
Question

STM32-MAT Matlab target. Problem with GPIO

  • November 5, 2015
  • 1 reply
  • 644 views
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
This topic has been closed for replies.

1 reply

Nickname12840_O
Associate
November 5, 2015
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