2017-06-08 01:58 AM
2017-06-11 01:53 AM
Hi there,
further investigation pointed towards a strange behaviour:
the aforementioned code is working great if it's compiled with -O0, 1, 2, 3, g, s but HAL_UART_RECEIVE_DMA fails to set the uart peripheral in UART_STATE_BUSY_RX when the gcc optimisation is settled to -Of, hence the issue i have enlightened in the previous post.
It that a known behaivour of Hal_Uart, there's a solution the this issue?
ty!
Davide
2017-06-11 04:24 AM
Issues related to variables modified in interrupts and having different behaviour upon aggressive optimization tend to be related to insufficient use of the volatile qualifier.
I don't Cube.
JW
2017-06-11 01:11 PM
Thanks waclawek.jan,
unfortunately also i have always used SPL, but this project requires HAL: a good opportunity to know better these drivers but also an effort to adapt to a very different point of view.
It's a pity that this simple thing isn't working out of the box with any optimisation, after all i've written the code in a very naive way: only hal irq handlers are used inside the isr services, as also done by mx cube.
Davide
ps: any further info is well accepted, also if there is a way to point out this issue to the hal drivers team i'll be happy to contribute!
2017-10-18 11:18 PM
Your Rx DMA seems to use Channel3 without interrupt enable call and int handler.
Jari