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

micro esb and ble on 130 v2 project

Hi, Because I didn't want to keep with the last question when this is a tottaly new one, so created another question. I've tried to get this project to work:

github.com/.../nrf51-ble-micro-esb-uart

It doesn't compile from start. I'm missing bsp.c.h files, I'm having an error on the app_timer_init setup call. To get this project up I've used sdk 10 and 9.0 and as result none of the combinations works. When ignoring the bsp include and changing the app_timmer_init to something like: "APP_TIMER_INIT(APP_TIMER_PRESCALER, 5, 0);" it compiles. Tried to get it working along with s130 1.0 and 2.0 but keeps running into hard_fault. (Yes I took in consideration the different sizes of the SDs, setting the correct memory start address on the project defenitions )

Is there any chance you can point me to a full project that I can just download and get working? Thank you for your attention and help, looking forward for your reply.

Parents Reply Children
  • Hi, welll I was expecting to see the code just compiling and running without effort as it come os a zip file. Haven't changed or modified anything at all, just compiled and run. This is the code I'm referring to devzone.nordicsemi.com/.../7ff342e0aba602ed11cfc5d87f73e3e3

    When entering hard fault it points the error being when

    oid TIMESLOT_END_IRQHandler(void) { uint32_t err_code;

    // Timeslot is about to end: stop UESB
    
    err_code = uesb_stop_rx();
    if (err_code != UESB_SUCCESS)
    {
        // Override
        NRF_RADIO->INTENCLR      = 0xFFFFFFFF; <<--- JUMPS TO HARD FAULT
        NRF_RADIO->TASKS_DISABLE = 1;
    }
    
    uesb_disable();
    
    m_total_timeslot_length = 0;
    

    }

  • Right, So I've been around and around the disassemble and some tick counters and concluded that the end of time slot request was being done to late, or so it seems. So, instead of using the end of slot interrupt setting and handler to end the time slot, I've called the end of time slot directly from the soft device timer0 interrupt signal, and this sorted the situation!

    Then piped the uesb rx data to the ble tx and the ble rx to the uesb tx and can now have 2 devices connected messaging to each other through ble piped through uesb.

    I'm still trying to understand exactly if the hard fault was due to end of slot irq being happening after slot timeout or if there was something else going on...

    Any who, this is where I'm now. Please advise about calling the end of slot from inside the SD timer0 handler.

    Thank you

  • Maybe you are getting an hard fault due to one of the reasons mentioned here: devzone.nordicsemi.com/.../

    Are you getting hard fault right away, or does it happen when you communicate to another uESB device?

  • This sounds like you have a softdevice assertion, but it is not caught by your assertion handler. Looking at the project you attached, the assert_nrf_callback is unfortunately removed by the linker as "unused" when using armcc. If you add attribute((used)) infront of the function definitition in main.c, the softdevice assertion should be reported.

    One reason to get a timeslot assertion right away is if the radio peripheral was left in an undefined state, so that it's generating unexpected interrupts, and this can happen if you have increased the UESB_CORE_MAX_PAYLOAD_LENGTH beyond 243 in the application you have provided. Once the radio is in an undefined state, you should isolate it (turn off the peer), your application, and pin reset (or powercycle).

  • Hi, thanks for the tips on the attributes,

    Unfortunatly that wasn't it. I declared the assert function at main.c with attribute((used)) but stil goes into hard fault. The UESB_CORE_MAX_PAYLOAD_LENGTH is 100 so, if the radio is on some sort of zombie state this won't be the reason. For now I'm making a direct call from inside the events_handler of uesb_timeslot it self, as for the moment fixes the issue., but still have no clue why using the quadrature interrupt as set on the code, doesn't work. Once again, thank you for the help, just afraid this issue will affect more people as they download this code.

    Regards

Related