How is the softdevice (s110) flashed?

Firmware/software/electronics/mechanics
Post Reply
theseankelly
Expert
Posts: 153
Joined: Mon Dec 28, 2015 3:23 pm
Contact:

How is the softdevice (s110) flashed?

Post by theseankelly »

Hey Community

I'm messing around a little bit with the NRF51 firmware and am not quite able to figure out how exactly the softdevice hex file makes its way on to the crazyflie -- OTHER than the flash_s110 jtag target in the makefile. I've scoured the load files and binary linker maps and while I see them reserving flash/ram for the softdevice, I don't see them pulling the hex file in directly. Does cfloader pull the soft device in?

Or, is the softdevice simply loaded at the factory and is never clobbered? That seems to be the most logical answer based on what I've found, but then again I've been able to flash a BLE=0 S110=0 binary using "cfloader flash cf2-nrf.bin nrf51-fw" (which I think *should* clobber the softdevice, based on what I see in the ld file) and then re-flashing a BLE=1 S110=1 binary which restores BLE functionality, suggesting the softdevice is getting flashed again.

What am I missing? Is JTAG the only way to flash the soft device onto the NRF51?

Thanks
Sean
http://www.thejumperwire.com
Tips, tutorials, and science about DIY electronics, drones, and embedded software.
Anderss90
Beginner
Posts: 2
Joined: Thu Jan 21, 2016 9:05 am

Re: How is the softdevice (s110) flashed?

Post by Anderss90 »

I cannot answer how the softdevice is flashed on the Crazyflie, but i can tell you the different ways to flash a softdevice. The first one is by using the SWD (Serial Wire Debug) programming interface of the nRF51. SWD is similar, but not interchangeble with JTAG. The other way is to have a bootloader running on the nRF51, and transfer the softdevice over a serial connection, or over the radio. The bootloader will then place the softdevice in the correct flash location.

I see in the crazyflie schematic, the main cpu (STM32) is connected to the nRF51 SWD connections. This indicated that the softdevice (and nRF51 Firmware) is transferred to the nRF51 through the STM32. It might also be placed there during production.
theseankelly
Expert
Posts: 153
Joined: Mon Dec 28, 2015 3:23 pm
Contact:

Re: How is the softdevice (s110) flashed?

Post by theseankelly »

Thanks Anders -- good point about the mechanism being SWD and not JTAG.

Either way, I'm curious to know how the s110 makes it into flash when using cfloader to flash a firmware package. Is the s110 hex binary packaged up into the cf firmware binary in some way that I'm missing? Or does the compilation process link directly against the s110 (I didn't think it worked this way..) Or is the s110 just always there in flash and can't be overridden or updated other than via SWD?

Thanks
Sean
http://www.thejumperwire.com
Tips, tutorials, and science about DIY electronics, drones, and embedded software.
theseankelly
Expert
Posts: 153
Joined: Mon Dec 28, 2015 3:23 pm
Contact:

Re: How is the softdevice (s110) flashed?

Post by theseankelly »

Bother, bother -- I'm trying to do some things that require the latest Nordic SDK and latest softdevice. Does the crazyflie bootloader support updating the softdevice over the air or cable, or do I need the NRF24 debug adapter & SWD to do this?
http://www.thejumperwire.com
Tips, tutorials, and science about DIY electronics, drones, and embedded software.
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: How is the softdevice (s110) flashed?

Post by tobias »

There is a possibility to flash a new soft device over the air but I'm not sure if it is working or not. I will send a message to @arnaud who knows more about that. The other option is over the SWD with the debug adapter. There are some pads with the nRF51 SWD broken out on the bottom off the board close to one of the mounting ears.
theseankelly
Expert
Posts: 153
Joined: Mon Dec 28, 2015 3:23 pm
Contact:

Re: How is the softdevice (s110) flashed?

Post by theseankelly »

Hey, makes sense. I've actually achieved what I needed to achieve on the older version of the Nordic SDK, so no softdevice update required. Sounds like the only way currently is via SWD, which is fine.

Thanks for confirming!
http://www.thejumperwire.com
Tips, tutorials, and science about DIY electronics, drones, and embedded software.
Post Reply