This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

S210 serial DFU port

I want to port either the S210 experimental DFU over ANT_FS to serial DFU or the S110 dual bank serial DFU project to be S210 compatible.

I'm using S210 V4 and SDK 8

Which project would be best suited for porting? What would be required to make that happen?

Thanks in advance.

  • You can start with S110 dual serial DFU project. You have to replace all pstorage calls with new calls to access NVMC directly.

  • I imagine that some pre-processor calls need to change as well to initialize the S210 SD instead of the S110? What about memory settings in Keil?

  • Yes, you have to change those BLE specific macros and initialization of S210. Memory settings IROM in Keil should work fine as those are the last pages of flash. Make sure that your IRAM settings does not collide with you S210 stack.

  • So when I switch to using the S210 stack, SOFTDEVICE_HANDLER_APPSH_INIT() no longer works, gives an "array is too large" error. EDIT: See answer below for solution to the compiler error.

  • I was able to get this project working. I wanted to write down all the steps it took to build the S210 serial DFU bootloader since I'm sure others will want to do the same thing.

    I used SDK v8.1, S210 V4.0.1, nRF51 DK and Keil 4.74

    As a base project, I used the dual_bank_serial_s110 project. All modifications are from this starting point. While all of these steps may not be required, doing all of them will ensure it works correctly.

    First thing to change is the target settings in Keil to:

    Start / Size

    IROM1 0x3B800 / 0x4800

    IRAM1 0x20002800 / 0x5800

    Delete the IRAM2 section since this is only used for BLE settings storage

    In both the C/C++ and Asm defines, change BLE_STACK_REQD to ANT_STACK_REQD Also Change S110 to S210

    In dfu_types.h change BOOTLOADER_REGION_START to 0x0003B800

    Remove all of the .c files under the nRF_BLE project folder. Also comment out "ble.h" and ble_hci.h" in main.c. This will show you all the ble functions that need to be removed from main.c

    Any UART settings that need to be changed are in hci_transport_config.h

    The last piece of the puzzle was described at the bottom of this post here.

    Do a find all for BLE_STACK_EVT_MSG_BUF_SIZE or just go to ble_stack_handler_types.h and change the define from 0 to 1.

    I tested this by flashing the device with s210 and then programmed the bootloader through Keil. Verified the board started up in DFU mode and finaly used the nRF Go Studio nRF51 Bootloader tool to flash the application through serial. After it finished flashing, the board reset and the application started.

Related