XMC4700 Relax Kit with DAVE: Moving to a different Build System (e.g. SCons)

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
GoKl_4594211
Employee
Employee
For prototyping we presently use the XMC4700 Relax Kit and DAVE4. Due to the requirements of our project we want to switch from DAVE to a different build system, e.g. SCons. That system should run under different OSs, at least MS Windows 7 and 10 (32 bit and 62 bit) and Linux. As for a compiler, I use GCC V 4.9.

Is there any support available from Infineon for such a transition? Ideally, some generic "how-to" would be helpful, or a MAKE project, which we could adapt to our environment manually.

Our objective is to use a build system which can be used independently from IDEs, although MAKE could be part of such a build system. Probably because of missing build options and missing includes, we didn't succeed in porting MAKE files generated by DAVE to SCons.

I reckon, that we are not the only users of Infineon microcontrollers, who wants to switch from DAVE to such another build system.
0 Likes
3 Replies
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
Hi, I believe there should be a way to trigger the GCC compilier via the DOS prompt or creating a make file for this purposes. But I have no idea how to go about it. I can check on this for you but no promises. Maybe you can find your answer from the GCC.
0 Likes
Not applicable
Hi Travis,

The question originally was submitted by me to Infineon Support. The guys form Infineon Support are quite good and fast. Thumbs up for them.

Back to the question: In the meantime I figured out the different options and was finally able to compile&link and also debug on my linux machine using SCONS.

Getting the appropriate Options used by DAVE is not the hardest task. I'll copy them here:
#Assemble String
"C:\DAVEv4\DAVE-4.1.4\eclipse\ARM-GCC-49/bin/arm-none-eabi-gcc" -x assembler-with-cpp -DXMC4700_F144x2048 -I"C:\Workspaces\DAVE-4.1\WS_2015_10_30\SerialComm\Libraries\XMCLib\inc" -I"C:\Workspaces\DAVE-4.1\WS_2015_10_30\SerialComm" -I"C:\Workspaces\DAVE-4.1\WS_2015_10_30\SerialComm\Dave\Generated" -Wall -Wa,-adhlns="$@.lst" -mfloat-abi=softfp -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d) $@" -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mthumb -g -gdwarf-2 -o "$@" "$<"

#Compile String:
"C:\DAVEv4\DAVE-4.1.4\eclipse\ARM-GCC-49/bin/arm-none-eabi-gcc" -DXMC4700_F144x2048 -I"C:\Workspaces\DAVE-4.1\WS_2015_10_30\SerialComm\Libraries\XMCLib\inc" -I"C:\Workspaces\DAVE-4.1\WS_2015_10_30\SerialComm/Libraries/CMSIS/Include" -I"C:\Workspaces\DAVE-4.1\WS_2015_10_30\SerialComm/Libraries/CMSIS/Infineon/XMC4700_series/Include" -I"C:\Workspaces\DAVE-4.1\WS_2015_10_30\SerialComm" -I"C:\Workspaces\DAVE-4.1\WS_2015_10_30\SerialComm\Dave\Generated" -I"C:\Workspaces\DAVE-4.1\WS_2015_10_30\SerialComm\Libraries" -O0 -ffunction-sections -fdata-sections -Wall -std=gnu99 -mfloat-abi=softfp -Wa,-adhlns="$@.lst" -pipe -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d) $@" -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mthumb -g -gdwarf-2 -o "$@" "$<"

#Link String
"C:\DAVEv4\DAVE-4.1.4\eclipse\ARM-GCC-49/bin/arm-none-eabi-gcc" -T"../linker_script.ld" -nostartfiles -Xlinker --gc-sections -specs=nano.specs -Wl,-Map,$(MAP_FILE) -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -mcpu=cortex-m4 -mthumb -g -gdwarf-2 -o "SerialComm.elf" "@objects.rsp" $(USER_OBJS) $(LIBS)

and from that the include structure also is quite obvious.

Two aspects made it a little more difficult:

  • First of all, it seems some header include statements do not comply with C, but on windows that does not matter: In file clock_xmc4.h, DAVE_common.h is included, but actually the file is DAVE_Common.h
  • Second, the build depends on GCC ARM 4.9, not any newer ones. Trying to build with newer versions of GCC ARM lead to strange errors (will not investigate that for now)


For now my SConstript-File looks like following:

import os

path = ['/bin', '/usr/bin', '/usr/local/gcc-arm-none-eabi-4_9-2015q3/bin']
proj_name = "SerialComm2"

env = Environment(ENV = {'PATH' : path})

def elf2hex(source, target, env, for_signature):
return '$OBJCOPY -O ihex %s %s'%(source[0], target[0])

def elf2lst(source, target, env, for_signature):
return '$OBJDUMP -h -S %s > %s'%(source[0], target[0])

def elf2siz(source, target, env, for_signature):
return '$SIZE --format=berkeley %s'%(source[0])

env.Append(BUILDERS = {
'Objcopy': Builder(
generator=elf2hex,
suffix='.hex',
src_suffix='.elf'
)
})

env.Append(BUILDERS = {
'Objdump': Builder(
generator=elf2lst,
suffix='.lst',
src_suffix='.elf'
)
})

env.Append(BUILDERS = {
'Size': Builder(
generator=elf2siz,
suffix='.siz',
src_suffix='.elf'
)
})


env['AR'] = 'arm-none-eabi-ar'
env['AS'] = 'arm-none-eabi-as'
env['CC'] = 'arm-none-eabi-gcc'
env['CXX'] = 'arm-none-eabi-g++'
env['LINK'] = 'arm-none-eabi-g++' # predefined is 'arm-none-eabi-gcc'
env['RANLIB'] = 'arm-none-eabi-ranlib'
env['OBJCOPY'] = 'arm-none-eabi-objcopy'
env['OBJDUMP'] = 'arm-none-eabi-objdump'
env['SIZE'] = 'arm-none-eabi-size'
env['PROGSUFFIX'] = '.elf'

env['CPPPATH'] = [ ... LIST OF INCLUDE PATHS ... ]
env.Append(ASFLAGS = [
'-DXMC4700_F144x2048',
'-Wall',
'-mfloat-abi=softfp',
'-c',
'-fmessage-length=0',
'-mcpu=cortex-m4',
'-mfpu=fpv4-sp-d16',
'-mthumb',
'-g',
'-gdwarf-2'
])
env.Append(CCFLAGS = [
'-O0',
'-ffunction-sections',
'-fdata-sections',
'-Wall',
'-std=gnu99',
'-mfloat-abi=softfp',
'-pipe',
'-c',
'-fmessage-length=0',
'-mcpu=cortex-m4',
'-mfpu=fpv4-sp-d16',
'-mthumb',
'-g',
'-gdwarf-2'
])
env.Append(LINKFLAGS = [
'-T"../linker_script.ld"',
'-nostartfiles',
'-Xlinker',
'--gc-sections',
'-specs=nano.specs',
'-Wl,-Map,'+proj_name+'.map',
'-mfloat-abi=softfp',
'-mfpu=fpv4-sp-d16',
'-mcpu=cortex-m4',
'-mthumb',
'-g',
'-gdwarf-2'
])
env.Append(CPPDEFINES = [
'XMC4700_F144x2048',
])

objects = env.Object(sources)
elfprg = env.Program(objects)
env.Objcopy(elfprg)
env.Objdump(elfprg)
env.Size(elfprg)



Comments or improvements are highly welcome.

BR /Stefan
0 Likes
Not applicable
Hello,

Thanks to werner_d from Infineon Support to post this query here. The initial question was mine and I already have sorted out part of the answer myself. These are the commands used by DAVE make:

#Assemble String
"C:\DAVEv4\DAVE-4.1.4\eclipse\ARM-GCC-49/bin/arm-none-eabi-gcc" -x assembler-with-cpp -DXMC4700_F144x2048 -I"C:\Workspaces\DAVE-4.1\WS_2015_10_30\SerialComm\Libraries\XMCLib\inc" -I"C:\Workspaces\DAVE-4.1\WS_2015_10_30\SerialComm" -I"C:\Workspaces\DAVE-4.1\WS_2015_10_30\SerialComm\Dave\Generated" -Wall -Wa,-adhlns="$@.lst" -mfloat-abi=softfp -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d) $@" -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mthumb -g -gdwarf-2 -o "$@" "$<"

#Compile String:
"C:\DAVEv4\DAVE-4.1.4\eclipse\ARM-GCC-49/bin/arm-none-eabi-gcc" -DXMC4700_F144x2048 -I"C:\Workspaces\DAVE-4.1\WS_2015_10_30\SerialComm\Libraries\XMCLib\inc" -I"C:\Workspaces\DAVE-4.1\WS_2015_10_30\SerialComm/Libraries/CMSIS/Include" -I"C:\Workspaces\DAVE-4.1\WS_2015_10_30\SerialComm/Libraries/CMSIS/Infineon/XMC4700_series/Include" -I"C:\Workspaces\DAVE-4.1\WS_2015_10_30\SerialComm" -I"C:\Workspaces\DAVE-4.1\WS_2015_10_30\SerialComm\Dave\Generated" -I"C:\Workspaces\DAVE-4.1\WS_2015_10_30\SerialComm\Libraries" -O0 -ffunction-sections -fdata-sections -Wall -std=gnu99 -mfloat-abi=softfp -Wa,-adhlns="$@.lst" -pipe -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d) $@" -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mthumb -g -gdwarf-2 -o "$@" "$<"

#Link String
"C:\DAVEv4\DAVE-4.1.4\eclipse\ARM-GCC-49/bin/arm-none-eabi-gcc" -T"../linker_script.ld" -nostartfiles -Xlinker --gc-sections -specs=nano.specs -Wl,-Map,$(MAP_FILE) -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -mcpu=cortex-m4 -mthumb -g -gdwarf-2 -o "SerialComm.elf" "@objects.rsp" $(USER_OBJS) $(LIBS)


As mentioned in the first post by werner_d, I had some problems when just using these commands with my linux version of arm-none-eabi-gcc. First of all, it seems to be crucial to use the 4.9 version of Gcc and not a newer one. I tried
5.2 and it complained about missing modules. Second, as DAVE is just for windows, some developers seem to also do not bother about writing bad C when not caring about case sensitivity.

For the ones interested, I can also post the current state of my SConstruct file.


Currently I am going one step further: It seems the project platformIO already has quite good build systems for a wide range of different hardware platforms, also some cortex-m4 based ones. I will try to fully integrateInfineon XMC platform - starting with my XMC4700 - to this project. For more information about the project, see http://platformio.org/

If some Infineon Employes are also reading: Support would be appreciated. I think if Infineon wants to be in the IoT movement, it also needs to contribute to such "hobbyist" projects that currently drive the IoT.

Regards, Stefan
0 Likes