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

Running BLE example using Segger Embedded Studio

@Michael Dietz

Hi Michael! I am not sure what happened to my last question regarding the BLE example using Segger Embedded Studio. It is no longer visible in the post comments.

I have now added the preprocessor definitions you mentioned. I am installing Keil on my Windows PC to check the definitions as well.

One other thing I noticed is that when I import the Blinky example into SES only one project is created in the Project Explorer, but when I import the ble_app_hrs_s132_pca10040 example two apparently identical folders are created...

Is that correct?

I have now tried to delete one of the folders and add/change everything as we have discussed and now I am able to compile and run the code.

When I open the nRF Toolbox App on the HRM screen the device is not visible though. I have downloaded and verified the s132 softdevice.

If I try to start a debug session I get a 'stopped by vector catch' error (0x7bc 4B01 ldr r3, 0x000007C4).

What can cause this issue?

  • EDIT: Did you connect to your device? In SES go to your project properties and change 'Target Connection' from 'Simulator' to 'J-Link'. Make sure you can properly conenct to your device in the file menu select 'Target' and 'Connect J-Link' after editing this project to makes ure you can. Although enterring debug mode will connect automatically.

    Not sure why its not visible but see my most recent answer to one of your questions that is: devzone.nordicsemi.com/.../

    You shouldn't need to install keil. An easier way is to look at the GCC makefile to get these definitions (they will be the same as in keil, you just don't need to download it). In YOUR_PROJECT/PCA_100XX/s132/armgcc open the Makefile and look for: CFLAGS = -DNRF52 CFLAGS += -DSOFTDEVICE_PRESENT

    You will see some defines denoted by -D'what_is_defined'. Just define these in your SES project (dont include -D). But note that SES gets these definitions from Keil by default so you shouldn't even have to do this. After you checked were the definitions different?

    As for the two folders, I have seen this too.. I just deleted one of them. I'll contact SEGGER about this.

    Sounds like you are close. 1.) Erase the entire chip. 2.) program softdevice. 3.) run and debug from SES.

    Once in debug mode make sure your application atleast gets to the first instruction of main.c. Then single step over functions. After stepping a few times you will get to ble_stack_init(); When you try to step over this function if your debugger doesnt return hit pause and you will most likley be in a hardfault. This means that there is a problem with the softdevice and we can go from there. tell me what you find

  • Hi Michael! Thanks. I have now erased all using nRFGo Studio and programmed Softdevice s132_nRF52_2.0.0-8.alpha successfully. When I run and debug I recieve 'Memory simulation error storing word to 0x200151f8', so I don't reach the first instruction of main.c. It stops on line 62 in system_nRf52.c just inside void SystemInit(void).

    Just before the error I can see that download was successful, so that part should be ok.

  • I actually forgot to change target connection to J-Link this time. I have imported the project several times today. I have changed it and it seems to connect fine under Target->Connect J-Link (I see Cortex-M4 r0p1 on J-Link in buttom status bar) Anyway now I am back to the initial error 'Stopped by vector catch' on 0x9d4 4B01 ldr r3, 0x000009DC.

  • hm. So are you getting to main when debugging or are you getting this error right away? In project properties, linker options, additional output format specify 'hex'. Now from nrfgo studio erase, program softdevice, program this hex (this hex should be in the Output->Debug->Exe directory in the same folder as your SES project file. Now see if it works. If it works then you know your problem is related to flashing & runing/debuging the program if it doesnt work you know that the problem is in the compiling

  • I never get to main, but get the error right away. I have nRFGo Studio on my Windows laptop (I couldn't install it using playonmac for some reason), but I am running SES from my Mac, so I can't chose a softdevice hex file from the same directory as my SES project file. Is that what you mean?

Related