Browse Source

keil script: scripts/xc_ppf1901.sct

Signed-off-by: surenyi <surenyi82@163.com>
master
surenyi 5 years ago
parent
commit
21c2058044
  1. 24
      lib/cmd.c
  2. 42
      scripts/xc_ppf1901.sct

24
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);

42
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*)
}
}
Loading…
Cancel
Save