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

How to program RedBear BLE nano (MDBT40, which integrate nrf51822) using Nordic SDK 12 (S130)

Hello Folks,

I am currently try to program RedBear BLE nano board (which is essentially nrf51822) using Nordic SDK v12, which has features of secure OTA. However after trying out for few days, it doesn't work as expect for a simple blinking examples. It would be appreciated if any one can indicate some tutorial on it. The system I used is Ubuntu 16.04.

  • currently the source file can be successfully compiled whose output files are in /examples/peripheral/blinky/pca10028/s130/armgcc/_build/nrf51422_xxac.hex

currently I assume that nrf51422_xxac.hex can be used as application .hex file for nrf51822.. I don't know how to build output of nrf51822_xxac.hex. And also where can I find the boot loader or build application code??;

  • Then I tried to merge this file with SoftDevice by using mergehex: ./mergehex -m s130_nrf51_2.0.1_softdevice.hex nrf51422_xxac.hex -o out.hex

  • Finally, I drag out.hex to virtual file system, created by DAPLink.

For ease of demonstration, I modified the blinking program as below, which pin 39 is P0.19, which corresponding to RedBear on board LED (the number is given by MDBT40).

 /* Configure board. */
bsp_board_leds_init();

nrf_gpio_cfg_output(39);
nrf_gpio_pin_set(39);

/* Toggle LEDs. */
while (true)
{
     nrf_gpio_pin_set(39);
     nrf_delay_ms(500);
     nrf_gpio_pin_clear(39);
     nrf_delay_ms(500);
}

For convenience, you may refer to RedBear pin map here: http://redbearlab.com/blenano/

Please let me know if you have any clue on making this simple blinking example work. Thanks!

Parents
  • QFN48 is the package type not the device model number

    Look at your chip and read the model number it should be nRF51822QFAA or nRF58122QFAC

    (It could be QFAB but this seems unlikely)

    Looking at those figures, the RAM actually starts at 0x20002000 and for QFAA is 16k = 0x4000

    So your linker settings would be fine even for the QFAA as 0x2080 + 0x1f80 = 0x4000

    Did you try without the SD, and just flash the blinky hex to 0x00000000

Reply
  • QFN48 is the package type not the device model number

    Look at your chip and read the model number it should be nRF51822QFAA or nRF58122QFAC

    (It could be QFAB but this seems unlikely)

    Looking at those figures, the RAM actually starts at 0x20002000 and for QFAA is 16k = 0x4000

    So your linker settings would be fine even for the QFAA as 0x2080 + 0x1f80 = 0x4000

    Did you try without the SD, and just flash the blinky hex to 0x00000000

Children
No Data
Related