modified to enable remote debugging of basflash.s19.

basflash.s19 does not work in this version (hang)!
This commit is contained in:
Markus Fröschle
2013-02-17 22:47:24 +00:00
parent b628a0df2d
commit a1d9651ab6
9 changed files with 31 additions and 15 deletions

View File

@@ -1,12 +1,10 @@
#set disassemble-next-line on
define tr
define pdtr
target remote | m68k-bdm-gdbserver pipe /dev/bdmcf3
monitor bdm-reset
end
define tbtr
define tr
target remote | m68k-bdm-gdbserver pipe /dev/tblcf3
end
tr
source mcf5474.gdb

View File

@@ -35,8 +35,8 @@ CFLAGS=-mcpu=5474\
-g\
-Wno-multichar\
-Winline\
-Os\
-fomit-frame-pointer\
-O \
-fno-omit-frame-pointer\
-fno-strict-aliasing\
-ffreestanding\
-fleading-underscore\
@@ -107,7 +107,7 @@ $(RAM_EXEC): TARGET_ADDRESS=0x10000000
$(RAM_EXEC): LDCFILE=ram.lk
$(RAM_EXEC): MAPFILE=ram.map
$(BASFLASH_EXEC): TARGET_ADDRESS=0x00040000
$(BASFLASH_EXEC): TARGET_ADDRESS=0x00100000
$(BASFLASH_EXEC): LDCFILE=basflash.lk
$(BASFLASH_EXEC): MAPFILE=basflash.map

View File

@@ -1,6 +1,6 @@
MEMORY
{
bas_rom (RX) : ORIGIN = TARGET_ADDRESS, LENGTH = 0x00200000
bas_rom (RX) : ORIGIN = TARGET_ADDRESS, LENGTH = 0x00100000
bas_ram (WX) : ORIGIN = 0x1FE00000, LENGTH = 0x00100000 /* target to copy BaS to */
}

View File

@@ -61,4 +61,6 @@ define ib
setup-dram
end
tr
ib
load

View File

@@ -205,8 +205,6 @@ void BaS(void)
vec_init();
xprintf("finished\r\n");
enable_coldfire_interrupts();
MCF_MMU_MMUCR = MCF_MMU_MMUCR_EN; /* MMU on */
xprintf("IDE reset: ");
@@ -241,7 +239,6 @@ void BaS(void)
xprintf("finished\r\n");
sd_card_init();
srec_execute("BASFLASH.S19");
/*
* memory setup
@@ -295,6 +292,8 @@ void BaS(void)
__asm__ __volatile__("move.w #0x0700,sr \n\t" : : : "memory");
}
srec_execute("BASFLASH.S19");
/* Jump into the OS */
typedef void void_func(void);
typedef struct {
@@ -303,6 +302,7 @@ void BaS(void)
} ROM_HEADER;
xprintf("Call OS. BaS initialization finished...\r\n");
enable_coldfire_interrupts();
ROM_HEADER* os_header = (ROM_HEADER*)TOS;
os_header->initial_pc();

View File

@@ -308,8 +308,8 @@ err_t srec_load(char *flash_filename)
void basflash(void)
{
const char *basflash_str = "\\BASFLASH\\";
const char *bastest_str = "\\BASTEST\\";
const char *basflash_str = "\\BASFLASH";
const char *bastest_str = "\\BASTEST";
DRESULT res;
FRESULT fres;
FATFS fs;
@@ -351,6 +351,7 @@ void basflash(void)
strcpy(path, bastest_str);
strncat(path, fileinfo.fname, 13);
xprintf("loading file %s\n", path);
/*
* load file
*/

View File

@@ -5,10 +5,22 @@
* Author: mfro
*/
#include <stdint.h>
static uint32_t ownstack[4096];
static uint32_t *stackptr = &ownstack[4095];
/*
* setup our own stack in SDRAM to prevent clashing BaS's in SRAM (size limited).
*/
void startup(void)
{
void basflash(void);
static uint32_t oldstack;
void basflash(void);
__asm__ __volatile__("move.l sp,%0\n\t" : "=g"(oldstack) : :);
__asm__ __volatile__("move.l %0,sp\n\t" : : "g"(stackptr) : );
basflash();
__asm__ __volatile__("move.l %0,sp\n\t" : : "g"(oldstack) :);
(void) stackptr; /* make compiler happy about unused variables */
}

View File

@@ -32,6 +32,7 @@
#include "diskio.h"
#include "ff.h"
#include "s19reader.h"
#include "cache.h"
/*
* Yes, I know. The following doesn't really look like code should look like...
@@ -390,6 +391,7 @@ void srec_execute(char *flasher_filename)
xprintf("target successfully written and verified. Start address: %p\r\n", start_address);
func = start_address;
flush_and_invalidate_caches();
(*func)();
}
else

View File

@@ -46,6 +46,7 @@ _rom_entry:
/* set stack pointer to end of SRAM1 */
lea __SUP_SP,a7
move.l #0,(sp)
/* Initialize the processor caches.
* The instruction cache is fully enabled.