This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nrf51822 BLE stack into flash memory.

Hello! I'm trying to program nrf51822 like a BLE device. I'm using QT Creator(QBS) + GNU Compiler + Open OCD + STlink(debugger) to create and to program. What I must to do if I want to create BLE device? I'm trying this:

  1. From examples I get "ble_app_template_s110_xxaa.hex" file.

  2. Tries to program flash with it via open ocd.

  3. Resets chip.

Nothing happens. I modified example(main.c file) like this (led has pin9):

...
    void func_mig()
    {
        nrf_delay_ms(500);
        nrf_gpio_pin_set(9);
        nrf_delay_ms(500);
        nrf_gpio_pin_clear(9);
        nrf_delay_ms(500);
    }

    /**@brief Function for application main entry.
     */
    int main(void)
    {
        nrf_gpio_cfg_output(9);
        func_mig();
        nrf_delay_ms(2000);
        func_mig();
        func_mig();
        // Initialize
        leds_init();
        timers_init();
    ...

But, if I programs this code with blank .ld files, I can toggle on/off with Leds.

Can you tell me step by step, how Can I make BLE device and connect to it with smartphones?

In other question cocoa told to me:

blank is used with bare nRF51 chip (it runs as a pure ARM Cortex M0), s110 used when S110 soft device (BLE stack) is programmed in flash memory.

To create a BLE device start with ble_app_template in SDK examples dir.

But How I can to program BLE stack in flash memory? And What exactly I must do after it?

Parents
  • You need first flash in the Softdevice (the stack) , known as S110 or S120 or S130, at location 0. It is downloaded from Nordic website. There is a .hex file. Then you flash in the ble app at location 0x1600. You can also download iOS & Android Apps from Nordic.
    For other nRF51example code with iOS code and getting started with Eclipse, go here nRF51 development with Eclipse

  • Thank you for your answer. In SDK archive I saw "s110_nrf51822_6.2.1_softdevice.hex" file and API-folder. But I can't to program this hex-file with open ocd(using command flash write_image s110_nrf51822_7.1.0_softdevice.hex). "couldn't open s110_nrf51822_7.1.0_softdevice.hex in procedure flash" - returns from openocd. How Can I flash it via openocd and st-link debugger?

Reply
  • Thank you for your answer. In SDK archive I saw "s110_nrf51822_6.2.1_softdevice.hex" file and API-folder. But I can't to program this hex-file with open ocd(using command flash write_image s110_nrf51822_7.1.0_softdevice.hex). "couldn't open s110_nrf51822_7.1.0_softdevice.hex in procedure flash" - returns from openocd. How Can I flash it via openocd and st-link debugger?

Children
No Data
Related