This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SimpliciTI. Understanding the receiving interrupt and the callback function

Other Parts Discussed in Thread: SIMPLICITI

Hi to all,

I am a noob in SimpliciTI, and I am having troubles to understand how SimpliciTI works with the reception frames. I have an AP (as data hub) and an ED. Each device with different address. I am using the supplied code by TI: "main_AP_Async_Listen_autoack.c"

Reading the documentation, SMPL_Init(scB),  provide a callback function (scB) to handle received frames.

In an AP scenario, according to documentation, when first SMPL_Init(scB) (whose lid = 0) is called,  it indicates that the AP should execute a SMPL_LinkListen() to receive the link frame. So, in the code, we enter in a "while (1)" waiting for a sJoinSem setting, that indicates a reception of a join frame. This "sJoinSem" is incremented on the callback function, if there is not a identification of peer as a function argument. Sometimes in my tests, this flag increments (I do not know if it is an erratic behaviour or  it really establishes a connection ), but when the listening moment is reached, a SMPL_TIMEOUT is returned.

One of my problems is that, the callings to scB. The commented line up of the function definition says "Runs in ISR context", and here, my confusions start. I know that SimpliciTI only have one interrupt, the RX interrupt which goes high the GDO0 signal and this GDO0 signal runs the MRFI_GpioIsr() which, according to some threads in this forum: "part of the interrupt service between the radio and MSP430 (...). Upon this interrupt, the MSP430 will retrieve the received data from the radios FIFO memory and store it in the input queue". In other hand, the solution overview in the main_AP_... file says "The Rx callback must be implemented".

So, my doubt, and sorry if it is very basic, is scB called automatically when ISR occurs? (sJoinSem is set on my test, but it never gets a successful listening) or do I have to implement it in some place of the code? In this last case, how should I do to use the scB? If I set a breakpoint before the ISR, I watch in "mrfiIncomingPacket" the ED address, ports and other parameters sent in the packet, but I do not know how  I could use them. I do not know how I can find or pass the argument to the scB function (to identify a peer) or if it is supplied automatically and where do I have to do, if it is required and not only a supposition done by me.

Sorry for this large post, but I have to try to explain it clearer as possible.

Thanks in advice.

  • Please, any help to understand the callback functionality. I do not know when the function sets the sPeerFrame, is to say, I know that it needs the argument lid that it is the ID of each end device, but I do not understand where I can find it/when I have to pass this argument or if it is automatic like the setting of a interrupt flag in the uC.

    I need your help, thanks.

  • Well, in these days I have done some advances. I know where the callback function is called and how the GDO0 signal works. But I am still having troubles.

    The callback function is called by first time, and then it sets the sJoinSem (it is correct). I see the incoming packet and the output packet in CCS debug window; and addresses, ports, request reply in payload, etc matches with the Simpliciti Specification, however the code gets stuck in the SMPL_LinkListen line.

    Meanwhile in the End Device side, when the the AP recognizes the join request and set the sJoinSem, the ED seems to reset. If I stop the code in the CCS, the code gets stuck in a while loop to setup the crystal, it seems that a oscillator fault has occurred, but watching the waveforms of the end device, there are risings of GDO0 pin with the timing that I have configured.

    I hope that someone can give me a guideline or advice.

    Thanks.

  • Hi Is T da S
    This time, I meet same question like you, when I reset ED, the GDO0 INT is occured, but the callback function cannot be trigged, the sJoinSem++ cannot be reached, and I don't know why, I hope you can help me,
  • Hi,

    I have worked in this project almost three years ago, so my understanding is a bit away.

    Looking to the date of my post, I could say that my main problem in that time had been that I was not "installing" the stack correctly. After a lot of problems, I decided to rebuild and add the stack from scratch and step by step, and in this way, all started to work properly.

    So if you are using one of the uC which are not sold with SimpliciTI and you need to add the stack to the project, start again and step by step create a new project, do not copy folders from the AP project to ED and viceversa to save time, this was my great error and I wasted a lot of time looking to GDO0 in the oscilloscope with any results or even with an incorrect suppositions.

    Other recomendations could be to check the HW configuration if you are using a non-default configuration.

    Sorry for the delay response.