Author Topic: KDS Compile Error  (Read 5731 times)

Offline Lum_Ji

  • Newbie
  • *
  • Posts: 2
    • View Profile
KDS Compile Error
« on: November 07, 2017, 07:01:27 AM »
Hello,

I am using the FRDMKL82Z board with KDS 3.2.

I am having trouble getting KDS to compile the TaskerSerialLoader.  I followed the instructions on https://www.youtube.com/watch?v=K8ScSgpgQ6M&feature=youtu.be ,configured the linker etc. and when I tried to build the SerialLoader it got to mmcau and started saying "selected processor does not support Thumb mode".  I have tried to switch to marm but it says something similar.

Thanks

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: KDS Compile Error
« Reply #1 on: November 07, 2017, 09:43:24 AM »
Hi

There are two files:
mmcau_aes_functions_M0.S and mmcau_aes_functions.S
The first is used for Cortex-M0+ cores and the second for Cortex-M4.

KDS will try to build both and one will fail on one. Therefore you can exclude the one that you don't want (select the file in the KDS Project Explorer, right mouse click to get the context menu - choose "Resource Configuration", then "Exclude from build" and choose the target(s) that it should be excluded from.

In fact, since the serial loader doesn't use the Crypto directory, this directory could also be generally excluded.

There is no problem when building from the GCC make file since such details can be controlled but with KDS the control is more limited and I haven't found a way of automatically controlling included files based on the core selected so a little manual config may be needed for a specific target.

Regards

Mark

P.S. I may look at merging the code in the two assembler files into one and then using defines (as is done in the file arm_bitreversal2.S) to conditionally compile the correct assembler code for the core involved in order to solve this complication.



Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: KDS Compile Error
« Reply #2 on: November 07, 2017, 01:39:16 PM »
To follow up on this.

I removed the file mmcau_aes_functions_M0.S from the project and combined its content into mmcau_aes_functions.S.

The defined ARM_MATH_CM0PLUS controls whether the content is for Cortex-M0+ or Cortex-M4 and is automated on C-files. In the GCC make file it is also automated on assembler files.

In KDS (and Eclipse) it means that the pre-processor define needs to be set on assembly files when building for Cortex-M0+. This means that files don't need to be excluded but instead the files' properties instead. It may not be a huge simplification but is maybe cleaner overall. If it is possible to find a method of getting KDS to set the pre-processor assembly define "ARM_MATH_CM0PLUS" automaticalyl when Cortex-M0+ target is chosen it would still be best.

This is the check-in comment 07/11/2017 13:31:54

"Added reset cause on start-up.
Removed mmcau_aes_functions_M0.S (combined in mmcau_aes_functions.S)
Note that KDS (Eclipse) users need to add ARM_MATH_CM0PLUS to assembly file pre-processor defines when building for Cortex-m0+ processors; use GCC make file for full automation."

Regards

Mark

Offline Lum_Ji

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: KDS Compile Error
« Reply #3 on: November 07, 2017, 04:23:03 PM »
Thanks Mark.  That worked.  I'm sorry to bother you with a follow-up - when I attempted to build the uTasker application itself I get a similar error:

Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m0plus -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -Os -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall  -g -D_KINETIS -D_KDS -D_GNU -I"C:/Users/lum/Desktop/uTasker-GIT-Kinetis/Applications/uTaskerV1.4" -std=c99 -MMD -MP -MF"uTasker/Driver.d" -MT"uTasker/Driver.o" -c -o "uTasker/Driver.o" "../uTasker/Driver.c"
../uTasker/Driver.c: In function 'fnAllocateBuffer':
../uTasker/Driver.c:120:1: sorry, unimplemented: Thumb-1 hard-float VFP ABI
 {
 ^
uTasker/subdir.mk:66: recipe for target 'uTasker/Driver.o' failed
make: *** [uTasker/Driver.o] Error 1

I've made sure that I have the linker file set up and the indexer properly configured.

Thanks

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3234
    • View Profile
    • uTasker
Re: KDS Compile Error
« Reply #4 on: November 07, 2017, 09:51:11 PM »
Hi Lum

This is one of KDS's little nuisances.

The error is a mismatch between a setting for HW FPU and a chip that doesn't have one.
This can be caused by a KDS issue when changing from Cortex-M4 to Cortex-M0+ - if HW FPU was enabled before it keeps it on (and greys it out so that it can't be changed). Therefore - in KDS - set Cortex-M4 target again (it will allow the FPU setting to be modified again), disable HW floating point and set back to Cortex-M0+ and it will stick (and be correct).

Good luck

Regards

Mark