cancel
Showing results for 
Search instead for 
Did you mean: 

Xbee STM32F4/7 USRT DMA

Grozea.Ion
Associate II
Posted on August 30, 2017 at 20:32

Hi,

When using normal transmit on UART i can send a message from a router to a coordinator without no issue

HAL_UART_Transmit(&huart2, (uint8_t*)xFrame, sLen,100);

, but when i try to send it using 

HAL_UART_Transmit_DMA(&huart2, (uint8_t*)xFrame, sLen);

{

_Error_Handler(__FILE__, __LINE__);

}

while (xUartReady != SET)

{

}

xUartReady = RESET;

The 

xUartReady is handled in the callback function.

Did any of you had this issue? How it was solved?

#stm32f4 #uart-dma #xbee #stm32f7
11 REPLIES 11
Posted on February 06, 2018 at 20:39

Hi Grozea, 

I am more concerned about the Xbee module. For example, if the end device (Xbee Zigbee module) is in the cyclic sleep mode, this module will periodically wake up and check if there is data from other devices. I would like to wake the MCU (connected to the xbee module) up only when data is received from the xbee. Otherwise, the MCU should keep in the sleep mode to save energy. 

I know on the xbee module, there is a pin (Pin 13) to indicate the status of the xbee module, but this pin become high when the xbee is asleep, even there is no data received. So this pin is not 100% precent prefect to be used as the interrupt for the MCU. I would like to know if you have any other suggestions?

Best,

Hai

Posted on February 07, 2018 at 20:54

Look here: Stop mode The STM32L4 Series implements three Stop modes with full SRAM and Peripheral retention capability and capacity to wakeup in 1 µs thanks to the use of the MSI up to 48 MHz. In these Stop modes all the high speed oscillators (HSE, MSI, HSI) are stopped, while the low speed ones (LSE, LSI) can be kept active. The peripherals can be set active, using the HSI clock when needed, to be able to wakeup the device on some specific events (such as UART character reception or I2C address recognition). Stop2 mode implements a dedicated mechanism to keep the retention current as low as possible while allowing a very fast wakeup of 5 µs from SRAM or 8 µs from Flash memory.

So you can wake up the chip with UART, if you use API mode you have the packet delimiter, if you use AT mode you can send your own delimiter.