From 21c20580448792b21b3a395edd755d65d6ace62f Mon Sep 17 00:00:00 2001 From: surenyi Date: Mon, 10 Jun 2019 15:20:59 +0800 Subject: [PATCH] keil script: scripts/xc_ppf1901.sct Signed-off-by: surenyi --- lib/cmd.c | 24 ++++++++++++++++++++++-- scripts/xc_ppf1901.sct | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 scripts/xc_ppf1901.sct diff --git a/lib/cmd.c b/lib/cmd.c index 3844c86..1dd2cfa 100644 --- a/lib/cmd.c +++ b/lib/cmd.c @@ -38,7 +38,11 @@ enum KEY_ACTION { BACKSPACE = 127 /* Backspace */ }; +#if defined(__CC_ARM) +extern struct cmd_tbl_s Image$$CMDLINE$$Base, Image$$CMDLINE$$Limit; +#else extern struct cmd_tbl_s __cmdline_cmd_start, __cmdline_cmd_end; +#endif static struct cmd_handler _G; @@ -99,10 +103,17 @@ static void do_printf(const char *s) static int do_help(cmd_tbl_t s, int argc, char *argv[]) { +#if defined(__CC_ARM) + cmd_tbl_t it = &Image$$CMDLINE$$Base; +#else cmd_tbl_t it = &__cmdline_cmd_start; - +#endif do_printf("support commands:\r\n\r\n"); +#if defined(__CC_ARM) + while (it < &Image$$CMDLINE$$Limit) { +#else while (it < &__cmdline_cmd_end) { +#endif do_printf(it->name); do_printf("\t"); do_printf(it->help); @@ -172,7 +183,12 @@ static int parse_line(char *cmd, int len, char *argv[], int _maxargs) int cmd_process(char *line) { +#if defined(__CC_ARM) + cmd_tbl_t it = &Image$$CMDLINE$$Base; +#else cmd_tbl_t it = &__cmdline_cmd_start; +#endif + int i, argc, namelen; int size = strlen(line); char *argv[TARGET_CMD_MAXARGS + 1]; @@ -187,7 +203,11 @@ int cmd_process(char *line) if (argc <= 0) goto recovery; - while (it < &__cmdline_cmd_end) { +#if defined(__CC_ARM) + while (it < &Image$$CMDLINE$$Limit) { +#else + while (it < &__cmdline_cmd_end) { +#endif namelen = strlen(it->name); if (strncasecmp(argv[0], it->name, namelen) == 0) { it->cmd(it, argc, argv); diff --git a/scripts/xc_ppf1901.sct b/scripts/xc_ppf1901.sct new file mode 100644 index 0000000..ee8191b --- /dev/null +++ b/scripts/xc_ppf1901.sct @@ -0,0 +1,42 @@ +FLASH 0x08000000 0x200000 +{ + EXEC_ROM 0x08000000 0x200000 + { + *.o(RESET, +FIRST) + *(InRoot$$Sections) + .ANY (+RO) + } + + + ;CCM 0x10000000 0x10000 + CMDLINE 0x10000000 0x1000 { + *(.cmdline_cmd*) + } + + ARM_LIB_HEAP 0x10002000 EMPTY 0x2000 ; Heap region growing up + { + ;*(HEAP) + } + + ARM_LIB_STACK 0x10010000 EMPTY -0xc000 ; Stack region growing down + { + ;*(STACK) + } + + ;SRAM 0x20000000 0x30000 + DATA_RAM 0x20000000 0x1c000 + { + .ANY (+RW +ZI) + } + + TXDMA 0x2001c000 0x4000 + { + *(*.txdma*) + *(*.txbuf*) + } + + RXDMA 0x20020000 0x10000 + { + *(.rxdma*) + } +}