2016-09-17 12:02 PM
Hi Everyone,
I am interfacing an ssd1289 TFT controller with stm32f427 , I have an old code with stm32f407 and standard peripherallibrary , I tried to use stm32f4cube helloworld example to run my first demo on the stm32f427 processor with using HAL libraries.
While trying porting example running on an stm32f407 processor to stm32f427 one.
first I changed all FSMC to FMC , then I changed the address of writingto be
#define LCD_BASE_Data ((u32)(0x60000000|0x00100000))
#define LCD_BASE_Addr ((u32)(0x60000000|0x00000000))
#define LCD_CMD (*(vu16 *)LCD_BASE_Addr)
#define LCD_Data (*(vu16 *)LCD_BASE_Data)
I changed the FMC memory Bank to 1 as I am using addresses in that location and the old code of the
stm32f407 was using Bank 1 too ,
But the weird thing is that it didn't work untill I changed the bank number back to 3. then it worked and I saw the Hello world string on the blank screen.
My question is how this is happening , I commented the FMC_BANK3_BASE//#define FMC_BANK3_BASE ((uint32_t)(0x60000000 | 0x08000000))
and also changed the LCD write and read to use the LCD_CMD and LCD_Data addresses instead.
static
void
LcdWriteReg(U16 Data)
{
// STM_FMC_BANK3_WriteReg(Data);
LCD_CMD = Data;
}
static
void
LcdWriteData(U16 Data)
{
// STM_FMC_BANK3_WriteData (Data);
LCD_Data = Data;
}
static
void
LcdWriteDataMultiple(U16 * pData,
int
NumItems)
{
while
(NumItems--)
{
// STM_FMC_BANK3_WriteData(*pData++);
LcdWriteData (*pData++);
}
}
static
void
LcdReadDataMultiple(U16 * pData,
int
NumItems)
{
while
(NumItems--)
{
// *pData++ = STM_FMC_BANK3_ReadData();
}
}
so please if you can give me some explanation how setting the FMC bank to 3 work with address from bank one ?
Thanks a lot,
Amr. #stm32f4 #ssd1289 #stemwin2016-09-19 11:39 AM
Please if anyone want to help me out and want any more information(configurations , source code , etc..) ,I can share ,so please I need a reply.
Thanks a lot.2016-09-21 07:54 AM
Hi mrlsayed,
I would not advise to do the migration by yourself .. it will be difficult and a useless effort and rework of the role of our development team. Infact, our Hal library is done for this purpose to let user migrate easily from one device to another. There is a project template for each family and each hardware. In addition , STM32cubeMx tool can be used to generate a new project for a selected device or hardware, and add your user code then with a simple change that you made. The problem that you have seen, sue to the use of old drivers version , not updated for STM32F42xx devices. So, I recommend that you use the template project for STM32F42xx un at this path: STM32Cube_FW_F4_V1.13.0\Projects\STM324x9I_EVAL\Templates or you can just , copy and paste the new drivers/header (“scr� and� inc� folders) of this package to your project folders and reintegrate them to you workspace. -Hannibal-