I am working on a boot loader design for a kinetis controller. I am using this Terminal application ( https://sites.google.com/site/terminalbpp/ ) . I am able to send texts like, " Hello world" through my serial port, by debugging the code using Segger's J link debugger into my board.
But When I try to send the application file after programming the Board with my boot loader code, The terminal is unresponsive.
Is it because my Serial Connection is half duplex (RS 485) or is it because there is some error in my code ?
I don't know whether half-duplex connection would be a reason. I wanted to know whether that would be a reason. If my question sounds dumb to you, please explain me the logic.
Thanks for helping
Update:
This code provides the output successfully as shown in the image.
for(;;) {
GPIO_PDD_TogglePortDataOutputMask(GPIOA_BASE_PTR, GPIO_PDD_PIN_21);
CLS1_SendStr("Hello World!\r\n", CLS1_GetStdio()->stdOut);
WAIT1_Waitms(1000);
CLS1_SendStr("Welcome Ganesh!\r\n", CLS1_GetStdio()->stdOut);
}
But this code
` static void ReadText(void) { uint8_t buffer[32], ch, i;
for(;;) {
GPIO_PDD_TogglePortDataOutputMask(GPIOA_BASE_PTR, GPIO_PDD_PIN_21);
CLS1_SendStr("Enter some text: ", CLS1_GetStdio()->stdOut);
GPIO_PDD_TogglePortDataOutputMask(GPIOA_BASE_PTR, GPIO_PDD_PIN_21);
buffer[0] = '\0';
i = 0;
do {
if (CLS1_KeyPressed()) {
CLS1_ReadChar(&ch); /* read the character */
if (ch!='\0') { /* received a character */
buffer[i++] = ch; /* store in buffer */
if (i>=sizeof(buffer)) { /* reached end of buffer? */
buffer[i] = '\0'; /* terminate string */
break; /* leave loop */
}
if (ch=='\n') { /* line end? */
buffer[i] = '\0'; /* terminate string */
break; /* leave loop */
}
}
}
} while(1);
GPIO_PDD_TogglePortDataOutputMask(GPIOA_BASE_PTR, GPIO_PDD_PIN_21);
CLS1_SendStr("You entered: ", CLS1_GetStdio()->stdOut);
CLS1_SendStr(buffer, CLS1_GetStdio()->stdOut);
CLS1_SendStr("\r\n", CLS1_GetStdio()->stdOut);
}
}`
It gets debugged into the board without any errors but the in the terminal application there is no change.
GPIO_PDD_TogglePortDataOutputMask(GPIOA_BASE_PTR, GPIO_PDD_PIN_21);
This piece of code enables and disables the Transmitter while sending and receiving respectively.
Am I doing any mistake in usage of this piece of code ?