11 years, 10 months ago.

What are the mystery writes at the beginning of the nRF51822 BLE example programs?

Both the BLE_Beacon and BLE_HeartRate examples start with the uncommented mystery register writes:

    *(uint32_t *)0x40000504 = 0xC007FFDF;
    *(uint32_t *)0x40006C18 = 0x00008000;

Yet looking in the nrf51822 family reference manual I can't find these registers.

The first one should be in the CLOCK or POWER peripheral; the second one in the GPIOTE peripheral.

What are these?

Question relating to:

The nRF51822-mKIT is a low cost ARM mbed enabled development board for Bluetooth® Smart designs with the nRF51822 SoC. The kit gives access to all GPIO pins via pin headers …

Where did you find the example programs? Are these from Nordic? (I don't see any BLE examples on mbed)

posted by Mike Tomovich 16 Apr 2014

1 Answer

11 years, 10 months ago.

These writes are to setup some specific registers in case people are using older revisions of the nRF51822 chips, just to make sure they have a known value. Some early silicon didn't set certain registers to the same value, and Nordic suggested adding the code above as a work-around.

As per the examples, you can find some examples in the BLE Team page here: https://mbed.org/teams/Bluetooth-Low-Energy/

To add to Kevin's answer - The mystery registers should be documented in the nRF51822 Product Anomaly Notification (PAN) sheet found on the Nordic website. http://www.nordicsemi.com/eng/Products/Bluetooth-R-low-energy/nRF51822

Looks like this is being moved into the mbed library startup code so it may disappear soon https://github.com/mbedmicro/mbed/blob/master/libraries/mbed/targets/cmsis/TARGET_NORDIC/TARGET_NRF51822/system_nrf51822.c#L45

posted by Sam Grove 16 Apr 2014