You are viewing an older revision! See the latest version

Exporting to CodeSourcery

Currently only available in betamode!

This functionality only works with the betamode compiler and the beta version of the libraries.

To use these examples, ensure you have enabled /betamode for the compiler, and then import the beta libraries: http://mbed.org/projects/libraries-testing/svn/m0-beta

CodeSourcery is one of the external offline toolchains supported by the mbed platform.

For a complete overview of the "export" feature, please refer to our general: Exporting to offline toolchains.

To export your mbed program for use in CodeSourcery, right-click the program in your program workspace. From the dialog, you can select the "Export To" as "GCC (Code Sourcery)", and the target microcontroller you wish to export for.

/media/uploads/emilmont/codesourcery_1.png

When you choose export, a zip file containing all the files you need for CodeSourcery will be generated. Unzip it and you are ready to launch make:

CodeSourcery

~/my_program$ ls
m0-beta  m0-beta.lib  main.cpp  Makefile
~/my_program$ make
arm-none-eabi-g++ -c -Os -fno-common -fmessage-length=0 -Wall -fno-exceptions -mcpu=cortex-m3 -mthumb -ffunction-sections -fdata-sections
   -DTARGET_LPC1768 -DTOOLCHAIN_GCC_CS -DNDEBUG -std=gnu++98 -I./m0-beta -I./m0-beta/LPC1768 -I./m0-beta/LPC1768/GCC_CS  -o main.o main.cpp
arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Wl,--gc-sections -Tm0-beta/LPC1768/GCC_CS/LPC1768.ld -L./m0-beta -L./m0-beta/LPC1768
   -L./m0-beta/LPC1768/GCC_CS  -o my_program.elf main.o m0-beta/LPC1768/GCC_CS/startup_LPC17xx.o m0-beta/LPC1768/GCC_CS/sys.o 
   m0-beta/LPC1768/GCC_CS/cmsis_nvic.o m0-beta/LPC1768/GCC_CS/core_cm3.o m0-beta/LPC1768/GCC_CS/system_LPC17xx.o -lmbed -lcapi
   -lstdc++ -lsupc++ -lm -lc -lgcc -lmbed -lcapi -lstdc++ -lsupc++ -lm -lc -lgcc
arm-none-eabi-objcopy -O binary my_program.elf my_program.bin
~/my_program$ ls
m0-beta  m0-beta.lib  main.cpp  main.o  Makefile  my_program.bin  my_program.elf

The binary file (".bin") is ready to be flashed on the mbed.


All wikipages