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

GPIO not working with SD

Hello,

I have configured a 1 ms timer (Timer 2) interrupt. I am just updating some static variables for reference in the 1 ms interrupt. Everything seems to be working fine here (SD enabled). However I tried to toggle one of the GPIO pins in the 1 ms interrupt routine every 6 ms. Looks like this does not go well with SD. The control is in SD and is not returning to any one of my functions. I am not sure what the problem is. After this the SD stops broadcasting and nothing works. After I reset the controller via debugger it starts broadcasting and the same thing repeats.

Are there known issues in this regard? If not then can anyone let me know what might be the problem? I am not sure if I have given sufficient details. If not do let me know.

I am using: SD: 7.1 SDK 6

Thanks in advance!

Parents
  • What you are trying to achieve is basic and that should work otherwise there would have been a lot of reports here regarding that. I have verified this on SDK 7.2 with just one advertiser and there were no problems with the gpio. I verified even with 0.1ms timer interrupt and it just worked fine.

    post your code here and I can check for you.

  • I copied your timer logic into my test and it worked just fine even with 7.1. There must be something else that you must be doing wrong with advertiser (not related to Timer initialization and not related to timer interrupt handler)

    I would however suggest you to set your timer interrupt priority to lower

    	NVIC_SetPriority(TIMER2_IRQn, APP_PRIORITY_LOW);
    	NVIC_ClearPendingIRQ(TIMER2_IRQn);
    	NVIC_EnableIRQ(TIMER2_IRQn);
    

    Please note that on Cortex-M0

    Out of reset, all interrupts and exceptions with configurable priority have the same default priority of zero. This priority number represents the highest-possible interrupt urgency.

Reply
  • I copied your timer logic into my test and it worked just fine even with 7.1. There must be something else that you must be doing wrong with advertiser (not related to Timer initialization and not related to timer interrupt handler)

    I would however suggest you to set your timer interrupt priority to lower

    	NVIC_SetPriority(TIMER2_IRQn, APP_PRIORITY_LOW);
    	NVIC_ClearPendingIRQ(TIMER2_IRQn);
    	NVIC_EnableIRQ(TIMER2_IRQn);
    

    Please note that on Cortex-M0

    Out of reset, all interrupts and exceptions with configurable priority have the same default priority of zero. This priority number represents the highest-possible interrupt urgency.

Children
No Data
Related