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.

Moderators: barthess, RoccoMarco

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

What need to do to declare EXT interrupt STM32F722 family

Postby ShmuelG » Thu Oct 31, 2019 10:41 am

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: 13125
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 769 times
Been thanked: 653 times
Contact:

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

Postby Giovanni » Thu Oct 31, 2019 11:57 am

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

Postby ShmuelG » Thu Oct 31, 2019 12:47 pm

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: 13125
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 769 times
Been thanked: 653 times
Contact:

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

Postby Giovanni » Thu Oct 31, 2019 1:18 pm

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

Postby ShmuelG » Thu Oct 31, 2019 2:02 pm

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: 13125
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 769 times
Been thanked: 653 times
Contact:

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

Postby Giovanni » Thu Oct 31, 2019 6:26 pm

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

Postby ShmuelG » Mon Nov 04, 2019 8:33 am

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: 13125
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 769 times
Been thanked: 653 times
Contact:

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

Postby Giovanni » Mon Nov 04, 2019 8:38 am

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

Postby ShmuelG » Mon Nov 04, 2019 9:15 am

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: 13125
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 769 times
Been thanked: 653 times
Contact:

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

Postby Giovanni » Mon Nov 04, 2019 9:17 am

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


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 9 guests