Page 1 of 1

Nucleo-F767ZI shell unhandled exception

Posted: Sat Aug 27, 2016 10:38 am
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

Re: Nucleo-F767ZI shell unhandled exception

Posted: Sat Aug 27, 2016 11:22 am
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?

Re: Nucleo-F767ZI shell unhandled exception

Posted: Sat Aug 27, 2016 12:06 pm
by Giovanni
It is a compiler issue for sure.

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

Giovanni

Re: Nucleo-F767ZI shell unhandled exception

Posted: Sat Aug 27, 2016 3:03 pm
by crispus
Thanks Giovanni for the confirmation.