cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f7 FMC interfacing external nonmemory chip, like XR16v798

HSh..2
Associate II

Hi.

I`m going to use an octal uart IC named XR16V798 and my MCU is a stm32f756z,

I printed my own designed board which connected these two ICs as follows:

0693W00000UnuCVQAZ.pngjust to mention, I haven`t used FMC with any other device before, now I dont know how to work with this IC,

stm32cubemx version 6.5.0 generated the code.

thanks.

4 REPLIES 4

Read the FMC chapter in RM.

Your chip's registers are now mapped to STM32's memory, as you use FMC_NE1 ie. Bank 1 - NOR/PSRAM 1, at address 0x6000'0000. It means, you can access the registers e.g. in this way:

#define XR16V798_REG0 *(volatile uint8_t*)0x60000000

#define XR16V798_REG1 *(volatile uint8_t*)0x60000001

XR16V798_REG0 = new_value_for_register_0;

readout_value_from_register_1 = XR16V798_REG1;

However, to get this working properly in 'F7, you need to set the region starting at 0x6000'0000 as Device in MPU. Alternatively, remap it to 0xC000'0000 using SYSCFG_MEMRMP.SWP_FMC, then the above macros would of course also using the 0xC0000000 address.

JW

Thanks for reply.

Definitely was not going to work without these helps you put here, is there any comprehensive application note that I can use to setup these registers? there is no good source for that.

thanks again.

Probably not a single concise document, so you have to go through all available materials, i.e. the Cortex-M7 UM, the DS/RM/ES combination, and selected application notes such as AN4838/AN4839. You can also check out the "tips" section in AN4891, while that's for 'H7 some of the tips pertain to 'F7 too.

JW

That was a really hard job. I added some piece of code as you mentioned:

in header file

#define MPU_TYPE     (*((volatile unsigned long*) 0xE000ED90)) 

#define MPU_CTRL     (*((volatile unsigned long*) 0xE000ED94)) 

#define MPU_RNR     (*((volatile unsigned long*) 0xE000ED98)) 

#define MPU_RBAR     (*((volatile unsigned long*) 0xE000ED9C)) 

#define MPU_RASR     (*((volatile unsigned long*) 0xE000EDA0)) 

in C file

void Config_MPU(void)

{

 MPU_RNR = 0x00000003;

 MPU_RBAR = 0x60000000;

 MPU_RASR = 0x0301FF0F;

 MPU_CTRL = 0x00000005;

}

and after those in my main file, I have:

 SYSCFG->MEMRMP &= 0xfffff3ff;

 SYSCFG->MEMRMP |= 1<<10;

not any success. I cant see any square waves in my oscope.

Thanks for the help.