cancel
Showing results for 
Search instead for 
Did you mean: 

SDRAM Byte/Bit Swap

emrestr0
Associate II

Is bit/byte swap possible for Stm32h7xx MCUs? I have looked everywhere but cannot obtain any reliable information. Some design videos are made bit swap like Phil's Lab but no evidence about that board's working, just design. 

My microcontroller selection is STM32H743XIH6 and sdram selection is IS42S32800J-6BLI. In CubeMX, SDRAM pins look like they're fixed. But in some forums, they said bit or byte swap is allowed. I need some reliable information. Thank you.

7 REPLIES 7
SofLit
ST Employee

Hello @emrestr0 and welcome to the communty,

Could you please elaborate on this "SDRAM Byte/Bit Swap" feature and what do you want to do with it?

And not sure I understood what do you mean by "they are fixed" in CubeMx?

Are you suing a custom board or ST board? if ST board need to tell which one.

Thank you.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

I am planning to use SDR SDRAM on my custom board. And i am not sure if can swap bits within bank or swap bytes between banks. To get to the point what i meant by "they are fixed", in CubeMX when you press Ctrl + Left Button of mouse, CubeMX shows you alternative pin assignments of your clicked pin. For example PE5 is SPI4_MISO, when i press Ctrl + Left Click of mouse, CubeMX indicate that PE13 is also can be assigned as SPI4_MISO. But for SDRAM, there is no alternative for FMC_D8 or FMC_D7. So that makes me think that, what if it is not possible to swap bits or bytes?

https://pcbartists.com/design/embedded/sdram-bit-byte-swapping-rules/  said "Yes, you can do this with an SDR SDRAM chip." but for what source or datasheet? How can this guy so sure about that?

Or https://www.youtube.com/watch?v=AA_ls_9YdYk there is byte and bit swapping, but no proof that it is working. 

liaifat85
Senior III

STMicroelectronics has not explicitly documented support for bit/byte swapping in FMC for SDRAM. So it looks like any such design choice falls under the developer's responsibility to validate.


@emrestr0 wrote:

For example PE5 is SPI4_MISO, when i press Ctrl + Left Click of mouse, CubeMX indicate that PE13 is also can be assigned as SPI4_MISO. But for SDRAM, there is no alternative for FMC_D8 or FMC_D7. So that makes me think that, what if it is not possible to swap bits or bytes?


This is not a question of CubeMx but that depends on the availability of the alternate function on a given IO. This information is given in the datasheet / table 14:

SofLit_0-1731933744335.png

For example The SPI4_MISO is available on two IOs: PE5 and PE13 while FMC_Dx are available only on one I/Os.

According to the swapping function you are looking for (according to the link you shared) it's something linked to the PCB to decrease the vias, which is something you need to do with the layout.

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

According to the swapping function you are looking for (according to the link you shared) it's something linked to the PCB to decrease the vias, which is something you need to do with the layout.

 


Exactly, that is what i am wondering. Can i swap bits for that mcu like in FPGAs? If i swap bits within bank0 in the layout for instance, do i need to make changes in software side to indicate that?


@emrestr0 wrote:

If i swap bits within bank0 in the layout for instance, do i need to make changes in software side to indicate that?


I don't think so..

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

So, i can swap bits with peace of mind?