2021-08-07 07:33 AM
I set the FMC Base Address as 0x6c00007e
but this value is changed to 0x7800007E
and lcd doesn't show anything. I changed this value to this.
It works properly.
and I changed the value as 0x60000000,CubeMX is automatically generated correctly.
Solved! Go to Solution.
2021-08-11 07:01 AM
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:
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
2021-08-11 03:28 AM
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
2021-08-11 03:54 AM
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
2021-08-11 05:42 AM
2021-08-11 05:49 AM
2021-08-11 07:01 AM
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:
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
2021-08-11 07:44 AM
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.
2021-08-11 07:59 AM
I want to set the value of the FMC base address as 0x6c00007e, how should I do?
2021-08-12 12:42 AM
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
2021-08-14 05:48 PM
thank you for your replay:thumbs_up: