新手上路
- 积分
- 44
- 金钱
- 44
- 注册时间
- 2020-4-26
- 在线时间
- 10 小时
|
10金钱
死机的原因在调试的时候找到了 但是不知道这是哪里没配置对
HAL_StatusTypeDef HAL_NAND_Reset(NAND_HandleTypeDef *hnand)
{
uint32_t deviceaddress;
/* Check the NAND controller state */
if (hnand->State == HAL_NAND_STATE_BUSY)
{
return HAL_BUSY;
}
else if (hnand->State == HAL_NAND_STATE_READY)
{
/* Process Locked */
__HAL_LOCK(hnand);
/* Update the NAND controller state */
hnand->State = HAL_NAND_STATE_BUSY;
/* Identify the device address */
#if defined(FMC_Bank2_3)
if (hnand->Init.NandBank == FMC_NAND_BANK2)
{
deviceaddress = NAND_DEVICE1;
}
else
{
deviceaddress = NAND_DEVICE2;
}
#else
deviceaddress = NAND_DEVICE;
#endif
/* Send NAND reset command */
*(__IO uint8_t *)((uint32_t)(deviceaddress | CMD_AREA)) = 0xFF;
/* Update the NAND controller state */
hnand->State = HAL_NAND_STATE_READY;
/* Process unlocked */
__HAL_UNLOCK(hnand);
}
else
{
return HAL_ERROR;
}
return HAL_OK;
}
正常情况应该是运行红色部分,但是有#if defined(FMC_Bank2_3)
就不执行红色部分了,求大神告知这个宏定义要怎么修改才能将程序跳转
|
|