完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
怀疑是demo都有问题。有人有可用的代码吗?
|
|
|
|
我是用一个开发板与电脑测的 不知道是不是要两个stm32l011才可以啊!!有没有人知道啊?
|
|
|
|
|
|
|
|
学习一下
|
|
|
|
楼主用的是哪种方式进行的STOP。看一下进入STOP的代码。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stop时可以alarm唤醒 要关联17 是不是uart也要关联某个线
|
|
|
|
帮顶,留意
|
|
|
|
先把串口还原成普通IO,然后把RX设置中断,不就可以唤醒了嘛
|
|
|
|
库就是垃圾
|
|
|
|
用了就后悔的
|
|
|
|
不同的休眠模式能能被什么唤醒,ST MCU参考手册上都明确写出来了的。
这里的32L011,STOP模式下可以被USART1/USART2/LPUART1唤醒,不过还要与 相应的EXTI中断线配置起来。 |
|
|
|
唤醒命令是查手册的吗
|
|
|
|
改IO中断 没意思,uart在stop下手册上写有可以唤醒的。这才是这个片子的特性 |
|
|
|
可以的。en.DM00355687这个文件里有提到可以到stop下唤醒。且en.stm32cubel0的例程里有UART_WakeUpFromStop的代码。我是直接跑的,但就是唤醒不了!!不知道错在哪里!! 以下是官方的例程: /* make sure that no UART transfer is on-going */ while(__HAL_UART_GET_FLAG(&UartHandle, USART_ISR_BUSY) == SET); /* make sure that UART is ready to receive * (test carried out again later in HAL_UARTEx_StopModeWakeUpSourceConfig) */ while(__HAL_UART_GET_FLAG(&UartHandle, USART_ISR_REACK) == RESET); /* set the wake-up event: * specify wake-up on RXNE flag */ WakeUpSelection.WakeUpEvent = UART_WAKEUP_ON_READDATA_NONEMPTY; if (HAL_UARTEx_StopModeWakeUpSourceConfig(&UartHandle, WakeUpSelection)!= HAL_OK) { Error_Handler(); } /* Enable the UART Wake UP from stop mode Interrupt */ __HAL_UART_ENABLE_IT(&UartHandle, UART_IT_WUF); /* about to enter stop mode: switch off LED */ __HAL_RCC_PWR_CLK_ENABLE(); /* enable MCU wake-up by UART */ HAL_UARTEx_EnableStopMode(&UartHandle); /* enter stop mode */ BSP_LED_Off(LED3); HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI); /* ... STOP mode ... */ SystemClock_Config(); /* at that point, MCU has been awoken: the LED has been turned back on */ /* Wake Up based on RXNE flag successful */ BSP_LED_On(LED3); HAL_UARTEx_DisableStopMode(&UartHandle); /* wait for some delay */ HAL_Delay(1000); /* Inform other board that wake up is successful */ if (HAL_UART_Transmit(&UartHandle, (uint8_t*)aTxBuffer1, COUNTOF(aTxBuffer1)-1, 5000)!= HAL_OK) { Error_Handler(); } HAL_Delay(1000); BSP_LED_Off(LED3); /*##-2- Wake Up second step ###############################################*/ /* make sure that no UART transfer is on-going */ while(__HAL_UART_GET_FLAG(&UartHandle, USART_ISR_BUSY) == SET); /* make sure that UART is ready to receive * (test carried out again later in HAL_UARTEx_StopModeWakeUpSourceConfig) */ while(__HAL_UART_GET_FLAG(&UartHandle, USART_ISR_REACK) == RESET); /* set the wake-up event: * specify wake-up on start-bit detection */ WakeUpSelection.WakeUpEvent = UART_WAKEUP_ON_STARTBIT; if (HAL_UARTEx_StopModeWakeUpSourceConfig(&UartHandle, WakeUpSelection)!= HAL_OK) { Error_Handler(); } /* Enable the UART Wake UP from stop mode Interrupt */ __HAL_UART_ENABLE_IT(&UartHandle, UART_IT_WUF); /* about to enter stop mode: switch off LED */ BSP_LED_Off(LED3); /* enable MCU wake-up by UART */ HAL_UARTEx_EnableStopMode(&UartHandle); /* enter stop mode */ HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI); /* ... STOP mode ... */ /* at that point, MCU has been awoken: the LED has been turned back on */ /* Wake Up on start bit detection successful */ HAL_UARTEx_DisableStopMode(&UartHandle); /* wait for some delay */ HAL_Delay(100); /* Inform other board that wake up is successful */ if (HAL_UART_Transmit(&UartHandle, (uint8_t*)aTxBuffer2, COUNTOF(aTxBuffer2)-1, 5000)!= HAL_OK) { Error_Handler(); } |
|
|
|
|
|
|
|
huazhe 发表于 2019-1-10 11:31 可否提示下要怎么与exti中断线配置呢? 官方的demo没有看到啊。可否贴下代码? |
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
2005 浏览 1 评论
AD7686芯片不传输数据给STM32,但是手按住就会有数据。
1858 浏览 3 评论
4442 浏览 0 评论
如何解决MPU-9250与STM32通讯时,出现HAL_ERROR = 0x01U
2007 浏览 1 评论
hal库中i2c卡死在HAL_I2C_Master_Transmit
2513 浏览 1 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-20 12:20 , Processed in 0.887430 second(s), Total 79, Slave 73 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号