https://blog.csdn.net/heybeaman/article/details/80373435
#define CHIP_ID_START 0x1FFF7590
void Get_ChipID(unsigned char *p){
unsigned char i;
unsigned char *pIDStart=(unsigned char *)(CHIP_ID_START);
for(i=0;i!=12;i++)
{
*p++=*pIDStart++;
}
}
用的时候
void GetDataBaseMsg( BleAppMsgType *pMsg , uint8_t *pRtData)
{
uint8_t *AdminMsg, *ChipId ,i=0 ,index =0,UserIndex=0 ;
config.read(CFG_SYS_CHIP_ID , (void **)&ChipId);
Get_ChipID(ChipId);
认真看上面代码!config.read(CFG_SYS_CHIP_ID , (void **)&ChipId); 其实相当于malloc!!因为直接调用 Get_ChipID(ChipId)的话 *ChipId还是空空如也 会死机!!!!!!