Tool/software: Code Composer Studio
i have cloned "boot_demo1" example and made the following changes:
1. removed the usage of SW1 button
2. added UART interrupt handler which receives and responds to commands from UART
3. added led blinking
the purpose is to make a program that blinks and waits for UART commands and executed them. these are the major commands i want to support:
1. led blink on
2. led blink off
3. enter boot loader mode
the way i'm testing this is by using LM Flasher to program the device with my "boot_demo1" to address 0x4000 right after programming "boot_serial" example through USB connection.
i have the following problem:
in order for the original boot_demo1 to work for me, i had to change "boot_demo1_ccs.cmd" and have the following:
#define APP_BASE 0x00004000
FLASH (RX) : origin = APP_BASE, length = 0x000fc000
instead of these lines:
#define APP_BASE 0x00000000
FLASH (RX) : origin = APP_BASE, length = 0x00100000
but by using the first two lines, the UART interrupt handler and the LED blink are not working - the LED doesn't blink and UART commands are not processed.
by using the second two lines, they're both working fine, but the boot loader code triggered by a UART command "boot" is not working (the call to "JumpToBootLoader" function) and i am not able to upload a bin after this command.
see my uart interrupt handler function below - what is the correct way to make both uart listener and boot loading work?
-----
void UARTIntHandler(void)
{
uint32_t ui32Status;
ui32Status = ROM_UARTIntStatus(UART0_BASE, true);
ROM_UARTIntClear(UART0_BASE, ui32Status);
char b[5];
int i = 0;
while(ROM_UARTCharsAvail(UART0_BASE))
{
b[i] = ROM_UARTCharGetNonBlocking(UART0_BASE);
i++;
}
if (strstr(b, "boot"))
{
char* response = "OK";
UARTSend(response, strlen(response));
JumpToBootLoader();
}
else if (strstr(b, "blinkon"))
{
shouldBlink = true;
char* response = "OK";
UARTSend(response, strlen(response));
}
else if (strstr(b, "blinkoff"))
{
shouldBlink = false;
GPIOPinWrite(GPIO_PORTN_BASE, GPIO_PIN_0, 0);
char* response = "OK";
UARTSend(response, strlen(response));
}
else
{
char* response = "OK";
UARTSend(response, strlen(response));
}
}
-----