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

Radio issue when migrating from Keil to SES on usbd_cdc example

I am having an issue migrating some code over from Keil to an example in SES studio.

The code in Keil  is simply listening for a radio packet, when it receives it, it transmits a message over the serial port.  I did this "bare metal" by just programming registers, no issues.  There is simply a radio_setup() function as well as the standard void RADIO_IRQHandler(void) function.  

I am moving over to SES starting with the usbd_cdc_adm_pca10056 example as I would like to spit these messages out over USB, not serial.  The usb code works fine.  

Now, when I put in the radio_setup() function and void RADIO_IRQHandler(void) into the SES code, the interrupt will not trigger.  I cant seem to figure out why.

So far I have stepped through the code to make sure the radio registers are being configured, it is working.  I have also verified that there are packets for the radio to capture (have another pca10056 next to it running the Keil version).  So there is something with the SES code that is causing the problem.  Any suggestions?

Thanks

Parents
  • Hi

    Which version of the SDK are you on?

    Have you tried the Keil project files from the usbd_cdc_acm_pca10056 example also, to verify if it is the Keil/SES change, or the change to the usbd_cdc_acm project, that is causing the issue?

    Does the project compile in SES without any warnings?
    Warnings in SES can sometimes be hard to spot, but can be quite serious (like forgetting to reference/dereference a pointer). 

    Best regards
    Torbjørn

Reply
  • Hi

    Which version of the SDK are you on?

    Have you tried the Keil project files from the usbd_cdc_acm_pca10056 example also, to verify if it is the Keil/SES change, or the change to the usbd_cdc_acm project, that is causing the issue?

    Does the project compile in SES without any warnings?
    Warnings in SES can sometimes be hard to spot, but can be quite serious (like forgetting to reference/dereference a pointer). 

    Best regards
    Torbjørn

Children
  • So I moved back to keil using the usbd_cdc_acm_pca10056 example.  I took the radio_setup() function and the radio IRQ handler and put them in a blank project to make sure that just call that function will setup everything I need.  It worked, so I put the code into the keil usbd_cdc_adm_pca10056 example, and the radio will not receive packets.  Its calling the setup function and setting up the IRQ in the NVIC but nothing.  When I poll the radio for a read packet instead of setting up the IRQ, it will not receive a packet.  Is there something in the example template that is messing with the radio? An errata maybe?

  • Ive also captured the Radio registers from the working example, and compared them to the RADIO examples of the usbd_cdc_acm_pca10056 that Ive modified.  They are the same.  What am I missing?

  • Hi 

    Could you try reading the NRF_CLOCK->HFCLKSTAT register to see if the external 64MHz clock is running?

    I would expect it is running if you use USB, but this is a quite common issue when starting a new project with a proprietary protocol. 

    Best regards
    Torbjørn

  • So it was definitely something with the clock.  I changed the radio setup function to something I knew was working and it seems to be receiving packets as well as doing usb, although, Im not sure what the problem actually was. This is with usb only working

      

    This is with USB and Radio working...

  • Hi

    It's good to hear you got it working, but I am also unsure why it happened ;)

    It seems the external 64MHz clock is running in both cases, which is what I expected might be the problem. 

    The only difference between the two cases as I can see is that in one example the external 32.768kHz crystal is used, and in the other case you use the internal LF clock source?

    If you are able to add the two radio setup functions (the not working and the working one) I can take a look to see if I spot any important differences. 

    Best regards
    Torbjørn

Related