cancel
Showing results for 
Search instead for 
Did you mean: 

H747I-Disco expanding on an example file

ElectroManiac
Associate III

hello forum

I've been playing with a H747I-Discovery board, and I want to add some more functionality to a combination of example codes - activating one of the i2c.
the example itself doesn't include an .IOC file.

As I see it I have two options:

1.Start a new project and and pull the example and continue from there
2. Manually activate the required periphery somehow inside the example

 

my problem with (1.) is that some of the example use the same leg (DCMI and SDMMC1 use PC)

and I'm not sure how to do (2.)

Is there a better approach? any tips for any of them?

9 REPLIES 9

Most of the examples had been written by an engineer, thus not auto-generated via an IOC file.

There are perhaps other examples which were, or could be constructed from scratch.

You could also code the additional/incremental functionality manually. Or auto-gen to understand, and then merge in.

>>is that some of the example use the same leg (DCMI and SDMMC1 use PC)

Same pin? which conflicts.

Problem with DISCO/EVAL is often a kitchen sink approach and not particularly expandable, or different compromises need to be made.

Perhaps look at other boards, either minimal ones, or with the key features important to your needs/goals. Check AliExpress, TaoBao, etc.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
STTwo-32
ST Employee

Hello @ElectroManiac 

For the first solution you can't initialise the same pin to be used in two different alternate functions. So, you have to ensure that you dont have a pin conflict (CubeMX should do the job) you can for example use the SDMMC1 to data bus widths of 1-bit
mode that will need only 1 Data pin what may eliminate the conflict. So, you can restart the project from CubeMX, integrate your configuration and then your project code under CubeIDE. For the second methode, is not going to be easy since you have to configure the new API from scratch. That may take some time and need you to know how the API works exactly. You can also have the conflict problem here since you do not have a .ioc file that will warn you of any potential conflict.

Best Regards.

STTwo-32 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

TBH, I would like to "work more like an engineer" as well, what documents should I read? is there a way to learn the manual approach?

even if I use init/deinit when needed I can't setup the same leg? there's no way to do it manually?

Sure, you can. you just have to set the pin for the alternate function you need and ensure it is set before using it on the new context.

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

How do I do that?

Example for SPI1_CLK and USART2_TX share the same pin (PC10 for example):

  1. Activate the USART2.
  2. Set the Pin PC10 to USART2_TX. 
  3. Ensure that PC10 has been configured to USART2_TX.
  4. Execute the USART task.
  5. Activate the SPI1.
  6. Set the Pin PC10 to SPI1_CLK.
  7. Execute the SPI task.

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

first of all, I really appreciate the answer and the help.

I'm not sure about the "Set the Pin PC10 to USART2_TX" part,
I haven't found where and how I activate that stuff manually, and what setting and peripheries I need to activate with it.

If you can reference me to an example I can learn from/reading material it will be a great help

The best think I can recommend you is to generate both parts of the code using MX. Then, try to understand how it is configured. After that, repeat those configurations manually on your project. Unfortunately, there is no such example. 

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.