Skip to content

cpu/arm: fixes necessary for toolchain upgrade#13456

Merged
kaspar030 merged 3 commits intoRIOT-OS:masterfrom
kaspar030:arm_gcc9_fixes
Feb 24, 2020
Merged

cpu/arm: fixes necessary for toolchain upgrade#13456
kaspar030 merged 3 commits intoRIOT-OS:masterfrom
kaspar030:arm_gcc9_fixes

Conversation

@kaspar030
Copy link
Copy Markdown
Contributor

@kaspar030 kaspar030 commented Feb 24, 2020

Contribution description

The ARM toolchain upgrade (RIOT-OS/riotdocker#78) slipped through some new compiler warnings (which turn into errors now).

This PR tries to fix them.

Testing procedure

Issues/PRs references

Fixes #13434.

@kaspar030 kaspar030 added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Platform: ARM Platform: This PR/issue effects ARM-based platforms Area: build system Area: Build system labels Feb 24, 2020
@kaspar030 kaspar030 requested a review from jia200x as a code owner February 24, 2020 13:21
@kaspar030
Copy link
Copy Markdown
Contributor Author

I whish there was a "high priority" option in Murdock...

*/
#define CALIB_T_P_BASE (BMX280_DIG_T1_LSB_REG)
#define CALIB_T_P_LEN (17U)
#define CALIB_T_P_LEN (32U) /* might be larger than neeeded */
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

previous value was "17". The highest accessed index that popped up int the warning was "23". I chose 32 as the next highest power of two, on stack it would probably have chosen "24".

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 8-bit registers are named calib00...calib41 and are stored at memory addresses 0x88...0xA1 and 0xE1...0xE7.

so 26 should do

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm correct this should be 0x17 or 0d22. But we can change that in a follow-up with some more thorough testing. 32U should definitely be enough.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading the data sheets, it should be 26 24 (last byte is reserved) for both bmp280 and bme280

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since those are turned into register reads, I'd rather not read additional random registers without knowing if there might be some effect on-read.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, let's merge as is then I open a PR for the correct value?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use the right value right away?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use the right value right away?

Because it will block all PRs for another 20 minutes :|

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, let's merge as is then I open a PR for the correct value?

Yes please!

@kaspar030
Copy link
Copy Markdown
Contributor Author

@RIOT-OS/ci @RIOT-OS/maintainers pls ACK. :)

@benpicco
Copy link
Copy Markdown
Contributor

This will also fix #13434

@kaspar030
Copy link
Copy Markdown
Contributor Author

This will also fix #13434

There it is, didn't find the issue.

@kaspar030
Copy link
Copy Markdown
Contributor Author

There's still this:

/home/kaspar/src/riot/tests/unittests/tests-core/tests-core-atomic.c: In function 'test_atomic_inc_negative':
/home/kaspar/src/riot/tests/unittests/tests-core/tests-core-atomic.c:53:1: error: insn does not satisfy its constraints:
   53 | }                                                        
      | ^                                                        
(insn 145 144 146 4 (set (reg:SI 3 r3 [139])          
        (plus:SI (reg:SI 12 ip [orig:110 _1 ] [110])
            (const_int 1 [0x1]))) "/home/kaspar/src/riot/tests/unittests/tests-core/tests-core-atomic.c":50:9 811 {*thumb1_addsi3}
     (nil))                                                      
during RTL pass: cprop_hardreg                                   
/home/kaspar/src/riot/tests/unittests/tests-core/tests-core-atomic.c:53:1: internal compiler error: in extract_constrain_insn, at r
ecog.c:2211                                                      
Please submit a full bug report,        
with preprocessed source if appropriate.
See <https://bugs.archlinux.org/> for instructions.
make[2]: *** [/home/kaspar/src/riot/Makefile.base:110: /home/kaspar/src/riot/tests/unittests/bin/saml11-xpro/tests-core/tests-core-
atomic.o] Error 1                                                                                                                  

... when compiling the unittests for saml11-xpro...

I propose blacklisting until we have a fix.

@kaspar030 kaspar030 requested a review from miri64 as a code owner February 24, 2020 13:54
include ../Makefile.tests_common

# temporarily disable building, see #13456.
BOARD_BLACKLIST := saml11-xpro
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
BOARD_BLACKLIST := saml11-xpro
BOARD_BLACKLIST := saml10-xpro saml11-xpro

include ../Makefile.tests_common

# temporarily disable building, see #13456.
BOARD_BLACKLIST := saml11-xpro
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or better yet

Suggested change
BOARD_BLACKLIST := saml11-xpro
FEATURES_BLACKLIST += cortex-m23

@kaspar030
Copy link
Copy Markdown
Contributor Author

cortex-m23

not exposed as arch feature :(

@kaspar030
Copy link
Copy Markdown
Contributor Author

/home/kaspar/src/riot/tests/unittests/tests-core/tests-core-atomic.c:53:1: internal compiler error: in extract_constrain_insn, at recog.c:2211

Sometimes I wonder, if RIOT's cute little compile test exposes something like this, what's gcc's or ARM's CI compiling?

@kaspar030 kaspar030 merged commit c11e8df into RIOT-OS:master Feb 24, 2020
@kaspar030 kaspar030 deleted the arm_gcc9_fixes branch February 24, 2020 14:18
@kaspar030
Copy link
Copy Markdown
Contributor Author

Thanks everyone!

dylad added a commit to dylad/RIOT that referenced this pull request Feb 25, 2020
dylad added a commit to dylad/RIOT that referenced this pull request Feb 25, 2020
dylad added a commit to dylad/RIOT that referenced this pull request Feb 26, 2020
@benpicco benpicco added the Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch label Feb 28, 2020
@benpicco
Copy link
Copy Markdown
Contributor

Looks like this also needs a backport, otherwise other packports are failing CI.

@fjmolinas
Copy link
Copy Markdown
Contributor

Looks like this also needs a backport, otherwise other backports are failing CI.

@kaspar030 @benpicco are there other toolchain changes since the last release? I do not like the fact that whatever we are backporting will be tested with a different toolchain.

@fjmolinas
Copy link
Copy Markdown
Contributor

Backport provided in #13536

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: build system Area: Build system CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: ARM Platform: This PR/issue effects ARM-based platforms Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

drivers/bmx280: CI should fail, but apparently doesn't?

5 participants