MKW01xx DIO0/DIO1 interrupt

cancel
Showing results for 
Search instead for 
Did you mean: 

MKW01xx DIO0/DIO1 interrupt

881 Views
mircopizzichini
Contributor III

Hi

I'm using MKW01 with Radio Utility firmware. I've correctly routed DIO0/DIO1 to PTC3/PTC4, but when I want to send a packet, the only interrupt generated is the TxFifoLevel related to DIO1. My packet (10 byte length) is splitted in two blocks, but then I never received the PacketSent interrupt on DIO0.

1) Could it be a software problem? If there's a version for pre-production chip, I can test it on Reference Board

2) Does it still works without connections to PTC3 and 4?

Thank you

Labels (1)
0 Kudos
10 Replies

285 Views
mircopizzichini
Contributor III

CesarM, maybe you can be helpful...

I noticed that when PTC3 is asserted, indicating TxPacketSent, the interrupt handler is still PhyTxHandleFifoLevelEvent and not PhyTxPacketSentEvent.

So in PhyISR.c, I think should be

void PhyTxHandleFifoLevelEvent(void)

{

  if(mPhyTxIsrParams.remainingLength > 0)

  {

    MKW01Drv_FillFifo();

    gpfPendingTxEvent = PhyTxHandleFifoLevelEvent;

    if(mPhyTxIsrParams.remainingLength == 0) {

        gpfPendingTxEvent = PhyTxPacketSentEvent;

        MKW01Drv_IRQ_DIO1_Disable(); 

     }

  }

}

Because in this way, when Fifo has been properly filled with all outgoing byte, PhyTxPacketSentEvent becomes the new PendingEvent, and when there's a transmission complete interrupt from PTC3 (DIO0), flag bPcktHandlerTxDone can be set TRUE.

Tell me if it can be right, old version (the one downloaded from freescale website) doesn't work on my board...

Thank you

0 Kudos

285 Views
CesarM
Contributor III

Hello,

To disregard any HW problem please refer to the connections on the MRB-KW01 board.

You can have access to the schematics on the followig site:

http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MRB-KW0x&fpsp=1&tab=Design_Tools_Tab

"MRB-KW0x Design Files: Hardware Schematics, Gerbers, and System BOM"

SPF-27792_D.pdf

In regards of the Packet Sent Interrupt via DIO0:

The actual code for all Application demonstration projects uses the "PhyTxHandleFifoLevelEvent" as it is,

so I don't think this is the root cause for what you are experiencing.

Basically the actual code on that function checks if there is any byte left on the payload otherwise the TxPAcketSentEvent is generated.

During debug mode check the status of mPhyTxIsrParams.remainingLength, if PhyTxPacketSentEvent is not being executed then it means that the FIFO is still being filled.

Put a breakpoint inside this condition:

  else

  {

    gpfPendingTxEvent = PhyTxPacketSentEvent;

    //FifoLevelMask

    MKW01Drv_IRQ_DIO1_Disable();             

 

  }

to determine if you are ever reaching it.

This might be more helpful than monitoring the activity of DIO0, that you now know that is ocurring.

Running the Radio Utility Application demonstration as it is will require that your board is setup as the MRB:

- 32MHz crystal connected to XTB/XTA

- UART0 port used for the terminal interface

- DIO5/CLKOUT signal connected to PTA18

0 Kudos

285 Views
mircopizzichini
Contributor III

Ok, thank you Cesar

I put a breakpoint in that condition, and I correctly reach it. But then, an interrupt on DIO0 is never asserted, while DIO1 (FIFO filled) is occurring three times (because my packet is 18 byte length).

I use hw configuration as the MRB, with just two differences:

- UART2 instead of UART0 (but I checked that it works correctly, I can communicate with a serial terminal on PC)

- PTA4 instead of PTA20 (but I changed PIN inizialization to make it work, and I think it's right because I can correctly read internal transceiver registers)

So I don't think it is an hw problem.

I've also tested Radio utility on MRB, but it doesnt work as is.

In Platform_Init, I can not even read transceiver internal registers (MKW01Drv_ReadRegister). Maybe there are other fw versions I could test?

0 Kudos

285 Views
CesarM
Contributor III

Hello mircopizzichini,

Sorry for the delay on the reply, I didn't receive a notification that you replied :S

It doesn't sound right that the Radio Utility Application is not working even on the MRB so I'm thinking you might have an old version of the firmware? (Not sure)

Just to be on the same page in regards of the version of the demo you have, please download the MKW01 Board Support package from the following site:

http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MRB-KW0x&fpsp=1&tab=Design_Tools_Tab

Under section "Operating System Software-Board Support Packages" download the followng: KW01 Board Support Package.

That file contains the latest version of the Radio Utility source code.

0 Kudos

285 Views
mircopizzichini
Contributor III

Hi CesarM

I've just received the MRB with the correct chip. Now I'm testing the firmware you linked me, but I think there's a wrong configuration.

In project options, why target device is Freescale MKL25Z128xxx4? Chip configuration is different! In derivative.h there is:

#include "MKL25Z4.h"

In this way, SPI doesn't work: debug stops at WaitSPITxBufferEmpty. I discovered that SPI registers configuration are different: SPI data register of MKW01, or MKL26, is at 0x40076000, while in MKL25Z4 is declared at 0x40076004. Indeed

typedef struct SPI_MemMap {

  uint8_t C1;                                      /**< SPI control register 1, offset: 0x0 */

  uint8_t C2;                                      /**< SPI control register 2, offset: 0x1 */

  uint8_t BR;                                      /**< SPI baud rate register, offset: 0x2 */

  uint8_t S;                                       /**< SPI status register, offset: 0x3 */

  uint8_t RESERVED_0[1];

  uint8_t D;                                       /**< SPI data register, offset: 0x5 */

  uint8_t RESERVED_1[1];

  uint8_t M;                                       /**< SPI match register, offset: 0x7 */

} volatile *SPI_MemMapPtr;

So I corrected manually these struct, replacing it in my header file, and adding

#include "MKL26Z4.h"

But now debug stops at WaitSPIRxBufferFull, so waiting

while(!(SpiRegs->S & SPI_S_SPRF_MASK));

Is there something wrong or I'm missing something?

Thank you

Mirco

0 Kudos

285 Views
CesarM
Contributor III

Hi,

What Application demo and board do you have?

If  you download the KW01 Board Support Package (which includes Radio Utility Application Demo source code) from the downloads tab in the MRB-KW0x website (www.freescale.com/mrb-kw0x) the derivative.h file contains #include "MKL26Z4.h" 

This demo is suited for any of the MRB boards (NA, EU)  available for sale in the website.

0 Kudos

285 Views
mircopizzichini
Contributor III

Sorry, I didn't answer your question

I'm using Radio Utility Application Demo, the board is MRB-KW019032.

In project general options, target device is "Freescale MKL25Z128xxx4", so I changed it to "Freescale MKW01Z128xxx4".

I flashed the firmware as well as I downloaded it, but I've an infinite waiting (as written above) because in SPI initilization, SPTEF (or SPRF) is never set before performing a write (or read) operation.

Do you have the same issue?

0 Kudos

285 Views
CesarM
Contributor III

Hi,

I have the same board (MRB-KW019032), I have followed the steps you mention (In project general options, target device is "Freescale MKL25Z128xxx4", so I changed it to "Freescale MKW01Z128xxx4")

And I'm able to run the project without the issue you mention.

This leaves room for the following:

1) Make sure you have the jumper settings in the MRB-KW019032 as indicated in the Quick Start Guide.

http://cache.freescale.com/files/microcontrollers/doc/user_guide/MKW01DEVPLATQSG.pdf?fpsp=1

2) In the BSP make sure you are loading the following source code: Radio Utility_SW_NA

I have attached a video with the steps I did to run the project

.

This video is currently being processed. Please try again in a few minutes.
(view in My Videos)

0 Kudos

285 Views
mircopizzichini
Contributor III

Mmm, you're right... Maybe I made a change that should not be done. Now i've re-downloaded it, but the problem still remains.

In platform initialization (main, line 275) I call MKW01Drv_ReadRegister(...), but debug stops here, waiting Tx Buffer Empty

while(!(SpiRegs->S & SPI_S_SPTEF_MASK));

0 Kudos

285 Views
mircopizzichini
Contributor III

Thank you Cesar. I think the problem is that I've an old version of the MRB (with the preproduction chip and the ENG sign on it). Now I've just ordered those with the new chip, the one on which Radio Utility Application has been developed. When I have the board, I'll test it with the newest firmware. I'll let you know. Bye

0 Kudos