Update 4 :
my understanding now is that optiboot sets wrong baud rate for 115200 passed in bootloader mode as it replies with 0x11 and transmits characters correctly in sketch mode:
2015-09-17 09:39:25.628 xctest[60179:4253160] [TRACE ] [IN ]: Rx value received 9 bytes: O [0x4F] K [0x4B] + [0x2B] P [0x50] I [0x49] O [0x4F] 2 [0x32] : [0x3A] 1 [0x31]
2015-09-17 09:39:25.628 xctest[60179:4253160] [WARNING] [IN ]: Got 9 bytes in incoming buffer
2015-09-17 09:39:25.629 xctest[60179:4253160] [TRACE ] [IN ]: Rx value received 9 bytes: O [0x4F] K [0x4B] + [0x2B] P [0x50] I [0x49] O [0x4F] 2 [0x32] : [0x3A] 0 [0x30]
2015-09-17 09:39:25.629 xctest[60179:4253160] [WARNING] [IN ]: Got 9 bytes in incoming buffer
2015-09-17 09:39:25.630 xctest[60179:4253160] [TRACE ] [IN ]: Rx value received 1 bytes: . [0x00]
2015-09-17 09:39:25.630 xctest[60179:4253160] [TRACE ] [IN ]: Ignoring single 0x00 char
2015-09-17 09:39:27.351 xctest[60179:4253117] [TRACE ] [IN ]: Finish reading
2015-09-17 09:39:27.351 xctest[60179:4253117] [TRACE ] [IN ]: Ble clear buffer
2015-09-17 09:39:27.351 xctest[60179:4253117] [DEBUG ] [IN ]: Drained 18 bytes
2015-09-17 09:39:27.352 xctest[60179:4253117] [DEBUG ] [ ]: Draining incoming buffer (0 bytes)
2015-09-17 09:39:27.352 xctest[60179:4253117] [DEBUG ] [OUT]: Sending 2 bytes
2015-09-17 09:39:27.352 xctest[60179:4253117] [TRACE ] [OUT]: Send: 0 [0x30] [0x20]
2015-09-17 09:39:27.353 xctest[60179:4253117] [TRACE ] [OUT]: BLE sending bytes range from 0 length 2
2015-09-17 09:39:27.353 xctest[60179:4253117] [DEBUG ] [IN ]: Reading 1 bytes ...
2015-09-17 09:39:27.353 xctest[60179:4253117] [TRACE ] [IN ]: Start reading
2015-09-17 09:39:27.424 xctest[60179:4253160] [TRACE ] [IN ]: Rx value received 1 bytes: . [0x00]
2015-09-17 09:39:27.424 xctest[60179:4253160] [TRACE ] [IN ]: Ignoring single 0x00 char
2015-09-17 09:39:27.424 xctest[60179:4253149] [TRACE ] [IN ]: Rx value received 2 bytes: . [0x11] . [0xFC]
2015-09-17 09:39:27.425 xctest[60179:4253149] [WARNING] [IN ]: Got 2 bytes in incoming buffer
2015-09-17 09:39:27.425 xctest[60179:4253117] [TRACE ] [IN ]: Finish reading
2015-09-17 09:39:27.425 xctest[60179:4253117] [TRACE ] [IN ]: Receive: . [0x11]
2015-09-17 09:39:27.425 xctest[60179:4253117] [DEBUG ] [IN ]: Read 1 bytes, actually received 2 bytes
2015-09-17 09:39:27.426 xctest[60179:4253117] [TRACE ] [IN ]: 1 bytes in incoming buffer remaining for next receive
2015-09-17 09:39:27.426 xctest[60179:4253117] [ERROR ] [ ]: STK500:synchronize: attempt 1 of 3: no sync: received [0x11]
2015-09-17 09:39:27.426 xctest[60179:4253117] [DEBUG ] [ ]: Draining incoming buffer (1 bytes)
2015-09-17 09:39:27.426 xctest[60179:4253117] [DEBUG ] [OUT]: Sending 2 bytes
2015-09-17 09:39:27.427 xctest[60179:4253117] [TRACE ] [OUT]: Send: 0 [0x30] [0x20]
2015-09-17 09:39:27.427 xctest[60179:4253117] [TRACE ] [OUT]: BLE sending bytes range from 0 length 2
2015-09-17 09:39:27.427 xctest[60179:4253117] [DEBUG ] [IN ]: Reading 1 bytes ...
2015-09-17 09:39:27.427 xctest[60179:4253117] [TRACE ] [IN ]: Start reading
2015-09-17 09:39:27.499 xctest[60179:4253160] [TRACE ] [IN ]: Rx value received 1 bytes: . [0x00]
2015-09-17 09:39:27.499 xctest[60179:4253160] [TRACE ] [IN ]: Ignoring single 0x00 char
2015-09-17 09:39:27.500 xctest[60179:4253160] [TRACE ] [IN ]: Rx value received 2 bytes: . [0x14] . [0x10]
2015-09-17 09:39:27.500 xctest[60179:4253160] [WARNING] [IN ]: Got 2 bytes in incoming buffer
2015-09-17 09:39:27.500 xctest[60179:4253117] [TRACE ] [IN ]: Finish reading
2015-09-17 09:39:27.501 xctest[60179:4253117] [TRACE ] [IN ]: Receive: . [0x14]
2015-09-17 09:39:27.501 xctest[60179:4253117] [DEBUG ] [IN ]: Read 1 bytes, actually received 2 bytes
2015-09-17 09:39:27.501 xctest[60179:4253117] [TRACE ] [IN ]: 1 bytes in incoming buffer remaining for next receive
2015-09-17 09:39:27.501 xctest[60179:4253117] [DEBUG ] [IN ]: Reading 1 bytes ...
2015-09-17 09:39:27.501 xctest[60179:4253117] [TRACE ] [IN ]: Having current receive buffer: . [0x10]
2015-09-17 09:39:27.502 xctest[60179:4253117] [TRACE ] [IN ]: Start reading
2015-09-17 09:39:27.502 xctest[60179:4253117] [TRACE ] [IN ]: Finish reading
2015-09-17 09:39:27.502 xctest[60179:4253117] [TRACE ] [IN ]: Receive: . [0x10]
2015-09-17 09:39:27.508 xctest[60179:4253117] [DEBUG ] [IN ]: Read 1 bytes, actually received 1 bytes
2015-09-17 09:39:27.509 xctest[60179:4253117] [TRACE ] [IN ]: Ble clear buffer
2015-09-17 09:39:27.509 xctest[60179:4253117] [DEBUG ] [OUT]: Sending 3 bytes
2015-09-17 09:39:27.509 xctest[60179:4253117] [TRACE ] [OUT]: Send: A [0x41] . [0x81] [0x20]
2015-09-17 09:39:27.509 xctest[60179:4253117] [TRACE ] [OUT]: BLE sending bytes range from 0 length 3
2015-09-17 09:39:27.510 xctest[60179:4253117] [DEBUG ] [IN ]: Reading 1 bytes ...
2015-09-17 09:39:27.510 xctest[60179:4253117] [TRACE ] [IN ]: Start reading
2015-09-17 09:39:27.574 xctest[60179:4253149] [TRACE ] [IN ]: Rx value received 1 bytes: . [0x00]
2015-09-17 09:39:27.574 xctest[60179:4253149] [TRACE ] [IN ]: Ignoring single 0x00 char
2015-09-17 09:39:31.325 xctest[60179:4253117] [ERROR ] [OUT]: BLE read timeout: 3.000965 (timeout = 3.000000)
2015-09-17 09:39:31.326 xctest[60179:4253117] [TRACE ] [IN ]: Finish reading
2015-09-17 09:39:31.326 xctest[60179:4253117] [TRACE ] [IN ]: Ble clear buffer
2015-09-17 09:39:31.326 xctest[60179:4253117] [ERROR ] [IN ]: STK500:receive: programmer is not responding
2015-09-17 09:39:31.327 xctest[60179:4253117] [DEBUG ] [OUT]: Sending 3 bytes
2015-09-17 09:39:31.327 xctest[60179:4253117] [TRACE ] [OUT]: Send: A [0x41] . [0x82] [0x20]
2015-09-17 09:39:31.327 xctest[60179:4253117] [TRACE ] [OUT]: BLE sending bytes range from 0 length 3
2015-09-17 09:39:31.328 xctest[60179:4253117] [DEBUG ] [IN ]: Reading 1 bytes ...
2015-09-17 09:39:31.328 xctest[60179:4253117] [TRACE ] [IN ]: Start reading
2015-09-17 09:39:31.399 xctest[60179:4253160] [TRACE ] [IN ]: Rx value received 1 bytes: . [0x00]
2015-09-17 09:39:31.400 xctest[60179:4253160] [TRACE ] [IN ]: Ignoring single 0x00 char
2015-09-17 09:39:35.173 xctest[60179:4253117] [ERROR ] [OUT]: BLE read timeout: 3.000965 (timeout = 3.000000)
2015-09-17 09:39:35.173 xctest[60179:4253117] [TRACE ] [IN ]: Finish reading
2015-09-17 09:39:35.174 xctest[60179:4253117] [TRACE ] [IN ]: Ble clear buffer
2015-09-17 09:39:35.174 xctest[60179:4253117] [ERROR ] [IN ]: STK500:receive: programmer is not responding
2015-09-17 09:39:35.174 xctest[60179:4253117] [DEBUG ] [ ]: STK500:initialize: n_extparms = 3
2015-09-17 09:39:35.175 xctest[60179:4253117] [DEBUG ] [OUT]: Sending 22 bytes
2015-09-17 09:39:35.175 xctest[60179:4253117] [TRACE ] [OUT]: Send: B [0x42] . [0x86] . [0x00] . [0x01] . [0x00] . [0x01] . [0x01] . [0x01] . [0x03] . [0xFF] . [0xFF] . [0xFF] . [0xFF] . [0x00] . [0x80] . [0x04] . [0x00] . [0x00] . [0x00] . [0x80] . [0x00] [0x20]
2015-09-17 09:39:35.175 xctest[60179:4253117] [TRACE ] [OUT]: BLE sending bytes range from 0 length 20
2015-09-17 09:39:35.176 xctest[60179:4253117] [TRACE ] [OUT]: BLE sending bytes range from 20 length 2
2015-09-17 09:39:35.177 xctest[60179:4253117] [DEBUG ] [IN ]: Reading 1 bytes ...
2015-09-17 09:39:35.177 xctest[60179:4253117] [TRACE ] [IN ]: Start reading
2015-09-17 09:39:35.224 xctest[60179:4253149] [TRACE ] [IN ]: Rx value received 1 bytes: . [0x00]
2015-09-17 09:39:35.224 xctest[60179:4253149] [TRACE ] [IN ]: Ignoring single 0x00 char
Should it work if i wire pins 0 and 1 at Uno to RX/TX (it does work for Mega2560)? Here is soft uart code from optiboot:
#ifndef SOFT_UART
#ifdef __AVR_ATmega8__
UCSRA = _BV(U2X); //Double speed mode USART
UCSRB = _BV(RXEN) | _BV(TXEN); // enable Rx & Tx
UCSRC = _BV(URSEL) | _BV(UCSZ1) | _BV(UCSZ0); // config USART; 8N1
UBRRL = (uint8_t)( (F_CPU + BAUD_RATE * 4L) / (BAUD_RATE * 8L) - 1 );
#else
UCSR0A = _BV(U2X0); //Double speed mode USART0
UCSR0B = _BV(RXEN0) | _BV(TXEN0);
UCSR0C = _BV(UCSZ00) | _BV(UCSZ01);
UBRR0L = (uint8_t)( (F_CPU + BAUD_RATE * 4L) / (BAUD_RATE * 8L) - 1 );
#endif
#endif
#ifdef SOFT_UART
/* Set TX pin as output */
UART_DDR |= _BV(UART_TX_BIT);
#endif
Should RX be set as input separately too (like Tx as output)? Why it tries to set 'Double speed'?