https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87373
Murat Ursavaş <murat.ursavas at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |---
--- Comment #28 from Murat Ursavaş <murat.ursavas at gmail dot com> ---
Hi,
I've created the time and added 7.3.1 to my toolchain list. (It is really
annoyingly hard to add a new toolchain in my configuration due to a bug in the
IDE).
Anyway right now I can compare 4.9.3 and 7.3.1 side by side and my application
is not working with the 7 series. That is exactly how it started at the
beginning.
I've cleared some issues that could interfere with this issue but now I can
reproduce the issue on my target.
I'm not sure this is due to packed structs or not but I've found a difference
which should not happen. Please bear with me on this.
Here's the disassembly of a problematic part:
4.9.3
121 NVM_SPI->ROUTE = USART_ROUTE_TXPEN | USART_ROUTE_RXPEN |
USART_ROUTE_CLKPEN | NVM_SPI_LOCATION;
00029e38: ldr r3,[pc,#0x4c] ; 0x29e84
00029e3a: ldr r2,[r3,#0x54]
00029e3c: movs r2,#0x0
00029e3e: orr r2,r2,#0xb
00029e42: str r2,[r3,#0x54]
7.3.1
121 NVM_SPI->ROUTE = USART_ROUTE_TXPEN | USART_ROUTE_RXPEN |
USART_ROUTE_CLKPEN | NVM_SPI_LOCATION;
0000572e: ldr r3,[pc,#0x70] ; 0x579c
00005730: ldrb.w r2,[r3,#0x54]
00005734: movs r2,#0x0
00005736: orr r2,r2,#0xb
0000573a: strb.w r2,[r3,#0x54]
0000573e: ldrb.w r2,[r3,#0x55]
00005742: movs r2,#0x0
00005744: strb.w r2,[r3,#0x55]
00005748: ldrb.w r2,[r3,#0x56]
0000574c: movs r2,#0x0
0000574e: strb.w r2,[r3,#0x56]
00005752: ldrb.w r2,[r3,#0x57]
00005756: movs r2,#0x0
00005758: strb.w r2,[r3,#0x57]
4.9.3 sets the ROUTE register as 0xB correctly. But 7.3.1 sets it as 0x30B. The
correct value is 0xB (calculated from the bit values). This maps the USART to
the wrong pins and makes the peripheral physically useless and also cripples
other pins.
Like I said, this may not be a bug, could be my error or vendor libraries but
something doesn't look right. Please let me know if you need further info. I
may need some guidance to collect more data.
P.S: I'm trying to improve GCC, otherwise I'm just fine with 4.9.3.