cancel
Showing results for 
Search instead for 
Did you mean: 

Error fsmc stm32f4discovery

sergej
Associate II
Posted on July 01, 2012 at 13:32

Hi, everyone.

I'm testing on fsmc stm32f407VG.

I use the Address / Data multiplexed on databus (MUXEN = 1).

2 modes of testing EXTMOD = 0 and 1.

Initialization:

  FSMC_Bank1->BTCR[0] = //FSMC_BCR2_EXTMOD |

                        FSMC_BCR2_WREN   |

                        FSMC_BCR2_FACCEN |

                        FSMC_BCR2_MWID_0 |

                        FSMC_BCR2_MTYP_1 |

                        FSMC_BCR2_MUXEN  |

                        FSMC_BCR2_MBKEN;

                        

  FSMC_Bank1->BTCR[1]  = (2 << 8) |                 // DATAST = 2

                         (1 << 4) |                 // ADDHLD = 1

                         (2 << 0);                  // ADDSET = 2

 

  FSMC_Bank1E->BWTR[0] = (2 << 8) |                 // DATAST = 2

                         (1 << 4) |                 // ADDHLD = 1

                         (2 << 0);                  // ADDSET = 2  

If EXTMOD = 0, so good.

If EXTMOD = 1, FSMC does not generate NL (NADV) and address (an error when writing and reading).

In what may be the problem?

This is a bug stm32f407VG?
3 REPLIES 3
zaurozavr
Associate II
Posted on July 01, 2012 at 20:25

There is a bug(s) in your code or hw.  Extended address mode assumes you need two ALE strobes, for complex addressing modes. I used to connect external RAM (1MByte) to STM32F4-Discovery board (with my ZP_DSF4 dockstation) in mux mode and all works perfectly. 

sergej
Associate II
Posted on July 04, 2012 at 20:41

I only use stm32f4discovery, the signals look oscilloscope (a bug in the hardware can not be).

I have two programs differ only in one line (bug in the software may not be):

FSMC_Bank1-> BTCR [0] = / / FSMC_BCR2_EXTMOD ... - Works MUX

FSMC_Bank1-> BTCR [0] = FSMC_BCR2_EXTMOD ... - Does not work MUX (stm32f407 does not give AL and Address on the bus, but the gates are WR, RD and Data these issues).
zaurozavr
Associate II
Posted on July 04, 2012 at 23:59

YOUR software may contain bugs or  improper FSMC initialization. I can assure with right implementation it works fine.

Here you are.

My docking station for STM32F4-Discovery:

http://www.zaurosoft.com/images/ZP_DSF4/ZP_DSF4_08.jpg

Timings (not optimal, just for test) for the external RAM in mux mode:

http://www.zaurosoft.com/images/ZP_DSF4/MuxRAM.png

You see the running code as follows:

*(uint16_t *) (Bank1_SRAM1_ADDR + 0x02) = 0xaa;

*(uint16_t *) (Bank1_SRAM1_ADDR + 0x10) = 0x55;

*(uint16_t *) (Bank1_SRAM1_ADDR + 0xf0) = 0x18;

*pBuf++ = *(uint16_t*) (Bank1_SRAM1_ADDR + 0x02);

*pBuf++ = *(uint16_t*) (Bank1_SRAM1_ADDR + 0x10);

*pBuf++ = *(uint16_t*) (Bank1_SRAM1_ADDR + 0xf0); Due to  16 bit access offsets 0x02, 0x10 and 0xf0  seen as 0x01, 0x08 and 0x78.