cancel
Showing results for 
Search instead for 
Did you mean: 

How to add I2C and SPI to audio application?

benyBoy
Associate II
Posted on April 15, 2017 at 17:40

stm3269i-discovery audio application demo. I cant find the stmcubeMX, no ioc file? How to add i2c and spi to the project on arduino connector

I am trying to add i2c and spi pins to an stm3269i-discovery audio application demo. I cant find the stmcubeMX ioc file so i can add the arduino i2c and spi pins to the project. Can anyone guide me as to how i can do this?

#demo-application #i2c #ioc #audio
5 REPLIES 5
Posted on April 15, 2017 at 18:26

Most of the Examples files are hand crafted HAL code rather than CubeMX generated boiler-plate. Would suggest you get CubeMX to make you the examples you need, or review other examples within the HAL directories, and merge the code.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on April 15, 2017 at 18:43

Ok,  that sounds hard to do!  

I'll try and merge i2c example with audio application example. Has anyone here done this before? Is there a decent guide anywhere for HAL with stm32f769i?

I'm new to stm32 platform,  so far it all seams a bit confused, cobeMX HAL bsp packages, the hardware abstraction layer will be replaced by CubMX? or more reliable code is made with HAL and it's her to stay? If examples are made with HAL then it's presumably it's best to avoid cobeMX?

I'll report back here if the gpio code does'nt conflict with the example code or more likely I get stuck.

Posted on April 15, 2017 at 20:23

Programming is complicated, CubeMX trivializes the exercise. Merging is likely to be a challenge, at least initially, as the examples were generated by someone who thought about the problem, vs the computer, which honestly doesn't.

CubeMX is a frame-work generator, it does the rough framing, and you fill in the specifics. How good the output is depends on the boiler-plate code it assembles. It generates code that uses the HAL libraries.

The examples are hand crafted in HAL, to do a specific jobs, or illustrate a specific point. If you want to understand the HAL you should review these examples, and the source for the HAL itself.

You should review the part's Reference Manual to gain an understanding of the hardware and how different parts or peripherals interact.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on April 15, 2017 at 20:44

Ok,  thanks for the reply,  I'll start going through the HAL code for I2C and see how it's defining / initializing the GPIO pins and SCL clock to start with.

I'll need to learn how the clocks pll's and dividers get defined I'm assuming to.do this. Which is the maim clocks configuration config file(s)?

So manual for the HAL is the specific dataaheet for the cpu your using. I'm surprised there is'nt documentation for the HAL but like you say maybe the code is self.explanitory especially if you know enough about the hardware

Posted on April 15, 2017 at 20:47

use the STM32CubeMX application to generate the code for the peripherals you want, eg., I2C/SPI/UART then merge the audio example into that generated code.

important files you might be interested in:

(these examples are for an f7, change to f4 or l0 or what have you)

stm32f769xx.h

stm32f7xx.h

system_stm32f7xx.h

stm32f7xx_it.h

stm32f7xx_hal_conf.h

startup_stm32f769xx.s

STM32F769NIHx_FLASH.ld

startup_stm32f769xx.s and main.c would be where you'll find system setup stuff like clocks

http://www.st.com/resource/en/user_manual/dm00189702.pdf

is the documentation for the f7 hal libraries. but yeah, mostly the code is the documentation. i hope you like structs.