What need to do to declare EXT interrupt STM32F722 family

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

ShmuelG
Posts: 6
Joined: Thu Oct 31, 2019 10:28 am

What need to do to declare EXT interrupt STM32F722 family

Post by ShmuelG »

Hi All,
I am an old embedded engineer, but first time work on ChibiOS system.
My board is STM32F722ze and I must to write UART EMULATION on GPIO. (Maybe anybody has this code on ChibiOS ?).
I have find STM32F4 project, which explains every step, but I stopped interrupt declaration.

I need the TODO list, which can explain me what I need to declare EXT1 interrupt (GPIO interrupt) on Chibios system.
I burned all the time to find information in the internet.

Please, help me.

Alex Gandin
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: What need to do to declare EXT interrupt STM32F722 family

Post by Giovanni »

Hi,

There is a contributed driver here: viewtopic.php?f=25&t=5256

Giovanni
ShmuelG
Posts: 6
Joined: Thu Oct 31, 2019 10:28 am

Re: What need to do to declare EXT interrupt STM32F722 family

Post by ShmuelG »

Hi mr. Giovanni,

I am glad to write you.
I didn't find anythings that can help me to understood my problem.
May you guide me exactly to place, where exist needed code?

Thanks,
Alex
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: What need to do to declare EXT interrupt STM32F722 family

Post by Giovanni »

Hi,

You should look at callbacks in the PAL driver, those use EXTI internally, there is no need to write an interrupt handler. See the demo under .\testhal\STM32\multi\PAL

Giovanni
ShmuelG
Posts: 6
Joined: Thu Oct 31, 2019 10:28 am

Re: What need to do to declare EXT interrupt STM32F722 family

Post by ShmuelG »

I think I didn't explain myself.

I have the following task - write UART emulator on GPIO.
I finished write code and understood that interrupt handlers to ONE GPIO and TWO DMA I cannot insert to code: it is very difficult task.
I do not need internal OS code, I need :
1 config GPIO as interrupt in Failing
2. When signal will fail (start bit of UART message), I must to call my function (interrupt handler)
3. DMA2 stream 2 should receive the data.

This is only

Please, help me

Alex Gandin
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: What need to do to declare EXT interrupt STM32F722 family

Post by Giovanni »

I don't understand if you want to use ChibiOS or not.

If yes, this is how you write ISRs: http://www.chibios.org/dokuwiki/doku.ph ... interrupts There are also lots of examples into the HAL device drivers.

Giovanni
ShmuelG
Posts: 6
Joined: Thu Oct 31, 2019 10:28 am

Re: What need to do to declare EXT interrupt STM32F722 family

Post by ShmuelG »

Hi All,
I understood my problem. Thank you very mutch.
But now I have next one:
I see that MAP file doesn't has DMA2 channel 2 interrupt handler (Vector128, number 58):
.text.VECTOR128
0x00000000 0x10 os\hal\ports\STM32\STM32F7xx\stm32_isr.o

I declared the interrupt handler of DMA2 channel 2 the following:

OSAL_IRQ_HANDLER(VECTOR128) {
OSAL_IRQ_PROLOGUE();
/* IRQ handling code, preemptable if the architecture supports it.*/

// chSysLockFromISR();
UART_EMUL_RX_DMA_IRQHandler();
// chSysUnlockFromISR();

/* More IRQ handling code, again preemptable.*/

OSAL_IRQ_EPILOGUE();
}

I am feeling that I didn't declare?
What didn't I declare I don't know?
Where is my problem?
Thanks
Alex
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: What need to do to declare EXT interrupt STM32F722 family

Post by Giovanni »

VECTOR128 is wrong, you need to give the exact name as defined in vectors.S.

It should be something like VectorC4.

Giovanni
ShmuelG
Posts: 6
Joined: Thu Oct 31, 2019 10:28 am

Re: What need to do to declare EXT interrupt STM32F722 family

Post by ShmuelG »

I really want to agree with you, but I took this definition from file:
..\os\hal\ports\STM32\STM32F7xx\stm32_registry.h

#define STM32_HAS_DMA2 TRUE
#define STM32_DMA2_CH0_HANDLER Vector120
#define STM32_DMA2_CH1_HANDLER Vector124
#define STM32_DMA2_CH2_HANDLER Vector128
#define STM32_DMA2_CH3_HANDLER Vector12C
#define STM32_DMA2_CH4_HANDLER Vector130
#define STM32_DMA2_CH5_HANDLER Vector150
#define STM32_DMA2_CH6_HANDLER Vector154
#define STM32_DMA2_CH7_HANDLER Vector158
#define STM32_DMA2_CH0_NUMBER 56
#define STM32_DMA2_CH1_NUMBER 57
#define STM32_DMA2_CH2_NUMBER 58
#define STM32_DMA2_CH3_NUMBER 59
#define STM32_DMA2_CH4_NUMBER 60
#define STM32_DMA2_CH5_NUMBER 68
#define STM32_DMA2_CH6_NUMBER 69
#define STM32_DMA2_CH7_NUMBER 70

Moreover, file vector.S has also Vector128.
I'm sorry to argue with you, but I have to understand.

P.S. If you know the right vector of DMA2 channel 2, I will be glad to accept it

Alex
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: What need to do to declare EXT interrupt STM32F722 family

Post by Giovanni »

Giovanni wrote:VECTOR128 is wrong, you need to give the exact name as defined in vectors.S.

It should be something like VectorC4.

Giovanni


Symbols are case sensitive in C.

Giovanni
Post Reply