Page 1 of 1

[XMEGA] serial driver build failure

Posted: Wed Oct 06, 2021 4:37 pm
by Sergio
Hi!

I've got a warning and build failure (if -Werror is used) for XMEGA hal_serial_lld.c. I think this is obvious semicolon misting bug, error should be propagated if specified flag are set:

OSAL_IRQ_HANDLER(USARTC0_RXC_vect) {
...
if (status & (USART_FERR_bm | USART_PERR_bm | USART_BUFOVF_bm));
set_error(&SD1, status);
...
}
ChibiOS/os/hal/ports/AVR/XMEGA/LLD/USARTv1/hal_serial_lld.c:432:3: warning: this 'if' clause does not guard... [-Wmisleading-indentation]

Re: [XMEGA] serial driver build failure

Posted: Wed Oct 06, 2021 5:06 pm
by utzig
I think this is an issue with very recent gcc releases, you can fix it by identing the ";" like this:

Code: Select all

if (status & (USART_FERR_bm | USART_PERR_bm | USART_BUFOVF_bm))
    ;

Re: [XMEGA] serial driver build failure

Posted: Wed Oct 06, 2021 6:05 pm
by Sergio
Well , I think it is more than just compiler requirement. I think set_error should be executed if condition succeed

Re: [XMEGA] serial driver build failure

Posted: Wed Oct 06, 2021 6:22 pm
by utzig
Sergio wrote:Well , I think it is more than just compiler requirement. I think set_error should be executed if condition succeed

Oh, you're right, the "set_error" should probably be inside the "if" block. I would suggest sending a patch.

Re: [XMEGA] serial driver build failure

Posted: Thu Oct 07, 2021 9:17 am
by tfAteba
Hello Sergio, Utzig,

Thanks for finding this bug.

Yes if you can send a patch to fix the problem I will be happy to apply it.

Note that This driver is still in development and It nice to see that other people are interested on this architecture.

Re: [XMEGA] serial driver build failure

Posted: Mon Oct 11, 2021 2:40 pm
by Sergio
Oh, patch submit procedure is rather complex (in comparison with github process). Is there any plan to switch to more modern hosting?

Re: [XMEGA] serial driver build failure

Posted: Tue Oct 12, 2021 10:42 pm
by tfAteba
Hello,

I Hope that some day ChobiOS will move to more modern hosting tool like you said, but for the moment we have to follow the way define by Giovanni.

Si you Can generate a patch and just attach it here!