Nucleo-F767ZI shell unhandled exception Topic is solved

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
crispus
Posts: 24
Joined: Sat Aug 27, 2016 10:14 am
Has thanked: 4 times
Been thanked: 3 times

Nucleo-F767ZI shell unhandled exception

Post by crispus »

Hi,

Context:
- Nucleo-F767ZI board, the code is based on RT-STM32F767ZI-NUCLEO144
- OS: Ubuntu 16.04.01 LTS
- compiler: gcc version 4.9.3 20150529 (prerelease) (15:4.9.3+svn231177-1) - default package on OS
- Open On-Chip Debugger 0.10.0-dev-00371-g81631e4 (2016-08-24-00:32)

All seems to work fine, until I press enter on the shell. After that I get unhandled exception. It seems to start in parse_arguments when it hits str* functions. If I look in assembly, the code seems a little strange:

Code: Select all

          strspn:
00205a90:   stmia   r0!, {}
00205a92:   b.n     0x205636 <_strtol_r+406>
00205a94:   movs    r0, r0
00205a96:   b.n     0x206152
00205a98:   movs    r6, r2

same with strpbrk:

Code: Select all

          strpbrk:
00205a00:   stmia   r0!, {}
00205a02:   b.n     0x2055a6 <_strtol_r+262>
00205a04:   movs    r0, r0
00205a06:   b.n     0x2060c2
00205a08:   movs    r6, r3


The instruction

Code: Select all

stmia   r0!, {}
causes the unhandled exception.

Is this a compiler issue? ARM states that "There must be at least one register in the list".

Any thoughts?
Thanks
crispus
Posts: 24
Joined: Sat Aug 27, 2016 10:14 am
Has thanked: 4 times
Been thanked: 3 times

Re: Nucleo-F767ZI shell unhandled exception

Post by crispus »

I changed the compiler with gcc version 5.4.1 20160609 (release) [ARM/embedded-5-branch revision 237715] (latest I found on launchpad) and the problem is gone.
Still have a question: is it really from the compiler, or did I do something wrong?
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Nucleo-F767ZI shell unhandled exception

Post by Giovanni »

It is a compiler issue for sure.

I recommend using GCC compilers from this distro: https://launchpad.net/gcc-arm-embedded

Giovanni
crispus
Posts: 24
Joined: Sat Aug 27, 2016 10:14 am
Has thanked: 4 times
Been thanked: 3 times

Re: Nucleo-F767ZI shell unhandled exception

Post by crispus »

Thanks Giovanni for the confirmation.
Post Reply