初级会员
- 积分
- 116
- 金钱
- 116
- 注册时间
- 2016-11-1
- 在线时间
- 31 小时
|
1金钱
MCU屏驱动是9328,原子哥的767例程里面已经没有9328的驱动,使用的是STemwin带的驱动,初始化使用以前的初始化,严重怀疑和MPU有关,最开始按照网上的方法设置
void MPU_Config(void)
{
MPU_Region_InitTypeDef MPU_InitStruct;
/* Disable the MPU */
HAL_MPU_Disable();
/* Configure the MPU attributes as WT for SRAM */
MPU_InitStruct.Enable = MPU_REGION_ENABLE;
MPU_InitStruct.BaseAddress = 0x20000000;
MPU_InitStruct.Size = MPU_REGION_SIZE_4GB;
MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS;
MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE;
MPU_InitStruct.IsCacheable = MPU_ACCESS_NOT_CACHEABLE;
MPU_InitStruct.IsShareable = MPU_ACCESS_SHAREABLE;
MPU_InitStruct.Number = MPU_REGION_NUMBER0;
MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0;
MPU_InitStruct.SubRegionDisable = 0x00;
MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_ENABLE;
HAL_MPU_ConfigRegion(&MPU_InitStruct);
/* Enable the MPU */
HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT);
}
STemwin得到运行,但是,会莫名其妙的卡住,进入硬件错误中断,然后直接调用原子哥的MPU,设置0x60000000到后面256M字节全访问。STemwin卡住在第一个DEMO.唉,很烦。设置不同的MPU,STemwin运行都会有差别
|
|