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

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

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

Post by dflogeras »

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: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

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

Post by Giovanni »

Hi,

Both should be OK.

It was a misalignment caused by the linker.

Giovanni
steved
Posts: 834
Joined: Fri Nov 09, 2012 2:22 pm
Has thanked: 12 times
Been thanked: 138 times

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

Post by steved »

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: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

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

Post by Giovanni »

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: 232
Joined: Tue Sep 03, 2013 8:16 pm
Has thanked: 8 times
Been thanked: 22 times

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

Post by dflogeras »

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.
Post Reply