初级会员
- 积分
- 72
- 金钱
- 72
- 注册时间
- 2018-9-19
- 在线时间
- 48 小时
|
Tue Oct 09, 2018 09:15:02: Failed to get execution status: SWIM error [30004]: Comm timeout
Tue Oct 09, 2018 09:15:02: Failed to read memory at 0x505F: SWIM error [30004]: Comm timeout
Tue Oct 09, 2018 09:15:02: Failed to write memory at 0x850A: SWIM PROG error [42004]: Memory write error
Tue Oct 09, 2018 09:15:02: Failed to read memory at 0x17FC: SWIM error [30004]: Comm timeout
每次都出现这个报错,通讯超时!! 这是什么问题??? 怎么解决????
程序非常简单 如下:
#include"stm8s.h"
void CAN_DK(void);
void CAN_CSH(void);
void CAN_FS(void);
int main( void )
{
while(1)
{
CAN_DK();
CAN_CSH();
CAN_FS();
}
}
void CAN_DK(void)
{
GPIO_Init(GPIOG,GPIO_PIN_1,GPIO_MODE_IN_PU_NO_IT);
GPIO_Init(GPIOG,GPIO_PIN_0,GPIO_MODE_OUT_PP_HIGH_FAST);
}
void CAN_CSH(void)
{
CLK_DeInit();
CLK_HSICmd(ENABLE);
CLK_PeripheralClockConfig(CLK_PERIPHERAL_CAN, DISABLE);
CAN_DeInit(); //CAN恢复默认值//
CAN_Init(CAN_MasterCtrl_AllDisabled,CAN_Mode_LoopBack, CAN_SynJumpWidth_2TimeQuantum, CAN_BitSeg1_7TimeQuantum, CAN_BitSeg2_8TimeQuantum, CAN_ClockSource_Internal,1); //波特率 500//
}
void CAN_FS(void)
{
u8 can_data1[1];
can_data1[0]=0x12;
CAN_Transmit(0x123, CAN_Id_Standard, CAN_RTR_Data, 0x08,can_data1);
}
|
|