STM32 SPDIFRX Peripheral problem - Page 1
Forum section: electronics / general

author: veso266
author_rank: Newbie
timestamp: December 23, 2022, 01:50:59 pm
content: Hello there, I am trying to make myself Digital audio to Analog audio converterI have STM32F769i Discovery0:https://www.st.com/en/evaluation-tools/32f769idiscovery.htmlWhich has SPDIFRX and SPDIFTX portsI found a fearly good starting point here:http://www.tjaekel.com/DiscoveryF7Audio/index.htmlAlso the guy posted here:https://www.openstm32.org/forumthread921But the guy used STM32746G Discovery:https://www.st.com/en/evaluation-tools/32f746gdiscovery.htmlInsteadSo I went and tried to just get his SPDIF audio portion working on my boardMy Project can be found here (I hope it compiles, with CubeIDE you never know what will happen ):https://www.mediafire.com/file/n0s2z9p6nn735qg/SPDIF_Example.zip/fileI have no idea what I am doing wrong, but for some reason SPDIF_RX_IRQHandler (in stm32f7xx_it.c) is never called (LED never turns green, yea my debugging tehniques are primitive, but will explain why later)So because of that HAL_SPDIFRX_ReceiveDataFlow_IT (in spdifrx.c) always returns HAL_TIMEOUNT, and of course no audio is ever played on the speakersI am not sure what I am doing wrongWhen I start MCU I call BSP_SPDIF_Init() (defined in spdifrx.c) in main.c right after I take care of the clockif (BSP_SPDIFRX_Init() != HAL_OK){Error_Handler();}And it appears it initializes all right, because I get HAL_OK backMaybe I am not inializing GPIO properly from HAL_MspInit in stm32f7xx_hal_msp.c inproperlyI am realy out of ideas, what I am doing wrong, because the analog side of the audio does init, I can hear that as pop pop from the speakers when I power up my MCU, its just that SPDIF side has problemsI am is my setup crocked?I am using this component radio as my SPDIF transmitter (Hama DIT2000M):https://de.hama.com/webresources/article-documents/00054/man/00054821man_en.pdfIt says it has SPDIF Audio out (it says its digital over coaxial)I know its optical side is working fine because on my component receiver it plays just fine (it reports as 48khz Stereo)Is my cable to long? I am using this cable:(not sure who made it)Now why do I debug with blinking leds, because where my test subject is (my Hama receiver), there is no computer so…. Blinking leds it is, I would like to avoid aditional libraries and have a minimum working example, because you never know what problems they could bring so that's why LCD is not used right nowI hope someone has any advice, eather how to get any data in to SPDIF port (because right now for some reason, I don't get anything) or what I am doing wrong for my audio not to play, the usage of STM32F769i Discovery0 instead of STM32746G Discovery is probably not responsible I hope that this is a proper place for this king of questions, because I did ask a question regarding SPDIF on the STM forum:https://community.st.com/s/feed/0D53W00001z0RaqSAEBut didn't get any usefull advice thereNow SPDIF realy does not have much examples, there is only a polling example which does work (with the same cable), there is no interupt example, my interupt example (you can read the post on the STM forum post I linked) is not working as well (interupts are probably not broken right)So yea, I am lost a bit not sure what to do, and who to ask, so I tried this forum, because it seams people know what they are doing here Thanks for Anwsering and Best Regards