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
  • Hi Roger, thanks for the suggestion, as you said, I tried another beacon program. It works charming!

    However, for LED, it still doesn't work :-(. I feel it is the problem of pin mapping. The chip tht RedBear board used is MDBT40. after checking out datasheet, the pin number on MDBT40 is 39, which corresponding to P0.19 on nordic chip that is numbered by 27 (page 12 of infocenter.nordicsemi.com/.../nRF51822_PS_v3.1.pdf).

    So I am wondering am I use the correct to define logic level of pun, and are the argument of following function the pin number marked by nordic? thanks a lot!

     nrf_gpio_pin_set(27);
     nrf_gpio_pin_clear(27)
    
Reply
  • Hi Roger, thanks for the suggestion, as you said, I tried another beacon program. It works charming!

    However, for LED, it still doesn't work :-(. I feel it is the problem of pin mapping. The chip tht RedBear board used is MDBT40. after checking out datasheet, the pin number on MDBT40 is 39, which corresponding to P0.19 on nordic chip that is numbered by 27 (page 12 of infocenter.nordicsemi.com/.../nRF51822_PS_v3.1.pdf).

    So I am wondering am I use the correct to define logic level of pun, and are the argument of following function the pin number marked by nordic? thanks a lot!

     nrf_gpio_pin_set(27);
     nrf_gpio_pin_clear(27)
    
Children
No Data
Related