updating uc using usb interface

im working since some time pn a dfu programmer. Im using a microcontroller from Stellaris. I want to flash the internal Flash of Stellaris Mc and a ext. SPI Flash, all this over the USB interface. For this i choosed a dfu programmer. So i modified the dfuprogrammer so that i can flash the int. Flash if i send over command line a special address and with other address i flash the ext. Flash. Maybe somone has experience with Stellaris, there is a tool called dfuprog which you find in Stellarisware. I compiled the project and modified it for me. There are som commands like:

#define DFU_CMD_PROG 0x01
#define DFU_CMD_READ 0x02
#define DFU_CMD_CHECK 0x03

and i added one more command with

#define DFU_CMD_PROG_EX 0x08

for the ext. Flash. This command also i added in the bootloader of Stellaris that it can recognize the new command.

In the download routine i added my routine for downloading a .bin file into ext. Flash.

My Problem is, that i the bootloader isnt recognizing the new command. Maybe somone has worked with Stellaris bootloader and can help me out here.

My changings in the bootloader:

typedef struct
unsigned char ucCommand; // DFU_CMD_PROG
unsigned char ucReserved; // Reserved - set to 0x00.
unsigned long usStartAddr; // Here i choose long because the address for ext . Flash is 0x8000000
unsigned long ulLength; // Total length, in bytes, of following data
// for the complete download operation.
PACKED tDFUDownloadProgHeaderEx;

In the bl_usb.c file off bootl. there is a query here i added my routine
tDFUDownloadProgHeaderEx *psHdr;

// Extract the address and size from the command header.
psHdr = (tDFUDownloadProgHeaderEx *)pcCmd;

g_sNextDownloadEx.pcStart = (unsigned long *)(psHdr->usStartAddr);
g_sNextDownloadEx.ulLength = psHdr->ulLength;

g_pcDFUWrite = (unsigned char *)(psHdr + 1);
g_usDFUBufferUsed = ulSize - sizeof(tDFUDownloadHeader);

HWREGBITW(&g_ulCommandFlags, CMD_FLAG_WRITE) = 1;

hope someone can help me out. Thanks
Last edited on
Topic archived. No new replies allowed.