cancel
Showing results for 
Search instead for 
Did you mean: 

Hello Why I set the FMC Base Address as 0x6c00007e in CubeMX, but this value is changed to 0x7800007E?

jee
Associate II

I set the FMC Base Address as 0x6c00007e

0693W00000D1o9WQAR.pngbut this value is changed to 0x7800007E

0693W00000D1o9lQAB.pngand lcd doesn't show anything. I changed this value to this.

0693W00000D1o9vQAB.pngIt works properly.

and I changed the value as 0x60000000,CubeMX is automatically generated correctly.

0693W00000D1oAAQAZ.png0693W00000D1oAFQAZ.png

1 ACCEPTED SOLUTION

Accepted Solutions

Clear, thank you @jee​  for providing your ioc file, at the beginning, I was able to obtain a different result from yours because I was using the Bank1 in my test.

Actually, the value obtained in your generated code was expected, in fact:

  • The Nor LCD, consist of 4 banks: NE1/2/3 and 4
  • Each bank has the size of 64MB
  • The default FMC base address is 0x6000 0000

Using your configuration, which is FMC Bank4, the start bank Register Address will take the value of 0x6C00 0000 (0x6000 0000 for NE1, 0x6400 0000 for NE2 and 0x6800 0000 for NE3), with the default FMC base address, which explain the result found by you when you did not change the Base address in CubeMX.

Now, with 0x6C00007E FMC base address, the bank register address will take 0x6C00007E + 0x0C00 0000 which is 0x7800 007E (note: the #define FMC_BANK3_REG represent the Bank register address and not the base address set on CubeMX).

Hope my answer helped you, when your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

Thanks, Khouloud

View solution in original post

10 REPLIES 10
Khouloud ZEMMELI
ST Employee

Hello @jee​ 

Thanks for your feedback,

Could your please share your ioc file or give me more details about the Part Number used to be able to reproduce the issue?

Thanks, Khouloud

Khouloud ZEMMELI
ST Employee

Hi again @jee​ ,

I have checked from my side, and I cannot reproduce the issue (I used H750), the value generated is the same entered in CubeMX interface:

#define FMC_BANK1_REG ((uint16_t *) 0x6C00007E)
#define FMC_BANK1_MEM ((uint16_t *) 0x6C000080)

Could you please switch to the latest CubeMX version (6.3.0) then re-try with it?

I'll be waiting for your feedback 🙂

Thanks, Khouloud

of course​, this is my ioc file, and my CubeMX version is latest. thank you!

or this file

Clear, thank you @jee​  for providing your ioc file, at the beginning, I was able to obtain a different result from yours because I was using the Bank1 in my test.

Actually, the value obtained in your generated code was expected, in fact:

  • The Nor LCD, consist of 4 banks: NE1/2/3 and 4
  • Each bank has the size of 64MB
  • The default FMC base address is 0x6000 0000

Using your configuration, which is FMC Bank4, the start bank Register Address will take the value of 0x6C00 0000 (0x6000 0000 for NE1, 0x6400 0000 for NE2 and 0x6800 0000 for NE3), with the default FMC base address, which explain the result found by you when you did not change the Base address in CubeMX.

Now, with 0x6C00007E FMC base address, the bank register address will take 0x6C00007E + 0x0C00 0000 which is 0x7800 007E (note: the #define FMC_BANK3_REG represent the Bank register address and not the base address set on CubeMX).

Hope my answer helped you, when your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

Thanks, Khouloud

jee
Associate II

Oh, thank you. In fact, when we set the NEx and lcd Register selection (I am using A6), the FMC base address can be automatically generated by CubeMX, so we don't need to set the value.

jee
Associate II

I want to set the value of the FMC base address as 0x6c00007e, how should I do?

You just need to put this address value on CubeMX, in FMC base address parameter, then it will be taken into consideration:

/**
  * STM32 FMC Interface
  *  - Base Address           : 0x6C00007E
  *  - Bank Size              : 0x04000000
  *  - Bank ID                : 4
  *  - Bank Register Address  : 0x7800007E
  *  - Bank Memory Address    : 0x78000080
  *  - Data Size              : 16 bits
  */

Khouloud

jee
Associate II

thank you for your replay👍