ΣSigmaStudio Ask AI Русский Log in

BF706 GPIO interrupt issue

Processors & DSP Daniel2 Jan 10, 2017 00:00 2 replies Original on forum ↗
Thread Summary

Thread Summary

The user encountered issues with a BF706 EZ kit mini and CCES v1.1.1.0, including errors with the adi_initComponents() function, missing printf output, and non-functional GPIO interrupts. The core problem was resolved by disabling the utility room, allowing the GPIO interrupt to trigger correctly and the printf output to appear in the console.
AI Generated Content
Subscribe
Daniel2 Question
Jan 10, 2017 00:00

I am very new in Blackin programming and enconuntered some issues when I started my first program usin BF706 EZ kit mini. My CCES vesion is 1.1.1.0

1. when i create a project, and only add-ins Startup Code/LDF(1.0.0) in my project. using default setting.

there is only adi_initComponents(); function in Main(); but when i debug the program, below error occured. I don't know the utility of this function, i can only delected this funtion for my futher test.

2. I add " printf("printf test "); " ,of couse add #include <stdio.h> at beginning. i supposed that the string will appear in console window when i debug it, but the string not occur.

3. I want to test GPIO interrupt, and added a breakpoint at gpioCallback function. I supposed that when i push the button, program will access callback function,but it seem not. I check the register, the PINT1_REQ has been set when i push the button, but didn't trigger interruption.

below is the code.

#include <services/gpio/adi_gpio.h>

#define BUTTON_INT ADI_GPIO_PIN_INTERRUPT_1

#define GPIO_MEMORY_SIZE (ADI_GPIO_CALLBACK_MEM_SIZE*1)

static uint8_t gpioMemory[GPIO_MEMORY_SIZE];

void gpioCallback(ADI_GPIO_PIN_INTERRUPT ePinInt, uint32_t Data, void *pCBParam)
{
if (ePinInt==BUTTON_INT)
{
if (Data & ADI_GPIO_PIN_2)
{
//push button 1 - toggle LED
adi_gpio_Toggle(ADI_GPIO_PORT_C, ADI_GPIO_PIN_3);
}
}

}

int main(void)

{

uint32_t gpioMaxCallbacks;
ADI_GPIO_RESULT result;

result = adi_gpio_Init(
(void*)gpioMemory,
GPIO_MEMORY_SIZE,
&gpioMaxCallbacks);

// adi_initComponents();

result = adi_gpio_SetDirection(
PORT_C,
ADI_GPIO_PIN_2,
ADI_GPIO_DIRECTION_INPUT); //Set PC02 as button input

result = adi_gpio_SetDirection(
PORT_C,
ADI_GPIO_PIN_3,
ADI_GPIO_DIRECTION_OUTPUT); //Set PC03 as LED output

result = adi_gpio_SetPinIntEdgeSense(
BUTTON_INT,
ADI_GPIO_PIN_2,
ADI_GPIO_SENSE_RISING_EDGE);

result = adi_gpio_RegisterCallback(
BUTTON_INT,
ADI_GPIO_PIN_2,
gpioCallback,
(void*)0);

result = adi_gpio_EnablePinInterruptMask(
BUTTON_INT,
ADI_GPIO_PIN_2,
true);

uint32_t data;
while(1)
{
adi_gpio_GetData(PORT_C,&data);
if (data & ADI_GPIO_PIN_2)
adi_gpio_Set(PORT_C,ADI_GPIO_PIN_3);

else
adi_gpio_Clear(PORT_C,ADI_GPIO_PIN_3);

}

return ;

}

bf706

eb173cc118479f59617ca25fa6a278c2.bmp
eb173cc118479f59617ca25fa6a278c2.bmp
a544d73cf25c8b64999bd0b1dc7c96b2.bmp
a544d73cf25c8b64999bd0b1dc7c96b2.bmp
Daniel2 Reply
Jan 12, 2017 00:00

All the issues has been solved by disable the utility room.

EZAdministrator Reply
Aug 2, 2018 00:00

This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.

Thank you,
EZ Admin