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

Cann't run the BLE code

Hi

I met a problem when I use my new board,I found that the example in the peripheral folder in SDK can run correctlly,but the the example in the ble_peripheral folder cann't work.Afterwards,I found that it is because the ble_stack_init() function.Pls see the attachment.image description(/attachment/fdae08a039f8b65fb17766e1a4d96923) The SDK I use is 8.0,S110_V8.0,and the chip is nRF51822 QFAC A 1506.I know the problem is not software problem.Also,I have checked the 16M crystal,which is 20ppm.

Anyone could tell me what reason may be?Thank you very much.

Parents
  • Do you have a 32kHz crystal on the board? If not, are you changing the ble init to use a synthesized 32kHz source?

  • You can step into ble_stack_init(), it's a function. How far through there do you get before it goes to the hardfault handler? It sounds like your previous reply, "yes it calls an error handler" wasn't what you meant, it goes straight to the Hardfault handler.

    Hardfault is not a hardware fault. It's what you get for accessing memory which doesn't exist, doing unaligned reads and writes and a variety of other things. You can pick apart the stack and figure out where you were when you went there, but it's tricky (but good practice).

    If you really have the same chip type (nrf51422 vs nrf51822 doesn't matter, just as long as you have the correct amount of flash and ram), and you put the softdevice, the same one, onto the board, there's no instant reason why it would hardfault, so you need to dig some more.

Reply
  • You can step into ble_stack_init(), it's a function. How far through there do you get before it goes to the hardfault handler? It sounds like your previous reply, "yes it calls an error handler" wasn't what you meant, it goes straight to the Hardfault handler.

    Hardfault is not a hardware fault. It's what you get for accessing memory which doesn't exist, doing unaligned reads and writes and a variety of other things. You can pick apart the stack and figure out where you were when you went there, but it's tricky (but good practice).

    If you really have the same chip type (nrf51422 vs nrf51822 doesn't matter, just as long as you have the correct amount of flash and ram), and you put the softdevice, the same one, onto the board, there's no instant reason why it would hardfault, so you need to dig some more.

Children
No Data
Related