I installed Code::Blocks and it looks like it could free me from the command line, but i have got some problems. Could you just give an idea how to set the parameters in Code-Blocks Menu - Settings - Compiler and Debugger - Toolchain executables. I am using Win XP32
Code-Blocks
(2 posts) (2 voices)-
Posted 5 years ago #
-
Hi starbug!
When I got codeblocks set up for unix (http://leaflabs.com/docs/libmaple/unix-toolchain/) I went a different route and reused our Makefile from libmaple; this meant I didn't have to configure the compiler/toolchain executables because everything was already configured in the Makefile. To copy that technique on windows you would have to get cygwin setup with at least 'bash' and 'make', and then get codeblocks to recognize those commands...
[I'll preface the below tips with the warning that setting up this toolchain was a HUGE headache for us the first time and we're kind of attached to our Makefile because, well, "it just works". A big source of confusion is that the Arduino language is a blend of C and C++, with different compiler and linker settings for each. Also uploading will require calling out to dfu-util for the "run" target...]
To answer your actual question though, I would guess you want to "Copy" the "GNU ARM GCC Compiler" settings (rename the copy "CodeSourcery GNU ARM GCC Compiler"?), change the path to wherever you extracted arm-2009q3-68-arm-none-eabi-toolchain-win32.tar.gz, and rename all the executables to, eg, 'arm-none-eabi-gcc' (instead of 'gcc'); not sure if you should include the .exe suffix. There is also a bundled version of make called cs-make.exe that might work for you. Then you'll need to configure all the compiler and linker flags the same way we have them in our make file. At a minimum this means figuring out the following (or maybe you can just paste this in somewhere?):
CFLAGS = $(INCLUDES) -c \
-Os \
-g -mcpu=cortex-m3 -mthumb -march=armv7-m -nostdlib \
-ffunction-sections -fdata-sections -Wl,--gc-sections \
-D$(DEFFLAGS)CXXFLAGS = -fno-rtti -fno-exceptions -Wall
LDDIR=support/ld
LFLAGS = -T$(LDDIR)/$(LDSCRIPT) -L$(LDDIR) \
-mcpu=cortex-m3 -mthumb -Xlinker \
--gc-sections --print-gc-sections --march=armv7-m -Wall(note that "-mthumb" will actually result in thumb2 instructions in this case)
If that all works for you and you can configure a libmaple project to use those compiler toolchains, setup RAM and FLASH targets (again, copying configuration from the Makefile targets), and generate valid .bin files... we'd be impressed and would love to hear about it! Following that you would need to configure the "run" button to call out to dfu-util (you can get the executable by searching the Maple IDE installation directory for "dfu-util" or from the OpenMoko project wiki), which will get you uploading into perpetual bootloader mode. Then the reset script (support/scripts/reset.py), which would require python and PySerial to be installed and on your system PATH.
All in all a lot of work! My recommendation would be to google around for cygwin+Code::Blocks advice... or maybe we have a windows expert lurking who can chime in?
Posted 5 years ago #
Reply
You must log in to post.