Bootloader. Fixed bug in upload to RAM and updated the maple mini binary. Note upload to RAM has not been tested as the Maple mini doesn't have enough RAM to test with
This commit is contained in:
parent
4d5ccb3a15
commit
30c088e6a1
Binary file not shown.
|
@ -61,7 +61,7 @@ void dfuInit(void) {
|
||||||
thisBlockLen = 0;;
|
thisBlockLen = 0;;
|
||||||
userAppAddr = USER_CODE_RAM; /* default RAM user code location */
|
userAppAddr = USER_CODE_RAM; /* default RAM user code location */
|
||||||
userAppEnd = RAM_END;
|
userAppEnd = RAM_END;
|
||||||
userUploadType=DFU_UPLOAD_RAM;
|
userUploadType=DFU_UPLOAD_NONE;
|
||||||
code_copy_lock = WAIT;
|
code_copy_lock = WAIT;
|
||||||
dfuBusy = FALSE;
|
dfuBusy = FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,28 +61,31 @@ int main()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (checkUserCode(USER_CODE_FLASH0X8002000))
|
if (userUploadType==DFU_UPLOAD_RAM)
|
||||||
{
|
{
|
||||||
jumpToUser(USER_CODE_FLASH0X8002000);
|
// if we have just uploaded to RAM, then run whats in RAM
|
||||||
}
|
jumpToUser(USER_CODE_RAM);
|
||||||
else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if (checkUserCode(USER_CODE_FLASH0X8005000))
|
// This may be an upload to flash or a cold boot
|
||||||
|
|
||||||
|
if (checkUserCode(USER_CODE_FLASH0X8002000))
|
||||||
{
|
{
|
||||||
jumpToUser(USER_CODE_FLASH0X8005000);
|
jumpToUser(USER_CODE_FLASH0X8002000);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (checkUserCode(USER_CODE_RAM) && userUploadType==DFU_UPLOAD_RAM)
|
if (checkUserCode(USER_CODE_FLASH0X8005000))
|
||||||
{
|
{
|
||||||
jumpToUser(USER_CODE_RAM);
|
jumpToUser(USER_CODE_FLASH0X8005000);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Nothing to execute in either Flash or RAM
|
// Nothing to execute in either Flash or RAM
|
||||||
strobePin(LED_BANK, LED, 5, BLINK_FAST);
|
strobePin(LED_BANK, LED, 5, BLINK_FAST);
|
||||||
systemHardReset();
|
systemHardReset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue