硬汉嵌入式论坛

 找回密码
 立即注册
查看: 199|回复: 1
收起左侧

[emWin] 关于emwim配置外部SRAM卡死问题的解决方法

[复制链接]

3

主题

7

回帖

16

积分

新手上路

积分
16
发表于 2023-7-11 21:33:56 | 显示全部楼层 |阅读模式
关于emwim配置外部SRAM卡死问题,论坛上各位大佬分析的原因是LCD和SRAM关于FSMC冲突。我对比了某火和某原子相关的emwin案例发现,不同点在于GUIConf.c文件void GUI_X_Config(void)函数中的GUI_ALLOC_SetAvBlockSize(GUI_BLOCKSIZE);,注释掉此函数后,屏幕可以正常显示。可以解决emwin开启外部SRAM后不显示的问题
回复

使用道具 举报

1万

主题

6万

回帖

10万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
106913
QQ
发表于 2023-7-12 08:34:19 | 显示全部楼层
根本原因不在这里,我们早期给V5板子做的一代示波器就是用的外部SRAM,是调用了这个函数的。
https://www.armbbs.cn/forum.php?mod=viewthread&tid=3886

[C] 纯文本查看 复制代码
/*********************************************************************
*                SEGGER Microcontroller GmbH & Co. KG                *
*        Solutions for real time microcontroller applications        *
**********************************************************************
*                                                                    *
*        (c) 1996 - 2011  SEGGER Microcontroller GmbH & Co. KG       *
*                                                                    *
*        Internet: [url=http://www.segger.com]www.segger.com[/url]    Support:  [url=mailto:support@segger.com]support@segger.com[/url]    *
*                                                                    *
**********************************************************************

** emWin V5.12 - Graphical user interface for embedded applications **
All  Intellectual Property rights  in the Software belongs to  SEGGER.
emWin is protected by  international copyright laws.  Knowledge of the
source code may not be used to write a similar product.  This file may
only be used in accordance with the following terms:

The software has been licensed to  ARM LIMITED whose registered office
is situated at  110 Fulbourn Road,  Cambridge CB1 9NJ,  England solely
for  the  purposes  of  creating  libraries  for  ARM7, ARM9, Cortex-M
series,  and   Cortex-R4   processor-based  devices,  sublicensed  and
distributed as part of the  MDK-ARM  Professional  under the terms and
conditions  of  the   End  User  License  supplied  with  the  MDK-ARM
Professional. 
Full source code is available at: [url=http://www.segger.com]www.segger.com[/url]

We appreciate your understanding and fairness.
----------------------------------------------------------------------
File        : GUIConf.c
Purpose     : Display controller initialization
---------------------------END-OF-HEADER------------------------------
*/
#include "GUI.h"
#include "bsp.h"

/*
**********************************************************************
*
*       Defines
*
**********************************************************************
*/

/* Define the available number of bytes available for the GUI */
//#define GUI_NUMBYTES  (1024*80)
#define GUI_NUMBYTES  (1024*1024*2)
/* Define the average block size */
#define GUI_BLOCKSIZE 0x80



/*********************************************************************
*
*       GUI_X_Config
*
* Purpose:
*   Called during the initialization process in order to set up the
*   available memory for the GUI.
**********************************************************************
*/
void GUI_X_Config(void) 
{
#if 0
        /* 32 bit aligned memory area */
        static U32 aMemory[GUI_NUMBYTES / 4];
        
        /*  Assign memory to emWin */
        GUI_ALLOC_AssignMemory(aMemory, GUI_NUMBYTES);
        GUI_ALLOC_SetAvBlockSize(GUI_BLOCKSIZE);
#else        
        static U32 *aMemory;
        aMemory = (U32 *)EXT_SRAM_ADDR;
        /*  Assign memory to emWin */
        GUI_ALLOC_AssignMemory(aMemory, GUI_NUMBYTES);
        GUI_ALLOC_SetAvBlockSize(GUI_BLOCKSIZE);
#endif
}

/*************************** End of file ****************************/

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|Archiver|手机版|硬汉嵌入式论坛

GMT+8, 2024-5-9 22:58 , Processed in 0.151017 second(s), 26 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表