Page 1 of 2

STM32F469I-DISCO board SD-Card Pin not available

Posted: Wed Mar 19, 2025 1:27 pm
by stefan.erni
On my STM32F469I-DISCO board is a sd-card but I can not choose the pin for the sd-card
this is for:
SDI=D12
SDO=G14
CLK=A12

CS=B14 is ok :)

maybe you could use the 4Bit mode right away?
here the schematic
2025-03-19_13-38-45.PNG
2025-03-19_13-38-45.PNG (197.26 KiB) Viewed 4005 times

Re: STM32F469I-DISCO board SD-Card Pin not available

Posted: Fri Apr 11, 2025 10:07 am
by stefan.erni
With this component I cannot select the pin I need to use the sd-card
2025-04-11_10-46-02.PNG
2025-04-11_10-46-02.PNG (8.54 KiB) Viewed 3692 times
For the CS is a nice option to choose the Pin
2025-04-11_10-49-26.PNG
2025-04-11_10-49-26.PNG (144.36 KiB) Viewed 3692 times
For the another pin it's not possible to choose the right pin.
2025-04-11_10-51-04.PNG
2025-04-11_10-51-04.PNG (22.19 KiB) Viewed 3692 times
It would be helpful if these pins were available for selection
Otherwise you cannot use the SD card.

SDI=D12
SDO=G14
CLK=A12

The same problem on this post with a STM32F405
https://flowcode.co.uk/forums/viewtopic.php?t=3053

Re: STM32F469I-DISCO board SD-Card Pin not available

Posted: Fri Apr 11, 2025 12:23 pm
by medelec35
Hi Stefan.
The remapping pins is not determined by the component.
You can tell if its a component issue, by creating a new project using BL0011 as a target, You don't need to own a BL0011 as you don't need to compile.
Add the component in question, then see if you can select different pins for the SPI.
If you can, then it's not a component issue, its either there should not be more than 1 pin selected or there is an issue with the fcdx file that will be stating what pins will be available.
For example with your target device the lines within 32F469Discovery.fcdx thai is dictating the pins you can use are:

Code: Select all

    <spi remappable='3' name='SPI2' >
        <clk  af0='5' port0='3' pin0='3' />
        <miso af0='5' port0='1' pin0='14' af1='5' port1='2' pin1='2' />
        <mosi af0='5' port0='1' pin0='15' af1='5' port1='2' pin1='3' />
    </spi>

    <spi remappable='3' name='SPI6' >
        <clk  af0='5' port0='6' pin0='13' />
        <miso af0='5' port0='6' pin0='12' />
        <mosi af0='5' port0='6' pin0='14' />
    </spi>
Note:
PortA = 0
PortB = 1
PortC = 2
PortD = 3
PortE = 4
etc.
I have selected SPI12 for the SD component.
Looking at <spi remappable='3' name='SPI2' >, I can see

Code: Select all

 <clk  af0='5' port0='3' pin0='3' />
Which is telling me only Port D3 is the only pin available when using discovery.
However with MOSI, within fcdx the code is

Code: Select all

<mosi af0='5' port0='1' pin0='15' af1='5' port1='2' pin1='3' />

Which means Port B15 & C3 is available.

You edit your own local 32F469Discovery.fcdx which is within

Code: Select all

%ProgramData%\MatrixTSL\FlowcodeV10\FCD\ARM\
I Don't know the reason for the restriction, it might be due to your hardware.
But at least now you have enough information to change the pin what is used at your risk, as changing the pin to one which is not within the datasheet will stop SPI from working.
My advice is check the datasheet first, and see what pins the SPI clock uses.

Re: STM32F469I-DISCO board SD-Card Pin not available

Posted: Fri Apr 11, 2025 12:59 pm
by medelec35
Sorry, I should have added that any changes to the fcdx file is the same with any component changes.
You must reload your project for any fcdx changes to take effect.

Re: STM32F469I-DISCO board SD-Card Pin not available

Posted: Fri Apr 11, 2025 2:22 pm
by LeighM
Just to add to Martin's comment, a look at the datasheet indicates that A9 could be added to the fcd for SPI2 CLK, but not A12.
edit: The circuit diagram shows port C pin 12, using SDIO interface, which Flowcode doesn't support.
Suggest trying software SPI mode?

Re: STM32F469I-DISCO board SD-Card Pin not available

Posted: Fri Apr 11, 2025 2:50 pm
by stefan.erni
Hi Martin, Hi LeighM

I can change the pin in the 32F469Discovery.fcdx and it's run it without errors
But it's not working to write a file....
I have probably mixed up port and pin, this I want to test and correct that.

As a sample, the working I2C pins:
2025-04-11_14-51-21.PNG
2025-04-11_14-51-21.PNG (29.36 KiB) Viewed 3637 times
One problem, however, will be the CS pin. I have not yet found where to change it.

Only here in 32F469Discovery.fcdx
but I don't know what it is
2025-04-11_15-27-39.PNG
2025-04-11_15-27-39.PNG (21.42 KiB) Viewed 3637 times

Re: STM32F469I-DISCO board SD-Card Pin not available

Posted: Fri Apr 11, 2025 3:29 pm
by stefan.erni
here the right port

SDI=D2
SDO=C8
CLK=C12
CS=C11
DAT1=C9 (set to 1)
DAT2=C10 (set to 1)

In softwaremode I can set the pin but not the 2 unused pin to set to high
2025-04-11_16-27-14.PNG
2025-04-11_16-27-14.PNG (52.52 KiB) Viewed 3606 times

Re: STM32F469I-DISCO board SD-Card Pin not available

Posted: Fri Apr 11, 2025 3:30 pm
by LeighM
SPI.jpg
SPI.jpg (14.11 KiB) Viewed 3605 times

Re: STM32F469I-DISCO board SD-Card Pin not available

Posted: Fri Apr 11, 2025 3:43 pm
by LeighM
Try a C code icon with

Code: Select all

SET_PORT_PIN(C, 9, 1);
SET_PORT_PIN(C, 10, 1);

Re: STM32F469I-DISCO board SD-Card Pin not available

Posted: Fri Apr 11, 2025 4:52 pm
by stefan.erni
I tried with the c-code, but it is still not working, so i add the display and the ret_byte is alway 255
2025-04-11_17-44-55.PNG
2025-04-11_17-44-55.PNG (105.65 KiB) Viewed 3577 times
2025-04-11_17-50-15.PNG
2025-04-11_17-50-15.PNG (23.22 KiB) Viewed 3577 times