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

Adevertisement stop when twi_master_init(void) called

Hi we are using NRF51822 board.

i flash ble_app_hrs application. then it is giving advertisement.

but when i call twi_master_init() function from main. advertisement stop.

i used sd api in place ppi also.

Can anybody tell me what will be issue.

Regards Balaji

  • it is because when i call

    err_code = sd_ppi_channel_assign(0, &(NRF_TWI1->EVENTS_BB), &(NRF_TWI1->TASKS_SUSPEND));

    in twi_maaster_init() , going to HardFault_Handler in arm_startup_nrf51.s

    we are using custom nrf51822 board

    can you say what will be issue.

  • From where exactly do you call this? If you call a softdevice API function from a high-level interrupt (i.e. priority higher than 2), that will cause a HardFault, as described in the Appendix of the Reference Manual.. Could that be the issue here?

  • Hello Ole,

    i ran into the same issue and read the manual but somehow find a proper solution. Maybe you can help me out? I was trying to read the twi, which is working fine, and since both things (TWI and advertisement) are not working wanted to disable twi via NRF_TWI1->ENABLE=0; but this is not sufficient.

    Regards

    BTW: A lot of people have issues like that - is there any chance to pin the solution to a solution based section?

  • The TWI is currently problematic, due to the way it uses the PPI. Unfortunately, this is a workaround for issues with the first revision silicon (PAN #36), and for backwards compatibility, we've chosen to keep those in the SDK for now.

    However, if you have a second revision chip, you can avoid the PPI use in twi_hw_master.c completely, and instead use the shortcuts (SHORTS register).

    You're not very clear on the details, so I suggest you post your problem separately. It may be that the symptoms are similar, but the cause may be different, and I'd hence prefer to keep it separately.

    In general, each answer on this site should be a solution to one problem, and adding some kind of separate solution-section seems to defeat the purpose. Good questions and answers should be voted up instead!

  • Damn indeed - we have the C0 revision here at our side. Since we own even not only some of them, is there any chance to still use that version via TWI?

Related