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

sd_ble_gatts_hvx() no return

Now i use sd_ble_gatts_hvx() to send data,it can not return anything while call this function. Step by step trace this function,while it run to code address 0x00016432,function compare two data,one data is store in 0x00016478( data value is 0xDEADBEEF),another data is store in 0x2000012c(data value is 0). If compare result is not equal ,function will fetch HardFault_handler entry and goto HardFault_handler. if manual update this data value from 0x00000000 to 0xDEADBEEF that store in 0x2000012c ,made it compare result is equal.then function is ok. What should i do to solve this program ?

Thanks!

Parents
  • Seems like a softdevice assert and call to assert_nrf_callback in your application. It is hard to say what caused this assert. Can you post your code?

  • You can call that from the GPIOTE event handler ... as long as the GPIOTE event handler runs at a ''lower'' priority than the SVC handler. That means GPIOTE handler must run at APP_LOW (priority 3) as the SVC handler runs at priority 2. If your GPIOTE handler is currently running at APP_HIGH (priority 1) then that's why you're getting the hardfault; you can't execute a SVC instruction from a higher priority context.

    If however that's what you were doing, the CPU would have gone directly to hardfault and not run any of that assembler, as soon as the SVC was executed, the CPU jumps directly there.

Reply
  • You can call that from the GPIOTE event handler ... as long as the GPIOTE event handler runs at a ''lower'' priority than the SVC handler. That means GPIOTE handler must run at APP_LOW (priority 3) as the SVC handler runs at priority 2. If your GPIOTE handler is currently running at APP_HIGH (priority 1) then that's why you're getting the hardfault; you can't execute a SVC instruction from a higher priority context.

    If however that's what you were doing, the CPU would have gone directly to hardfault and not run any of that assembler, as soon as the SVC was executed, the CPU jumps directly there.

Children
No Data
Related