Just as the title says.
You can see the STM32F4's CPU registers and the disassembly just before the exception, and after it.
The vpush instruction attempts to move the FPU registers (s16 - s31) to the stack, but the next instruction branches over to the unhanded exception handler instead.
For some reason, R7 contains something at this point. Does anyone know what could cause this to happen?
next...
The only things I had to define in the IDE were the following linker symbols..
__main_stack_size__=__STACK_SIZE
__process_stack_size__=__STACK_SIZE
Compilation, linking all goes well. Stack size is set to 0x0400.
Any other run-time clues I can use to figure out what is going on?
Unhandled exception after vpush instruction
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Unhandled exception after vpush instruction
Hi,
Probably the FPU is not enabled (compiler options), so the first float instruction triggers the exception.
Giovanni
Probably the FPU is not enabled (compiler options), so the first float instruction triggers the exception.
Giovanni
Re: Unhandled exception after vpush instruction
Hi Giovanni,
I have the following compiler definitions enabled:
__FPU_ENABLED
__FPU_USED
Assembler Flags:
-x assembler-with-cpp
-DCORTEX_USE_FPU=TRUE
Other flags:
ARM_MATH_CM4
STM32F407VG
STM32F4XX
all appear to be defined in ChibiOS itself, and adding them to the compiler flags raises redundancy errors.
Are there any other flags I should be raising?
I have the following compiler definitions enabled:
__FPU_ENABLED
__FPU_USED
Assembler Flags:
-x assembler-with-cpp
-DCORTEX_USE_FPU=TRUE
Other flags:
ARM_MATH_CM4
STM32F407VG
STM32F4XX
all appear to be defined in ChibiOS itself, and adding them to the compiler flags raises redundancy errors.
Are there any other flags I should be raising?
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Unhandled exception after vpush instruction
See in crt0_v7m.S if the FPU initialization is really executed.
Giovanni
Giovanni
Re: Unhandled exception after vpush instruction
It was not.
I was missing the 'CORTEX_USE_FPU' flag. I didn't think I would've needed to add it since '__FPU_USED' is defined.
Does ChibiStudio define CORTEX_USE_FPU by default?
I don't understand the difference between these flags. FPU_USED is an ARM specific flag, but CORTEX_USE_FPU seems to be a ChibiOS thing. Why use both of these?
I was missing the 'CORTEX_USE_FPU' flag. I didn't think I would've needed to add it since '__FPU_USED' is defined.
Does ChibiStudio define CORTEX_USE_FPU by default?
I don't understand the difference between these flags. FPU_USED is an ARM specific flag, but CORTEX_USE_FPU seems to be a ChibiOS thing. Why use both of these?
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Unhandled exception after vpush instruction
Hi,
ChibiOS uses its own macros that are not dependent on specific compilers, __FPU_USED is not used anywhere in ChibiOS.
Giovanni
ChibiOS uses its own macros that are not dependent on specific compilers, __FPU_USED is not used anywhere in ChibiOS.
Giovanni
Who is online
Users browsing this forum: No registered users and 11 guests