vxworks 代码错误,谢谢!
LOCAL AT91S_MciDeviceFeatures MCI_Device_Features;<br />LOCAL AT91S_MciDeviceDesc MCI_Device_Desc;<br />LOCAL AT91S_MciDevice * pMCI_Device=0;<br /><br />/*-----------------------------------------------*/<br />/* SDCard Device Descriptor Structure Definition */<br />/*-----------------------------------------------*/<br />typedef struct _AT91S_MciDeviceDesc<br />{<br /> volatile unsigned int state;<br /> unsigned int SDCard_bus_width;<br /><br />} AT91S_MciDeviceDesc, *AT91PS_MciDeviceDesc;<br /><br />/*---------------------------------------------*/<br />/* MMC & SDCard Structure Device Features */<br />/*---------------------------------------------*/<br />typedef struct _AT91S_MciDeviceFeatures<br />{<br /> unsigned int Card_Inserted; /* (0=AT91C_CARD_REMOVED) (1=AT91C_MMC_CARD_INSERTED) (2=AT91C_SD_CARD_INSERTED)*/<br /> unsigned int Relative_Card_Address; /* RCA*/<br /> unsigned int Max_Read_DataBlock_Length; /* 2^(READ_BL_LEN) in CSD */<br /> unsigned int Max_Write_DataBlock_Length; /* 2^(WRITE_BL_LEN) in CSD*/<br /> unsigned int Read_Partial; /* READ_BL_PARTIAL*/<br /> unsigned int Write_Partial; /* WRITE_BL_PARTIAL*/<br /> unsigned int Erase_Block_Enable; /* ERASE_BLK_EN*/<br /> unsigned int Read_Block_Misalignment; /* READ_BLK_MISALIGN*/<br /> unsigned int Write_Block_Misalignment; /* WRITE_BLK_MISALIGN*/<br /> unsigned int Sector_Size; /* SECTOR_SIZE*/<br /> unsigned int Memory_Capacity; /* Size in bits of the device*/<br /> <br />} AT91S_MciDeviceFeatures, *AT91PS_MciDeviceFeatures ;<br /><br />/*---------------------------------------------*/<br />/* MCI Device Structure Definition */<br />/*---------------------------------------------*/<br />typedef struct _AT91S_MciDevice<br />{<br /> BLK_DEV blkDev; <br /> int drive;<br /> int blkOffset ;<br /> AT91PS_MciDeviceDesc pMCI_DeviceDesc; /* MCI device descriptor*/<br /> AT91PS_MciDeviceFeatures pMCI_DeviceFeatures;/* Pointer on a MCI device features array */<br />}AT91S_MciDevice, *AT91PS_MciDevice;<br /><br />void AT91F_CfgDevice(AT91PS_MciDevice pmmcDev)<br />{<br /> /* Init Device Structure*/<br /><br /> MCI_Device_Features.Relative_Card_Address = 0;<br /> MCI_Device_Features.Card_Inserted = AT91C_CARD_REMOVED;<br /> MCI_Device_Features.Max_Read_DataBlock_Length = 0;<br /> MCI_Device_Features.Max_Write_DataBlock_Length = 0;<br /> MCI_Device_Features.Read_Partial = 0;<br /> MCI_Device_Features.Write_Partial = 0;<br /> MCI_Device_Features.Erase_Block_Enable = 0;<br /> MCI_Device_Features.Sector_Size = 0;<br /> MCI_Device_Features.Memory_Capacity = 0;<br /> <br /> MCI_Device_Desc.state = AT91C_MCI_IDLE;<br /> MCI_Device_Desc.SDCard_bus_width = AT91C_MCI_SCDBUS;<br /> <br /> /* Init AT91S_DataFlash Global Structure, by default AT45DB choosen !!!*/<br /> pmmcDev->pMCI_DeviceDesc = &MCI_Device_Desc;<br /> pmmcDev->pMCI_DeviceFeatures = &MCI_Device_Features;<br /><br />}<br /><br /><br />void mmcDevCreate(void)<br />{<br /> AT91PS_MciDevice pmmcDev;<br /> <br /> if ((pmmcDev = (AT91PS_MciDevice )calloc(sizeof (AT91PS_MciDevice), 1)) == NULL)<br /> return (NULL);<br /> pMCI_Device = pmmcDev; <br /> AT91F_CfgDevice(pmmcDev);<br /> <br />}<br /><br /><br />上面代码中,执行到<br /> pmmcDev->pMCI_DeviceDesc = &MCI_Device_Desc;<br /> pmmcDev->pMCI_DeviceFeatures = &MCI_Device_Features;<br />系统出错,提示信息如下:<br />Data abort<br />Exception address: 0x20013fe8<br />Current Processor Status Register: 0x20000013<br /><br />trcStack aborted: error in top frame<br />shell restarted.<br /><br /><br />请问,这边可以直接给指针赋值?谢谢!
页:
[1]