cancel
Showing results for 
Search instead for 
Did you mean: 

Problem using STM32-MAT with STM32F407IGHx processor

jdzielski
Associate

Posted on December 31, 2014 at 17:30

I'm not sure if this is the write community, and there don't seem to be a lot of posts related to the STM32-MAT tools, but I'm hoping I can get a little help.  I've just started trying to use the Simulink blockset with STM32CubeMX and I'm having some problems...

I have downloaded and installed STM32CubeMX and the STM32-MAT blockset and tools.  I am trying to run the ReadWrite demo, but I have changed the processor in the ioc-file from the default to the one on my board (STM32F407IGH6).  When I now open the demo model ReadWrite.slx that came with the STM32-MAT installation, I get to dialog windows that open, one saying ''No GPIO Configured as Output'' and ''No GPIO Configured as Input''.  I get one of these errors whenever I attempt to open either the GPIO_Read or GPIO_Write blocks in the Simulink model.  I have no idea what these warnings are about; although, I've seen them before when the path to the ioc-file is not correct.  Can you tell me what these warnings mean and how to correct them?  I have seen postings that show that the GPIO can be configured in STM32CubeMX but the version I am running 4.5.0 STMCube version 1.0 does not seem to offer these options.  Does it and is this related to my problem?  I'm guessing that these are being set based on the processor since when I change the processor model number I get GPIOA-P instead of just GPIOD initially.  If I try and change the write port on one of the GPIO_Write blocks I get an error message ''Error evaluating MaskCallback of block GPIO_Write ... Undefined function or variable 'Pin_Idx'.''  This error appears to be occurring in the file GPIO_Write_callback.p.  Because the source m-file is not available, I can't diagnose the problem any further.  How do I get to be able to configure the GPIO ports for my processor?  Thank you, John.

#stm32-mat/target-matlab-stm32f4

1 REPLY 1
Posted on January 07, 2015 at 17:31

Hi John,

you don't have to modify any text file. Everything is graphical.

Regarding ReadWrite example.

If you want to use an other MCU, you must use STM32CubeMX to make a new configuration.

So, open STM32_Config (blue blockset).

There are two parts:

Button ''Select STM32 configuration file'' is used to choose the configuration you will use for the model; It is the configuration you have done for your board.

And

Start STM32CubeMx configuration tool with ''Start STM32CubeMx configuration tool'' gives you possibility to :

Modify current configuration.

Create a new configuration

Open an existing configuration.

So, you must create a new configuration using STM32CubeMx.

 You can start it from Simulink or not.

Then, use STM32CubeMx to select MCU, set pins, perimherals etc...

Save file (ioc)

This is the configuration you will select as configuration file.

Then, drag and drop driver blocksets.

You can use only blockset that you have configured. Else, you get an error message.

Hope it helps

Best regards

Pascal