2026-03-04 4:48 AM - last edited on 2026-03-09 3:43 AM by KDJEM.1
Hi all,
I have a small issue with the STM32N6570-DK board and the VENC_SDCard example code.
The PN12 pin has a voltage of 0V (card inserted) or 1.80V (no card inserted); on the MCU side, the GPION data register (IDR) always shows a logic 0 in both situations.
The VENC_SDCard / VENC_SDCard_ThreadX example code basically jumps over SD Card detection as it assumes a logic level of 0 == card present. If there is no card, mounting fails and aborts further processing.
I have the requirement to react to card inserts / removals, so I'd like to trigger an interrupt or at least be able to read a logic high once in a while but could not find out what exactly is missing in the code.
* I tested with an empty CubeMX project and set this PN12 to input; here I do see logic level changes.
* I susptected the VDDIO voltage domains to be at 3V3 for that block and manually switched VDDIO_SD to be at 1V8, but that did not show a change as well
* I did not fiddle with security bit settings...
maybe one of you has an idea?
Simon
Solved! Go to Solution.
2026-03-16 9:00 AM
Hello,
Have you made any progress on that ?
PN12 is on the VDDIO3 power domain which is powered at 1.8v, consequently SD card detect signal is pulled up at 1.8V.
The example might consider the SD card is always inserted, as the .ioc template that I see in the firmware package doesn't intialize PN12...
Please try to add the init code for PN12 in the example, maybe in fx_stm32_sd_driver_glue.c/HAL_SD_MspInit().
Don't forget to call HAL_PWREx_EnableVddIO3() just in case this is not done somewhere else in the code.
2026-03-16 9:00 AM
Hello,
Have you made any progress on that ?
PN12 is on the VDDIO3 power domain which is powered at 1.8v, consequently SD card detect signal is pulled up at 1.8V.
The example might consider the SD card is always inserted, as the .ioc template that I see in the firmware package doesn't intialize PN12...
Please try to add the init code for PN12 in the example, maybe in fx_stm32_sd_driver_glue.c/HAL_SD_MspInit().
Don't forget to call HAL_PWREx_EnableVddIO3() just in case this is not done somewhere else in the code.
2026-03-20 3:57 AM
Ah perfect --- I was missing the power domain. Many thanks!