C++ exceptions in cortex-m7 vs. cortex-m4

Report here problems in any of ChibiOS components. This forum is NOT for support.
dflogeras
Posts: 183
Joined: Tue Sep 03, 2013 8:16 pm
Has thanked: 2 times
Been thanked: 12 times

Re: C++ exceptions in cortex-m7 vs. cortex-m4

Postby dflogeras » Sun Nov 10, 2019 12:50 pm

Hi Giovanni,

I'd be happy to test, it will be at least mid next week before I'll be near that hardware. Should I be testing off the trunk, or 19.x maintenance branch, or both?

Dave

User avatar
Giovanni
Site Admin
Posts: 12254
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 585 times
Been thanked: 500 times
Contact:

Re: C++ exceptions in cortex-m7 vs. cortex-m4

Postby Giovanni » Sun Nov 10, 2019 12:52 pm

Hi,

Both should be OK.

It was a misalignment caused by the linker.

Giovanni

steved
Posts: 625
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 5 times
Been thanked: 87 times

Re: C++ exceptions in cortex-m7 vs. cortex-m4

Postby steved » Sun Nov 10, 2019 6:02 pm

Be aware that if using 19.1.x, you need to use the latest from trunk; the bug is present in the 19.1.3 distribution zip file

(Problem is in ChibiOS_19.1.3.7z\ChibiOS_19.1.3\os\common\startup\ARMCMx\compilers\GCC\ld\rules_code.ld line 38; needs to say:

Code: Select all

    .text : ALIGN_WITH_INPUT
)

User avatar
Giovanni
Site Admin
Posts: 12254
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 585 times
Been thanked: 500 times
Contact:

Re: C++ exceptions in cortex-m7 vs. cortex-m4

Postby Giovanni » Sun Nov 10, 2019 6:05 pm

Ah right, it is not yet released in 19.1.x... please try trunk. I hope to release a 19.1.4 next week.

Giovanni

dflogeras
Posts: 183
Joined: Tue Sep 03, 2013 8:16 pm
Has thanked: 2 times
Been thanked: 12 times

Re: C++ exceptions in cortex-m7 vs. cortex-m4

Postby dflogeras » Tue Nov 12, 2019 9:11 pm

Unfortunately, those changes do not seem to fix my original issue.

I tried both trunk (r13183), as well as stable_19.1.x branch (r13176) from SVN. I verified both had the line steved mentioned in the corresponding rules_code.ld.

I tried with both gcc-arm-none-eabi-7-2017-q4-major and gcc-arm-none-eabi-9-2019-q4-major compilers.

As before, I can hide the problem by moving the VARIOUS_FLASH section from flash1 (ITCM flash) to flash0 (AXIM). Something about when the stack unwinding functions are in ITCM flash, it does not work properly.

I went a little further, and left the VARIOUS section in flash1, but altered the just the .ARM.extab and .ARM.exidx sections (in rules_code.ld) to go into RODATA instead of VARIOUS, and this also works around the problem. I didn't move eh_frame_hdr/eh_frame from VARIOUS but that may not be correct.

Again, I don't fully understand what I'm doing, just reporting what I see changing the outcome.


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 2 guests