Problem with UART and LL drivers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-12-15 8:53 PM
Hello everyone, this is a problem regarding my DISCO-L072CZ-LRWAN kit which I am using for a project of mine.
I am using the LRWAN expansion kit for LoRa functionality while I am also trying to add up a UART as UART1 on Pin 9/10. While using this UART, I am trying to use the HAL drivers especially HAL_UART_Receive function which receives N number of character and has a timeout given by the user which I am giving as 0x00FF. Internally this function takes sysTick using Get_HAL_Tick() but as the LoRa function has initialized all LL drivers, the getting systick function from HAL does not work. Which means that there will be no timeout and I have to specify the number of characters to be received, which is bizarre.
I hope you understood my problem. Please try and help with solution or any other alternative.
If you have any solution for UART which solves this problem please reply.
#b-l072z-lrwan1 #b-l072z-lrwan1Solved! Go to Solution.
- Labels:
-
LoRa
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-12-16 8:39 AM
The LRWAN implementation uses the RTC over SysTick, but it is possible to implement/enable SysTick if you need/want to.
Unless you've got a bunch of experience I wouldn't try to mix HAL and LL stuff up to much. I would strongly recommend reading the Reference Manuals so you know how the underlying hardware works as this will provide a lot of clarity about what the software needs to do.
The LRWAN/VCOM implementation is a bit of a mess, there is a lot of blocking code compounded by the way the CM0+ NVIC works. I ended up reworking most of that code to use the status and data registers more directly, and providing some more effective FIFO buffering via the IRQ Handlers.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-12-15 10:18 PM
Either go to debug mode to figure out how to cascade the Systick interrupt to all functions needing them, or use a simple unused STM32 Timer to build a programmable timeout event that you use in your main loop to abort UART (ie: Make your own timeout).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-12-16 4:35 AM
SARTHAK KELAPURE wrote:
I am trying to use the HAL drivers especially HAL_UART_Receive function
But your thread title says LL Drivers - so which is it?
Do you actually need the timeout?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-12-16 8:39 AM
The LRWAN implementation uses the RTC over SysTick, but it is possible to implement/enable SysTick if you need/want to.
Unless you've got a bunch of experience I wouldn't try to mix HAL and LL stuff up to much. I would strongly recommend reading the Reference Manuals so you know how the underlying hardware works as this will provide a lot of clarity about what the software needs to do.
The LRWAN/VCOM implementation is a bit of a mess, there is a lot of blocking code compounded by the way the CM0+ NVIC works. I ended up reworking most of that code to use the status and data registers more directly, and providing some more effective FIFO buffering via the IRQ Handlers.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-12-18 10:45 PM
Well thank you. I ended up mixing the HAL and LL drivers and it works as of now. Even I am going to remake vcom.c again. Thank you.
