11 years ago.

exporting to code red, toolchain setup? confused.

so i read this: http://mbed.org/handbook/Exporting-to-Code-Red and am confused where in redsuite 5 do i place these in?

compiler

-std=gnu++98 -Os -fno-common -fmessage-length=0
-fno-exceptions -fno-builtin -ffunction-sections -fdata-sections
-mcpu=cortex-m3 -mthumb
-D__NEWLIB__ -D__CODE_RED -D__USE_CMSIS -DCPP_USE_HEAP

linker

-Wl,--gc-sections -mcpu=cortex-m3 -mthumb -nostdlib

where in the properties window do i place this code?

see image /media/uploads/jonliujl/untitled.png

I cannot get code red properly configured to run my exported mbed program.

2 Answers

11 years ago.

You do not have to modify the options. They are already contained in the project file. They were written in the documentation for your information, not as a required configuration step. I have now deleted this information to avoid confusion in the future.

Cheers, Emilio

11 years ago.

hi emilio, i still have a problem. I have a full redsuite 5 license, (the $999 version) I am successfully able to compile a bin file from mbed online compiler. When i export it to code red suite 5, and set build configuration to release, I get errors shown below. it seems like the usb serial drivers doesnt compile. I figure there must be some tweaks to red suite 5 i must do, but i do not know.

Quote:

09:46:46 Build of configuration Release for project temp_code make all Building file: ../USBDevice/USBSerial/USBCDC.cpp Invoking: MCU C++ Compiler arm-none-eabi-c++ -DNEWLIB -DTOOLCHAIN_GCC_CR -DTARGET_LPC1768 -DCODE_RED -DCPP_USE_HEAP -I"C:\Dropbox\VSS_copy\Temp_code\temp_code" -I"C:\Dropbox\VSS_copy\Temp_code\temp_code\USBDevice" -I"C:\Dropbox\VSS_copy\Temp_code\temp_code\USBDevice\USBHID" -I"C:\Dropbox\VSS_copy\Temp_code\temp_code\USBDevice\USBDevice" -I"C:\Dropbox\VSS_copy\Temp_code\temp_code\USBDevice\USBAudio" -I"C:\Dropbox\VSS_copy\Temp_code\temp_code\USBDevice\USBSerial" -I"C:\Dropbox\VSS_copy\Temp_code\temp_code\USBDevice\USBMSD" -I"C:\Dropbox\VSS_copy\Temp_code\temp_code\USBDevice\USBMIDI" -I"C:\Dropbox\VSS_copy\Temp_code\temp_code\mbed" -I"C:\Dropbox\VSS_copy\Temp_code\temp_code\mbed\LPC1768" -I"C:\Dropbox\VSS_copy\Temp_code\temp_code\mbed\LPC1768\GCC_CR" -O2 -Os -g -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fno-exceptions -mcpu=cortex-m3 -mthumb -MMD -MP -MF"USBDevice/USBSerial/USBCDC.d" -MT"USBDevice/USBSerial/USBCDC.d" -o "USBDevice/USBSerial/USBCDC.o" "../USBDevice/USBSerial/USBCDC.cpp" Finished building: ../USBDevice/USBSerial/USBCDC.cpp

Building file: ../USBDevice/USBSerial/USBSerial.cpp Invoking: MCU C++ Compiler arm-none-eabi-c++ -DNEWLIB -DTOOLCHAIN_GCC_CR -DTARGET_LPC1768 -DCODE_RED -DCPP_USE_HEAP -I"C:\Dropbox\VSS_copy\Temp_code\temp_code" -I"C:\Dropbox\VSS_copy\Temp_code\temp_code\USBDevice" -I"C:\Dropbox\VSS_copy\Temp_code\temp_code\USBDevice\USBHID" -I"C:\Dropbox\VSS_copy\Temp_code\temp_code\USBDevice\USBDevice" -I"C:\Dropbox\VSS_copy\Temp_code\temp_code\USBDevice\USBAudio" -I"C:\Dropbox\VSS_copy\Temp_code\temp_code\USBDevice\USBSerial" -I"C:\Dropbox\VSS_copy\Temp_code\temp_code\USBDevice\USBMSD" -I"C:\Dropbox\VSS_copy\Temp_code\temp_code\USBDevice\USBMIDI" -I"C:\Dropbox\VSS_copy\Temp_code\temp_code\mbed" -I"C:\Dropbox\VSS_copy\Temp_code\temp_code\mbed\LPC1768" -I"C:\Dropbox\VSS_copy\Temp_code\temp_code\mbed\LPC1768\GCC_CR" -O2 -Os -g -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fno-exceptions -mcpu=cortex-m3 -mthumb -MMD -MP -MF"USBDevice/USBSerial/USBSerial.d" -MT"USBDevice/USBSerial/USBSerial.d" -o "USBDevice/USBSerial/USBSerial.o" "../USBDevice/USBSerial/USBSerial.cpp" ../USBDevice/USBSerial/USBSerial.cpp: In member function 'virtual bool USBSerial::EP2_OUT_callback()': ../USBDevice/USBSerial/USBSerial.cpp:55:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] ../USBDevice/USBSerial/USBSerial.cpp: In member function 'virtual int USBSerial::_getc()': ../USBDevice/USBSerial/USBSerial.cpp:33:12: warning: 'c' may be used uninitialized in this function [-Wuninitialized] Finished building: ../USBDevice/USBSerial/USBSerial.cpp

Building file: ../USBDevice/USBMSD/USBMSD.cpp Invoking: MCU C++ Compiler arm-none-eabi-c++ -DNEWLIB -DTOOLCHAIN_GCC_CR -DTARGET_LPC1768 -DCODE_RED -DCPP_USE_HEAP -I"C:\Dropbox\VSS_copy\Temp_code\temp_code" -I"C:\Dropbox\VSS_copy\Temp_code\temp_code\USBDevice" -I"C:\Dropbox\VSS_copy\Temp_code\temp_code\USBDevice\USBHID" -I"C:\Dropbox\VSS_copy\Temp_code\temp_code\USBDevice\USBDevice" -I"C:\Dropbox\VSS_copy\Temp_code\temp_code\USBDevice\USBAudio" -I"C:\Dropbox\VSS_copy\Temp_code\temp_code\USBDevice\USBSerial" -I"C:\Dropbox\VSS_copy\Temp_code\temp_code\USBDevice\USBMSD" -I"C:\Dropbox\VSS_copy\Temp_code\temp_code\USBDevice\USBMIDI" -I"C:\Dropbox\VSS_copy\Temp_code\temp_code\mbed" -I"C:\Dropbox\VSS_copy\Temp_code\temp_code\mbed\LPC1768" -I"C:\Dropbox\VSS_copy\Temp_code\temp_code\mbed\LPC1768\GCC_CR" -O2 -Os -g -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -fno-exceptions -mcpu=cortex-m3 -mthumb -MMD -MP -MF"USBDevice/USBMSD/USBMSD.d" -MT"USBDevice/USBMSD/USBMSD.d" -o "USBDevice/USBMSD/USBMSD.o" "../USBDevice/USBMSD/USBMSD.cpp" In file included from ../USBDevice/USBMSD/USBMSD.cpp:20:0: ../USBDevice/USBMSD/USBMSD.h:179:13: error: 'packed' does not name a type ../USBDevice/USBMSD/USBMSD.h:187:7: error: 'CBW' does not name a type ../USBDevice/USBMSD/USBMSD.h:190:13: error: 'packed' does not name a type ../USBDevice/USBMSD/USBMSD.h:195:7: error: 'CSW' does not name a type ../USBDevice/USBMSD/USBMSD.h:201:5: error: 'CBW' does not name a type ../USBDevice/USBMSD/USBMSD.h:204:5: error: 'CSW' does not name a type ../USBDevice/USBMSD/USBMSD.cpp: In constructor 'USBMSD::USBMSD(uint16_t, uint16_t, uint16_t)': ../USBDevice/USBMSD/USBMSD.cpp:68:21: error: 'cbw' was not declared in this scope ../USBDevice/USBMSD/USBMSD.cpp:68:36: error: 'CBW' was not declared in this scope ../USBDevice/USBMSD/USBMSD.cpp:69:21: error: 'csw' was not declared in this scope ../USBDevice/USBMSD/USBMSD.cpp:69:36: error: 'CSW' was not declared in this scope ../USBDevice/USBMSD/USBMSD.cpp: In member function 'virtual bool USBMSD::EP2_OUT_callback()': ../USBDevice/USBMSD/USBMSD.cpp:152:21: error: 'cbw' was not declared in this scope ../USBDevice/USBMSD/USBMSD.cpp:166:13: error: 'csw' was not declared in this scope ../USBDevice/USBMSD/USBMSD.cpp: In member function 'virtual bool USBMSD::EP2_IN_callback()': ../USBDevice/USBMSD/USBMSD.cpp:182:21: error: 'cbw' was not declared in this scope ../USBDevice/USBMSD/USBMSD.cpp:178:12: warning: enumeration value 'READ_CBW' not handled in switch [-Wswitch] ../USBDevice/USBMSD/USBMSD.cpp: In member function 'void USBMSD::memoryWrite(uint8_t*, uint16_t)': ../USBDevice/USBMSD/USBMSD.cpp:231:5: error: 'csw' was not declared in this scope ../USBDevice/USBMSD/USBMSD.cpp: In member function 'void USBMSD::memoryVerify(uint8_t*, uint16_t)': ../USBDevice/USBMSD/USBMSD.cpp:262:5: error: 'csw' was not declared in this scope ../USBDevice/USBMSD/USBMSD.cpp: In member function 'bool USBMSD::write(uint8_t*, uint16_t)': ../USBDevice/USBMSD/USBMSD.cpp:324:17: error: 'cbw' was not declared in this scope ../USBDevice/USBMSD/USBMSD.cpp:333:5: error: 'csw' was not declared in this scope ../USBDevice/USBMSD/USBMSD.cpp: In member function 'void USBMSD::sendCSW()': ../USBDevice/USBMSD/USBMSD.cpp:348:5: error: 'csw' was not declared in this scope ../USBDevice/USBMSD/USBMSD.cpp:349:48: error: 'CSW' was not declared in this scope ../USBDevice/USBMSD/USBMSD.cpp: In member function 'void USBMSD::fail()': ../USBDevice/USBMSD/USBMSD.cpp:383:5: error: 'csw' was not declared in this scope ../USBDevice/USBMSD/USBMSD.cpp: In member function 'void USBMSD::CBWDecode(uint8_t*, uint16_t)': ../USBDevice/USBMSD/USBMSD.cpp:389:24: error: 'cbw' was not declared in this scope ../USBDevice/USBMSD/USBMSD.cpp:392:13: error: 'csw' was not declared in this scope ../USBDevice/USBMSD/USBMSD.cpp: In member function 'void USBMSD::testUnitReady()': ../USBDevice/USBMSD/USBMSD.cpp:473:9: error: 'cbw' was not declared in this scope ../USBDevice/USBMSD/USBMSD.cpp:481:5: error: 'csw' was not declared in this scope ../USBDevice/USBMSD/USBMSD.cpp: In member function 'void USBMSD::memoryRead()': ../USBDevice/USBMSD/USBMSD.cpp:506:5: error: 'csw' was not declared in this scope ../USBDevice/USBMSD/USBMSD.cpp: In member function 'bool USBMSD::infoTransfer()': ../USBDevice/USBMSD/USBMSD.cpp:519:10: error: 'cbw' was not declared in this scope ../USBDevice/USBMSD/USBMSD.cpp:540:9: error: 'csw' was not declared in this scope ../USBDevice/USBMSD/USBMSD.cpp:552:9: error: 'csw' was not declared in this scope make: * [USBDevice/USBMSD/USBMSD.o] Error 1

09:46:47 Build Finished (took 1s.351ms)

The USBDevice library is not yet supported for GCC toolchains.

Cheers, Emilio

posted by Emilio Monti 19 Apr 2013