Notifications
Clear all

Help with adding a new interrupt source to the PIC

 

(@ruiferreira)
Active Member
Joined: 2 months ago
Posts: 4
Topic starter  

I am trying to use a specific signal to generate an interrupt.

Any help on how I can do that?

I read through the Lab09, but it only shows how to use the GPIO and PTC interrupts.

 

Also, is there any guides on how to handle the inturrpts using zephyr's ISR?


   
Quote
dchaver
(@dchaver)
Member Admin
Joined: 3 years ago
Posts: 90
 

Hello Rui,

You should modify the SoC in order to add another interrupt source. Let me first explain how we handle GPIO and PTC interrupts:

In module swervolf_core we provide the available external interrupt sources into the VeeR core in this line: 

image

In module swervolf_syscon we configure the sw_irq4 and sw_irq3 external sources as follows:

image

This lets you use either software interrupts or GPIO/PTC interrupts. Note that the irq_gpio_enable and irq_ptc_enable bits are established below in that same module:

image

So, you could do the same with any other interrupt source that you want to add to your SoC. Note that you have two options:

  1. The easiest would be to replace one of the two current signals (GPIO or PTC) with the one you are introducing.
  2. A slightly more complex option would be to add your signal as a new external source.

Please let us know if this is enough for resolving your question.

Best regards

Dani

This post was modified 2 months ago by dchaver

   
ReplyQuote
(@ruiferreira)
Active Member
Joined: 2 months ago
Posts: 4
Topic starter  

Thank you for you reply.

The peripheral i want to trigger the interrupt is not connected to the wishbone interconnect. I have a new perpheral designed with vitis hls connected to the axi interconnect.

Should i still use the system controller to setup the interrupt signal or do i just connect it to the pic?

 

In the examples of lab06 the interrupts are used only with a platformIO library. Is there any guide on how to setup the inturropt in the zephyr rtos?

 


   
ReplyQuote
dchaver
(@dchaver)
Member Admin
Joined: 3 years ago
Posts: 90
 

Hi Rui,

The reason why we use the System Controller is for being able to use WD's PSP/BSP libraries. You can either provide the signal directly to the PIC (in which case you won't be able to use the libraries or you will have to modify them) or you can replace GPIO/PTC interrupts with your new interrupt signal (in which case you will be able to use the libraries as they are). The appendix at the end of Lab 09 explains how to configure and use interrupts at a register level, so it can be useful for you. Also, the RVfpga-SoC package explains how to use Zephyr in Lab 04.

Let us know if you have any other questions.

Dani


   
ReplyQuote
(@ruiferreira)
Active Member
Joined: 2 months ago
Posts: 4
Topic starter  

When i try to include the psp_api.h library in zephyr, the compiler can't find the file. Do i have to include a different library when using zephyr?


   
ReplyQuote
(@zubairlk)
Member Admin
Joined: 3 years ago
Posts: 8
 

@ruiferreira Can you please elaborate what is psp_api.h and what you are trying to do with it by including it?

 

I don't see this type of header file in the Zephyr source code anywhere. https://github.com/zephyrproject-rtos/zephyr

 

Please keep in mind, development for Zephyr is quite different than developing for a standard computer with lots of libraries.

 

This link may help https://docs.zephyrproject.org/latest/develop/application/index.html

 

Thanks
ZubairLK


   
ReplyQuote
(@ruiferreira)
Active Member
Joined: 2 months ago
Posts: 4
Topic starter  

@zubairlk In lab09 that library is used to associate the gpio isr to the interrupt and in a previous reply, Dani told me to try and use the PSP/BSP librarys.

What i don't understand is how to use zephyr to manage the interrupt.


   
ReplyQuote
(@zubairlk)
Member Admin
Joined: 3 years ago
Posts: 8
 

@ruiferreira Have you had a chance to take a look at https://docs.zephyrproject.org/latest/kernel/services/interrupts.html ?

 


   
ReplyQuote