I would like upload firmware from Atmel microcontroller to nRF51822 with SD130.
I suppose that I have to use single_bank_serial_s130 in nRF51822AA, but what I have to do on other side (Atmel side) ? I found this document, but I don't know if it is relevant for central device using SDK11 and SD130. Does exist any application for PC using bootloader over UART ?
We use our pc-nrfutil tool to perform serial DFU from a PC. The source code is available here.
Thx. I found older version and this version is little bit complicated and I don't see start packet. I don't understand why you shift sequence number about 3bits in packet header. It should be ack in this position according Bluetooth Core 4.2...How Can I run and debbug this application ? What is about that documentation ?
You should be able to debug it using the Python Debugger, here is the link, but I have not tried it myself. It appears that the first byte in our documentation is written from MSBto LSB and not LSB to MSB as in the Core spec.
I finally found documentation of UART HCI protocol for SDK11. There is right PacketHeader in this document (match with core 4.2), but it doesn't match with implementation in nrfutil.
Looking at the source for nrfutil v0.5.2 it appears that the byte order is in compliance with the core spec.
def slip_parts_to_four_bytes(seq, dip, rp, pkt_type, pkt_len):
Creates a SLIP header.
For a description of the SLIP header go to:
:param int seq: Packet sequence number
:param int dip: Data integrity check
:param int rp: Reliable packet
:param pkt_type: Payload packet
:param pkt_len: Packet length
:return: str with SLIP header
ints = [0, 0, 0, 0]
ints = seq | (((seq + 1) % 8) << 3) | (dip << 6) | (rp << 7)
ints = pkt_type | ((pkt_len & 0x000F) << 4)
ints = (pkt_len & 0x0FF0) >> 4
ints = (~(sum(ints[0:3])) + 1) & 0xFF