How to use old HAL library in CubeIDE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-21 6:56 AM
Hi, I have a problem using stm32f722 uC with HAL 1.16.0 and 1.16.1
I write a simple UART send project and test it with an oscilloscope (becouse it doesn't work with the target device) and discover that HAL_UART_Transmit is sending correct bytes while HAL_UART_Transmit_DMA is not. The last one corrupt a couple of byte.
So I want to check it's a bug on the library (trying old versions) or it's another problem with my implementation.
So, how could I choose an old HAL library (I have 1.15 installed) on STM32CubeIDE project generation?
Thank
- Labels:
-
DMA
-
STM32CubeIDE
-
STM32F7 Series
-
UART-USART
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-21 9:32 AM
In STM32CubeIDE its very simple. Open ioc and in software packs manager download any version in list. After downloaded in project manager select firmware version to use.
And for your trouble DMA is reported in latest MX bad order generated in code. Try change order in main MX_DMA_Init place up for example after GPIO.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-21 11:33 AM
WTF!!!!!! I didn't know about that problem with generated code!!!!! I spend so many hours on it!!!!!!
I've download the firmware in project manager, but I can't choose 1.15, the combobox list only 1.16.0 and 1.16.1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-21 12:18 PM
What is the project manager? Do you see the package installed in the package list within CubeMX?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-21 1:48 PM
On the IDE I go to File->New->STM32Project
Choose STM32F722RE CPU
Then write a name to the project and on the next screen I have to choose firmware package, but I have 1.16.0 and 1.16.1.
But when I go to Help->Manage Embedded software package I have checked 1.15.0, 1.16.0 and 1.16.1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-21 2:27 PM
It's not working.
It's so weird, I can use HAL_UART_Transmit_DMA on the main function, but as soon as I move it to another function (inside of the same main.c) it stop working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-21 2:43 PM
Ok, I found the problem. I can't use local variable (inside of a function) for transmit buffer. I have to declare it at file level, that way it is working ok.
Is it a bug or is it the correct way to work with DMA transfer?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-21 2:50 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-21 2:53 PM
aggg, what a noob am I !!! sorry, my mistake.
I'm communicating with a smart servo. I'm sending some command and expecting some answer. Could I call HAL_UART_Transmit_DMA and then HAL_UART_Receive_DMA? Or should I put HAL_UART_Receive_DMA on TxCpltCallBack?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-11-21 4:54 PM
So using a different HAL library is no longer a question. Good.
HAL_UART_Receive_DMA and HAL_UART_Transmit_DMA can run in parallel. If you start receive before transmit, you avoid the time window when the device starts sending its reply before RX is enabled. Try this.
Note, if your servos are RS-485 then use a different init call: HAL_RS485Ex_Init
