We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi there,
I was using Codewarrior targeting Cortex-R4 CPU to build Firmware. When doing a division coprocessor was used and caused exception.
Here is the division in C:
u8 i, j = 8;
i = j / 3;
Disassembly:
(u8 i, j = 8;)
mov r5, #0x8
(i = j / 3;)
mov r1, #0x3
mov r0, r5
mrc p6, 1, r0, c0, c1, 4
and r4, r0, #0xff
When running mrc, exception occurred.
Does anybody have any idea why it happens? Anyway to disable coprocessor in this operation?
Thanks.
Thanks to the helps from daith and Martin. It turns out the micro-kernel I'm using is built with hardware division enabled. That HW division instruction was carried to Cortex-R5 which supports SW division only. Everything turns ok after rebuilding the micro-kernel for Cortex-R5.