大家好!
有没有小伙伴使用过TMS570芯片进入SLEEP状态,并在SLEEP状态下wake up。谢谢!
noaming:
noaming:
TMS570LS12x/11x 16/32-Bit RISC Flash Microcontroller Technical Reference Manual (Rev. B)
ying guan:
回复 noaming:
谢谢!我就是想IO 高电平中断唤醒,现在不能唤醒了。
以下是我的睡眠代码:
void Doze(){ Flash_Sleep(); systemREG1->GHVSRC = 0x00000000; systemREG1->VCLKASRC = 0x00000000; systemREG1->RCLKSRC = 0x00000000;
// All clock Domains are disabled except RTI /** @b Initialize @b Clock @b Tree: */ // Write to Clock Source Disable Register – systemREG1->CSDIS = 0xFE; // disable all clock sources except OSCIN
/** – Disable / Enable clock domain */ systemREG1->CDDIS = 0x0 | (uint32)((uint32)1U << 0U ) /* GCLKOFF */ | (uint32)((uint32)1U << 1U ) /* HCLK OFF */ | (uint32)((uint32)1U << 2U ) /* VCLKP OFF */ | (uint32)((uint32)1U << 3U ) /* VCLK2 OFF */ | (uint32)((uint32)1U << 4U ) /* AVCLK 1 OFF */ | (uint32)((uint32)1U << 5U ) /* AVCLK 2 OFF */ | (uint32)((uint32)1U << 8U ) /* VCLK3 OFF */ | (uint32)((uint32)1U << 9U ) /* VCLK4 OFF */ | (uint32)((uint32)1U << 10U) /* AVCLK 3 OFF */ | (uint32)((uint32)1U << 11U); /* AVCLK 4 OFF */
asm( " NOP"); asm( " NOP"); asm( " NOP");
// Execute ARM instructions with IDLE cycles to trigger CPU clock stoppage asm( " WFI"); asm( " NOP"); asm( " b #-8"); asm( " NOP"); asm( " NOP"); asm( " NOP"); asm( " NOP");
}
这样调用Doze(); 以后,有中断产生,但是不能唤醒,请问如何唤醒,还需要配置一些寄存器吗
noaming:
回复 ying guan:
示波器测量一下wakeup single信号
ying guan:
回复 noaming:
IO口中断电平吗?肯定有的,我在DOZE情况下连调试器,可以进中断函数,但是程序不会地继续往下走了。我想问下,是不是我得需要重新启动任务?还是系统会自动WAKE-UP继续运行?
ying guan:
回复 noaming:
#pragma WEAK(gioNotification)void gioNotification(gioPORT_t *port, uint32 bit){/* enter user code between the USER CODE BEGIN and USER CODE END. *//* USER CODE BEGIN (19) */ if (gioPORTA == port) { if(2 == bit) { qca_notification(gioGetBit(port, bit)); } else if (5 == bit) { evcc_auxiliary_notification(); } else { //do nothing } }/* USER CODE END */}
这个是我的IO口中断函数,DOZE时候可以进这里,但我什么也没做 ,系统有个呼吸灯,但是呼吸灯不再继续闪烁了,CAN消息也不能处理,是不是就是没WAKEUP成功?
ying guan:
回复 noaming:
#pragma WEAK(gioNotification)void gioNotification(gioPORT_t *port, uint32 bit){/* enter user code between the USER CODE BEGIN and USER CODE END. *//* USER CODE BEGIN (19) */ if (gioPORTA == port) { if(2 == bit) { qca_notification(gioGetBit(port, bit)); } else if (5 == bit) { evcc_auxiliary_notification(); } else { //do nothing } }/* USER CODE END */}
这是我的中断处理函数 , Doze下我能进到这个中断函数中来,但是can任务收不到任何信息,感觉程序没有继续运行,是不是就是没WAKEUP