无法初始化外部存储器芯片

时间:2017-11-10 17:33:52

标签: data-structures initialization stm32

我有一个STM32F103C8T6 uC和一个ASIC芯片。它们与SPI接口通信,ST是主设备。在uC上由ASIC设备的供应商提供固件。我一直试图将它塑造成我的硬件和开发工具。这是初始化代码,

/*-----------------------------------------------------------------------*/
/* init application data                                                 */
/*-----------------------------------------------------------------------*/
memset( &sDpAppl, 0, sizeof( sDpAppl ) );

和一些函数声明,

#if VPC3_SERIAL_MODE
//I have already defined these externs
extern void                Vpc3Write      ( VPC3_ADR wAddress, uint8_t bData 
);

extern uint8_t   Vpc3Read    ( VPC3_ADR wAddress );

extern void      Vpc3MemSet ( VPC3_ADR wAddress, uint8_t bValue, uint16_t
                              wLength);

extern uint8_t   Vpc3MemCmp ( VPC3_UNSIGNED8_PTR pToVpc3Memory1, 
                 VPC3_UNSIGNED8_PTR pToVpc3Memory2, uint16_t wLength );

extern void      CopyToVpc3 ( VPC3_UNSIGNED8_PTR pToVpc3Memory, 
                 MEM_UNSIGNED8_PTR pLocalMemory, uint16_t wLength );

extern void      CopyFromVpc3( MEM_UNSIGNED8_PTR pLocalMemory, 
                 VPC3_UNSIGNED8_PTR pToVpc3Memory, uint16_t wLength );

#define CopyToVpc3_( _pToVpc3Memory, _pLocalMemory, _wLength )\
           CopyToVpc3( _pToVpc3Memory, _pLocalMemory, _wLength )

#define CopyFromVpc3_( _pLocalMemory, _pToVpc3Memory, _wLength )\
           CopyFromVpc3( _pLocalMemory, _pToVpc3Memory, _wLength )

#define Vpc3MemSet_( _pToVpc3Memory, _bValue, _wLength )\
           Vpc3MemSet( _pToVpc3Memory, _bValue, _wLength )

#define Vpc3MemCmp_( _pToVpc3Memory1, _pToVpc3Memory2, _wLength )\
           Vpc3MemCmp( _pToVpc3Memory1, _pToVpc3Memory2, _wLength )

#else

#define CopyToVpc3_( _pToVpc3Memory, _pLocalMemory, _wLength )\
           memcpy( _pToVpc3Memory, _pLocalMemory, _wLength )

#define CopyFromVpc3_( _pLocalMemory, _pToVpc3Memory, _wLength )\
           memcpy( _pLocalMemory, _pToVpc3Memory, _wLength )

#define Vpc3MemSet_( _pToVpc3Memory, _bValue, _wLength )\
           memset( _pToVpc3Memory, _bValue, _wLength )

#define Vpc3MemCmp_( _pToVpc3Memory1, _pToVpc3Memory2, _wLength )\
           memcmp( _pToVpc3Memory1, _pToVpc3Memory2, _wLength )

#endif /* #if VPC3_SERIAL_MODE */

我最关心的是memset()函数。在我看来,该功能应该初始化ASIC芯片,但对我来说似乎它没有。我有点困惑,或者说有什么。我希望一些更有经验的眼睛能看到我不知道的东西。 提前谢谢!

0 个答案:

没有答案