debug Cortex-M4F floatpoint

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

debug Cortex-M4F floatpoint

Jump to solution
6,632 Views
q7Nhaj
Contributor II

I experienced the following failed assertion when debugging Cortex-M4F code using floating point.

GCC-4-8-build/src/gdb/gdb/regcache.c:178: internal-error:
register_size: Assertion `regnum >= 0 && regnum <
(gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch))' failed.

 

All routine that pass a floating point value to the routine will failed when I set a breakpoint inside the routine. GDB crashes as soon as the break is encountered.

 

Kinetis Design Studio Version: 3.1.0
Eclipse Version: Luna SR2 (4.4.2)

145989_145989.pngpastedImage_4.png

Labels (1)
1 Solution
5,514 Views
DavidS
NXP Employee
NXP Employee

Hi Dan,

I heard back from PEMicro and fix should be next week.  Exact wording:

We will post a new release of our GDB server mid-next week to our update site which has this fix.  

Regards,

David 

View solution in original post

0 Kudos
Reply
24 Replies
419 Views
q7Nhaj
Contributor II

This is the compiler setting that I'm using,

Jim

7:29:35 **** Incremental Build of configuration Debug for project TEST****

make -j8 all

Building file: ../Source/main/TEST.c

Invoking: Cross ARM C Compiler

arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mthumb-interwork -mfloat-abi=hard

-mfpu=fpv4-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections

-fdata-sections -fsingle-precision-constant -Wunused -Wuninitialized

-Wmissing-declarations -Wlogical-op -Waggregate-return  -g3 -nostdinc

-D_AEABI_LC_CTYPE=C -D__STRICT_ANSI__=1 -D_DEBUG=1

-std=gnu11 -Wmissing-prototypes -Wstrict-prototypes

-fno-strict-aliasing -fms-extensions -finline-functions

-MMD -MP -MF"Source/main/BlackBox.d" -MT"Source/main/BlackBox.o"

-c -o "Source/main/TEST.o" "../Source/main/TEST.c"

Finished building: ../Source/main/TEST.c

Building target: MYCODE.elf

Invoking: Cross ARM C Linker

arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mthumb-interwork

-mfloat-abi=hard -mfpu=fpv4-sp-d16 -Og -fmessage-length=0

-fsigned-char -ffunction-sections -fdata-sections

-fsingle-precision-constant -Wunused -Wuninitialized

-Wmissing-declarations -Wlogical-op -Waggregate-return 

-g3 -T

-nostartfiles -nodefaultlibs -Xlinker --gc-sections

-Wl,-Map,"BlackBox.map" --specs=nano.specs -u _printf_float

-u _scanf_float -Xlinker -static  -Xlinker -z -Xlinker muldefs

-o "BlackBox.elf" -Xlinker --start-group 

-Xlinker --end-group

Finished building target: MYCODE.elf

0 Kudos
Reply
419 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

@Hello JIM,

I create one KSDK+PE project about k22 , print the float data to terminal of PC,

it can work well . About the project please see the attachment .

pastedImage_0.png

We need define the "PRINTF_FLOAT_ENABLE" macro at the properties:

pastedImage_1.png

Hope it hleps

Alice

0 Kudos
Reply
419 Views
q7Nhaj
Contributor II

I download Version v3.2.0 and get the same error.

The debugger will crash by setting a breakpoint in a subroutine that has a float value pass to the routine on the stack.

When the break is encountered the debugger crashes with "GCC-4-8-build/src/gdb/gdb/regcache.c:178: internal-error:
register_size: Assertion `regnum >= 0 && regnum < (gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch))' failed."
in the console window. I was using CodeWarrior 10.3 and the same code work fine for me.

Also the register viewing window in KDS dose not show any of the FPU register.

Jim

0 Kudos
Reply
419 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello JIM,

Please update the KDS to  KDS v3.2.0 to have a try , about the update steps, please refer to :

New Kinetis Design Studio v3.2.0 available

If still have this error , could you please tell me step by step how to reproduce this error .

Hope it hleps

Alice

0 Kudos
Reply