arm,bluetooth-lowenergy,nrf51 , Nordic nRF51 DK on Mac with CrossWorks

Nordic nRF51 DK on Mac with CrossWorks


Tag: arm,bluetooth-lowenergy,nrf51

On OSX with Rowley Associates CrossWorks what are the steps needed to compile and run a simple BLE UART sample code for Nordic nRF51 DK to an iPhone.

I found iOS and Android code here and am comfortable with that part:

But I am not sure how to get the toolchain setup and running on the nRF51 board. I've seen some directions for SDK 6.x but can't find anything for SDK 7.x.


This is how I got it to work:

  1. Setup "nRF51 SDK"

  2. unzip "nRF51_SDK_8.0.0_5fc2c3a_packs/nRF_SoftDevice_S110/NordicSemiconductor.nRF_SoftDevice_S110.8.0.0.pack"

  3. Load "$nRF51_SDK_8.0.0_5fc2c3a/components/softdevice/s110/hex/s110_softdevice.hex" on nRF51 with

  4. In CrossWorks File->Import Project and select "$nRF51_SDK_8.0.0_5fc2c3a/examples/ble_peripheral/ble_app_uart" "Select Template" select "nRF51_EXE - ..."template list

  1. Remove "retarget.c" from project (it is easiest if you build now so you get the error)

  2. Select Project Item-> "Project 'nrf51422_xxac_s110'" in project explorer

  3. In "Properties Window" scroll down to "Linker Options" and set "Section Placement Macros" to:



Also make sure Properties Window->Target Loader Options->Can Erase All is set to "No"

  1. Select Build->nrf51422_xxac_s110...

9.5 Select Target -> Connect -> SEGGER J-LINK

  1. Select Debug->Go

Now apps can connect to the nRF51 DK board

Get the mobile app source code here.

See this post for more details.


How deploy an large number iBeacons

I want deploy a large number of iBeacons with the same UUID because we can't access dynamically to the UUID of the beacons detected. What is the limit number of the maximum Beacons with the same UUID ? I found some discussions with a number of 65000 approximately, is it...

My BLE Peripheral service not discovered on android with Samsung Galaxy Note 3

I'm creating a BLE peripheral on my Samsung Galaxy Note3 (API=21). The code seems to be reasonable and the device is discovered (slowly) but services can't be discovered (testing with LightBlue app on my mac) - it's waiting and waiting and no services are shown. Is this a hardware issue...

innerHTML output with Javascript template

For my project I have to scan BLE-tags and show their RSSI for proximity. The output of the BLEs is working with a JavaScript template. <body> <div id="header" data-role="header" data-theme="b"> <h1>BLE overview</h1> </div> </br> <div data-role="content" id="home"> <a href="#" data-role="button" data-theme="b" data-inline="true" class="pure-button initialize">Initialize</a> <a href="#" data-role="button" data-theme="b" data-inline="true" class="pure-button...

Beacons in Windows Phone 8.1 - there are no possibilities?

First of all, yes, i have read all other similar questions. Secondly, i am developing app (WP 8.1 WinRT), which must use Beacons. I read a lot about it, and i know, that generally connection with BLE device is not possible without pairing it first. But hope dies last, so...

Why Device Tree Structure (DTS) file is needed both in bootloader and kernel source code?

Bootloaders like U-Boot that do not implement the Open Firmware API, are expected to pass to the kernel a binary form of the flattened device tree - LinuxFDTBlob Why are the DTS files present in the kernel as well? Isn't that redundant? As an example, U-boot source code has...

ARM, GNU assembler: how to pass “array” arguments to execve()?

I was writing a simple shellcode that would call execve() for an ARM platform (Linux on Raspberry PI) and got stuck with the second argument to execve. As per documentation: int execve(const char *filename, char *const argv[], char *const envp[]); Which totally cuts it for me if I call execve("/bin/sh",...

BLE changing which UUID characteristic to write to

I'm very new to coding using Swift so I'm hoping someone can help me out with an easy answer. I'm basically trying to send a characteristic UUID into a write function and switch the write function to write to that UUID. It will just keep using the original one I...

neon:multiply and accumulate for 64 bit as IP & OP

Is there any way to implement below logic in neon . As I did not find any multiply and accumulate instruction for 64 bit input and output value . int64x2_t result; int64x2_t num1; int64x2_t num2; >> result + = num1*num2 << ...

What are the steps to setup an RTOS application on STM32 using Linux and Makefiles instead of using Windows based IDEs?

I am using STM32F4 Discovery board to develop a simple application to on-board accelerometer while simultaneously lighting respective LEDs mounted around the accelerometer device. I want to use any RTOS but I am unable to decide which one since I am new to using RTOS. If anyone could elaborate the...

Send a Android BLE GATT Notification

I´m currently developing an BLE application, based on the Gatt sample project provided by Google. What I want to realize is to send a notification from my Android device(smartphone) to another BLE device(e.g. TI CC2540). There are many discussion about how to receive a notification on the Internet. However, I...

Android: iBeacon - read its advertisement (e.g txPower)

I have a problem here right now as I'm trying to read the tx-Power from my Onyx iBeacon. I've read multiple suggestions and tried so many code on the internet, but I still can't figure this out. I'm using android lollipop and tried the iBeacon tutorial from for a...

What is the proper way to search for regions in CoreLocation with Swift?

I've been working with a number of tutorials and continuously have the exact same issue with each of them. When I run the following code or other incarnations of it in other tutorials, I keep getting: 2015-06-12 13:50:33.797 Scanner[4599:2593734] *** Assertion failure in -[CLLocationManager startRangingBeaconsInRegion:], /SourceCache/CoreLocationFramework/CoreLocation-1756.0.20/Framework/CoreLocation/CLLocationManager.m:1129 2015-06-12 13:50:33.798 Scanner[4599:2593734] ***...

Neon instruction, vsub_f32(a, b), is it a-b or b-a?

In this neon instruction (from here): float32x2_t vsub_f32(float32x2_t a, float32x2_t b); // VSUB.F32 d0,d0,d0 Does it return a - b or b - a? I cannot find it in the ARM documentation......

ARM conditional instruction setting flags

As I read about conditional execution in ARM, I can see why instructions in ARM do not set the flags by default. They seem to set flags only when the S suffix is added in. I was wondering if it would be possible to have an ARM instruction that executes...

How do I use Meteor and a Cordova BLE plugin to connect to a BLE device

I'm trying to use Meteor and this Cordova plugin - - added to my project using meteor add cordova in order to connect to a Bluetooth LE device (TI Sensortag). All I want to do to begin with is, when a link is clicked, to connect to the device and...

Difference between attributes and services in BLE

I would like to know what is the difference between attributes and service in GATT in BLE specification. and where we can find attributes, are they in service, caracteristics or in descriptors. thanks

How to share files with all other devices from my iOS device through application? [closed]

I want to share files/data from my iOS app to other devices (ios and android), which have the application installed, through wireless communication. Is it possible? Please help me.

Qt application trying to load platform plugin “xcb” instead of “eglfs”

Built Raspberry Pi 2 linux distro including Qt5.4 + QtWebKit + QML plugin using Yocto on fido branch See tutorial Testing with the following QML script [email protected]:~# more webkit3.qml import QtQuick 2.0 import QtQuick.Controls 1.0 import QtWebKit 3.0 ScrollView { width: 640 height: 480 WebView { id: webview url: ""...

How to convert unsigned char to signed integer by neon

How to convert a variable of data type uint8_t to int32_t using Neon? I could not find any intrinsic for doing this.

Prevent and catch access to secure memory from normal code

I am exploring the ARM trustzone on my imx53-QSB and I have a question. I shared the memory between the normal and the secure world. But when I try to access to read from a secure memory adress from the normal (like that : cprintf("Secure Data SD0: 0x%x\n", *R32 SD0);)...

BLE Device Name irretrievable

I have a project that is scanning for beacons that run on BLE. I can scan for the beacon and list them in a nice custom ListView just fine. However retrieving their names seems to not work. In my OnLeScan callback I use device.getName() which appears to always be returning...

Eclipse CDT shows … not resolved errors for ARM neon intrinsics, but produces the binary

I develop ARM-Neon based embedded software for Cortex A8 and A9 processors. I use Eclipse CDT Luna for development environment. I opened a project and added #include "arm_neon.h" at the beginning of my main code, and the following flags to both C++ compiler and linker miscellaneous flags part in project...

Cache and scratchpad memories

Could someone explain what is the difference between cache memory and scratchpad memory? I'm currently learning about computer architecture.

ARM assembly cannot use immediate values and ADDS/ADCS together

I am currently trying to speed up some of my C functions on a Cortex-M0 (Freescale KL25Z) using assembly. I get a problem with this minimal test program: @.syntax unified .cpu cortex-m0 .text .global test .code 16 test: mov r0, #0 adds r0, r0, #1 bx lr When I try...

How to divide the L2 cache between the cores on a ARM Cortex-A7?

Context and goal I'd like to run two fully standalone applications on my Olimex A20 Lime platform that run a ARM Cortex-A7. The goal is to dedicate one core to each application. So far so good. Now I'd like to divide the L2 cache between the cores in the following...

Cmake errors: The CXX Compiler identification is unknown, The C compiler identification is unknown

I'm trying to install OpenCV on Fedora 21 with a cross compiler for ARM processor. However, when i try to configure using Cmake 3.03, it gives the error: *The CXX compiler identification is unknown The C compiler identification is unknown Check for working CXX compiler: /opt/FriendlyARM/toolschain/4.5.1/bin/arm-linux-g++ Check for working CXX...

Android BLE readCharacteristic fails

I'm trying to read the initial state of a BLE device when I connect to it. Here's the code I have to try to do that: @Override public void onServicesDiscovered(BluetoothGatt gatt, int status) { if(status == BluetoothGatt.GATT_SUCCESS) { Log.i(TAG, gatt.getDevice().toString() + "Discovered Service Status: " + gattStatusToString(status)); for(BluetoothGattService service :...

Bluetooth LE app, how to build it cross-plaftorm (iOS-Android)?

I am working on an app that talks to a Bluetooth LE device. I would like some way to avoid developing it twice, for iOS and for Android. Is there a cross-platform app framework that has good support for Bluetooth LE? I have had a quick look at frameworks like...

No LR and SPSR for EL0 in Aarch64

In AArch64, There are 4 exception levels viz EL0-3. ARM site mentions there are 4 Stack pointers (SP_EL0/1/2/3) but only 3 exception Link registers (ELR_EL1/2/3) and only 3 saved program status register(SPSR_EL1/2/3). Why the ELR_EL0 and SPSR_EL0 are not required? P.S. Sorry if this is a silly question. I am...

Prelink Error: prelink-cross: simple hello world example

I am trying to cross-prelink a simple hello world program. I use the cross-compile toolchain arm-2012.03-57-arm-none-linux-gnueabi-i686-pc-linux-gnu and I am not sure if I have used the prelink-cross options correclty. I'll be glad if someone could point me to the right direction. More details about the source code on github. Thank...

C Global declared in ISR

I am evaluating Freescale's Kinetis Design Studio for their ARM series microcontrollers. I was looking at an example as a basis to do my first "blink an LED" project. When using variables shared between my main program and an ISR such as a counter, I would typically define a volatile...

Program Runs Fine for Hours and Eventually Seg Faults with Memory Address 0x10 [closed]

So I've been tracking some memory issue for the longest time. I'm coding in C++ and I can see that my program mostly works. I am monitoring my resources and I dont think I have a memory leak because my memory used stays below 12% (I'm on a system with...

iBeacon android app

I am busy with transmitting a Bluetooth Low Energy UUID via my Raspberry Pi. That setup is done and works to a satisfactory extent. But now my personal objective is to make a very simple android app, that catches this UUID and displays it on the android screen. So after...

Traversing a string using arm assembly inside V8 source

I am trying to implement a fastpath for regular expressions in arm/ in the RegExpExecStub::Generate function. The subject string is stored in the register 'r4'. I need to traverse character by character in the string but I can't seem to be able to do it. I have tried things like:...

Text as parameter in inline assembly (ARM)?

Is there a way to put plain text in inline assembly (ARM)? My problem is reading banked registers. The syntax is (r11 of user mode): mrs r0, r11_usr The problem is the "usr"-part. I tried: #define READ_REG_MODE(retvar, rg, mode) \ asm volatile (\ "mrs %[reg], r%c[rn]_%c[mod]\n\t"\ :[reg] "=r" (retvar)\ :[rn]"I"(rg),...

what's ARM TCM memory

what is TCM memory on ARM processors, is it a dedicated memory which resides next to the processor or just a region of RAM which is configured as TCM??. if it's a dedicated memory, why can we configure it's location and size?....

Xamarin iOS Bluetooth Low Energy - CBPeripheral.UpdatedCharacteristicValue reading TX characteristic shows unexpected data

I recently received a BLE device for Bluetooth to Serial. It uses TruConnect and I'm trying to get it to communicate with my serial device. The serial device receives communication over a serial cable and echoes back anything that is sent to it as well as any results from a...

What is __rw::__rw_deallocate?

I have an ARM application in which I occasionally get data abort or prefetch abort crash reports with __rw::__rw_deallocate(void*, unsigned int, int) at the top of the stack. What is this function and who owns it? Google turns up various linker and build errors related to this function, but my...

Bluetooth Low Energy: gattCharacteristic.getDescriptor() returns null

I have a problem with getting characteristic's descriptor, it always returns null. There is a chunck of my code: public static final String CHARACTERISTIC_UPDATE_NOTIFICATION_DESCRIPTOR_UUID = "00000001-0000-1000-8000-00805f9b34fb"; public final static UUID tmp_uuid_1 = UUID.fromString(CHARACTERISTIC_UPDATE_NOTIFICATION_DESCRIPTOR_UUID); ... BluetoothGattDescriptor descriptor = gattCharacteristic.getDescriptor(tmp_uuid_1); descriptor.setValue(true ? BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE : new byte[]{0x00, 0x00}); I tried this on...

writeCharacteristic() returns true, but does not call onCharacteristicWrite()

I wish to read a characteristic value stored in a device, modify the value, and then write it to the device. For some reason, writeCharacteristic() return true, but the internal device value does not change and onCharacteristicWrite() is not called. In fact, for some reason it is only called if...

I am unable to set the compiler path for opencv library.

I want to cross compile my C++ opencv code into ARM A8 cross compiler, I already made an cross compiling environment for it and I did changed the paths in CMake gui as well. I am easily able to run a normal C++ code into it. But when I am...

Third Estimote beacon triggered by startMonitoringForRegion does not receive didEnterRegion or didExitRegion

In my app delegate I am registering to receive updates for didEnterRegion and didExitRegion. Specifically, in didFinishLaunchingWithOptions I declare and register to the beacons like so: //Setup the beacon monitoring CLLocationManager *locationManager = [[CLLocationManager alloc] init]; locationManager.delegate=self; for(CLRegion *r in locationManager.monitoredRegions){ [locationManager stopMonitoringForRegion:r]; } self.beaconManager = [[ESTBeaconManager alloc] init]; self.beaconManager.delegate...

Code using indirect assignment not working

On an embedded ARM system I have implemented a register system: Each register is an array of uint8_T The host system can set either one register or more registers at the same time, by issuing a specific command on the serial port of the CPU. This is the code, stripped...

Did anyone compiled GSL for androind?

I am trying to compile gsl for android but it is giving error. I checked on their website and they said that It has been reported to compile on the following other platforms, SunOS 4.1.3 & Solaris 2.x (Sparc) Alpha GNU/Linux, gcc HP-UX 9/10/11, PA-RISC, gcc/cc IRIX 6.5, gcc m68k...

LPC17XX SPI: Implementing pulse-sensitive(edge-triggered) interrupts

I would like to implement a pulse-sensitive, aka edge-triggered, interrupt on an LPC1759 microcontroller. In the UM10360.pdf datasheet and ARM Cortex-M3 user guide, it says that interrupts can be triggered based on level- or pulse-sensitive behavior, but I am unable to find how to set this to be pulse-sensitive. Can...

Installing libraries for arm-gcc-compiler

I have a functional arm cross compiler that I can use with arm-linux-gnueabi-gcc command. This works for simple programs but I run into problems when I have to compile bigger programs requiring libraries like x11, opengl as the required headers/files are not present in arm-linux-gnuebi directory but in normal gcc...

QEMU with Linux build with custom toolchain

I am running Debian and have built my arm toolchain by hand. When I build the Linux kernel using my toolchain QEMU fails to build. If I use the recompiled toolchain that comes with Debian everything works fine. Any idea what I could be doing wrong or how to debug?...

Flashing a C program to ARM

I just started programming for an ARM Processor and I have never been this clueless. There are a couple of example projects that came with the board (ADucm350) and I wanted to upload one of them. I downloaded Keil (or I think it's just the project management software part of...

Swap the two middle bytes of a word using 4 ARM instructions

The task is to write code in arm assembler using no more than 4 instructions that swaps the two middle bytes in a given 32-bit word. For example if the word is 0xAABBCCDD the result should be 0xAACCBBDD. You may use at most 4 arm instructions from the set AND,...

JTag Debugging with Eclipse Mars CDT : “Program file does not exist”

I have successfully compiled an ARM embedded project, next files has been created: MyProject.elf MyProject.bin MyProject.hex MyProjectmd5.bin Then I am going to Run -> Debug Configurations -> GDB SEGGER J-Link Debugging -> New -> Debug and I get the error: Program file does not exist The GCC Compiler for...