rtconfig.py 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. # toolchains options
  2. ARCH='arm'
  3. CPU='lpc214x'
  4. CROSS_TOOL='gcc'
  5. if CROSS_TOOL == 'gcc':
  6. PLATFORM = 'gcc'
  7. EXEC_PATH = 'D:/SourceryGCC/bin'
  8. elif CROSS_TOOL == 'keil':
  9. PLATFORM = 'armcc'
  10. EXEC_PATH = 'G:\Keil_MDK_380'
  11. BUILD = 'debug'
  12. if PLATFORM == 'gcc':
  13. # toolchains
  14. PREFIX = 'arm-none-eabi-'
  15. CC = PREFIX + 'gcc'
  16. CXX = PREFIX + 'g++'
  17. AS = PREFIX + 'gcc'
  18. AR = PREFIX + 'ar'
  19. LINK = PREFIX + 'gcc'
  20. TARGET_EXT = 'axf'
  21. SIZE = PREFIX + 'size'
  22. OBJDUMP = PREFIX + 'objdump'
  23. OBJCPY = PREFIX + 'objcopy'
  24. DEVICE = ' -mcpu=arm7tdmi-s -mthumb'
  25. CFLAGS = DEVICE + ' -DRT_USING_MINILIBC'
  26. AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp'
  27. LFLAGS = DEVICE + ' -Wl,--gc-sections,-Map=rtthread-lpc2148.map,-cref,-u,_start -T lpc2148_rom.ld'
  28. CPATH = ''
  29. LPATH = ''
  30. if BUILD == 'debug':
  31. CFLAGS += ' -O0 -gdwarf-2'
  32. AFLAGS += ' -gdwarf-2'
  33. else:
  34. CFLAGS += ' -O2'
  35. POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n'
  36. elif PLATFORM == 'armcc':
  37. # toolchains
  38. CC = 'armcc'
  39. CXX = 'armcc'
  40. AS = 'armasm'
  41. AR = 'armar'
  42. LINK = 'armlink'
  43. TARGET_EXT = 'axf'
  44. DEVICE = ' --device DARMSTM'
  45. CFLAGS = DEVICE + ' --apcs=interwork'
  46. AFLAGS = DEVICE
  47. LFLAGS = DEVICE + ' --info sizes --info totals --info unused --info veneers --list rtthread-lpc2148.map --scatter lpc2148_rom.sct'
  48. CFLAGS += ' -I' + EXEC_PATH + '/ARM/RV31/INC'
  49. LFLAGS += ' --libpath ' + EXEC_PATH + '/ARM/RV31/LIB'
  50. EXEC_PATH += '/arm/bin40/'
  51. if BUILD == 'debug':
  52. CFLAGS += ' -g -O0'
  53. AFLAGS += ' -g'
  54. else:
  55. CFLAGS += ' -O2'
  56. POST_ACTION = 'fromelf --bin $TARGET --output rtthread.bin \nfromelf -z $TARGET'
  57. elif PLATFORM == 'iar':
  58. # toolchains
  59. CC = 'iccarm'
  60. AS = 'iasmarm'
  61. AR = 'iarchive'
  62. LINK = 'ilinkarm'
  63. TARGET_EXT = 'out'
  64. DEVICE = ' --cpu DARMSTM --thumb'
  65. CFLAGS = ''
  66. AFLAGS = ''
  67. LFLAGS = ' --config lpc214x_flash.icf'
  68. EXEC_PATH += '/arm/bin/'
  69. POST_ACTION = ''