[XMEGA] serial driver build failure

ChibiOS public support forum for topics related to the Atmel AVR family of micro-controllers.

Moderators: utzig, tfAteba

Sergio
Posts: 4
Joined: Tue Jan 22, 2019 3:26 pm

[XMEGA] serial driver build failure

Postby Sergio » Wed Oct 06, 2021 4:37 pm

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]

utzig
Posts: 358
Joined: Sat Jan 07, 2012 6:22 pm
Location: Brazil
Has thanked: 1 time
Been thanked: 19 times
Contact:

Re: [XMEGA] serial driver build failure

Postby utzig » Wed Oct 06, 2021 5:06 pm

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))
    ;

Sergio
Posts: 4
Joined: Tue Jan 22, 2019 3:26 pm

Re: [XMEGA] serial driver build failure

Postby Sergio » Wed Oct 06, 2021 6:05 pm

Well , I think it is more than just compiler requirement. I think set_error should be executed if condition succeed

utzig
Posts: 358
Joined: Sat Jan 07, 2012 6:22 pm
Location: Brazil
Has thanked: 1 time
Been thanked: 19 times
Contact:

Re: [XMEGA] serial driver build failure

Postby utzig » Wed Oct 06, 2021 6:22 pm

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.

User avatar
tfAteba
Posts: 535
Joined: Fri Oct 16, 2015 11:03 pm
Location: Chartres, France
Has thanked: 83 times
Been thanked: 47 times

Re: [XMEGA] serial driver build failure

Postby tfAteba » Thu Oct 07, 2021 9:17 am

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.
regards,

Theo.

Sergio
Posts: 4
Joined: Tue Jan 22, 2019 3:26 pm

Re: [XMEGA] serial driver build failure

Postby Sergio » Mon Oct 11, 2021 2:40 pm

Oh, patch submit procedure is rather complex (in comparison with github process). Is there any plan to switch to more modern hosting?

User avatar
tfAteba
Posts: 535
Joined: Fri Oct 16, 2015 11:03 pm
Location: Chartres, France
Has thanked: 83 times
Been thanked: 47 times

Re: [XMEGA] serial driver build failure

Postby tfAteba » Tue Oct 12, 2021 10:42 pm

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!
regards,

Theo.


Return to “AVR Support”

Who is online

Users browsing this forum: No registered users and 3 guests