- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I'm a rookie of the SoCFPGA and I wanted to use it to build a FSM in HPS.
I have already finished building the system design as "User Manu" said and get the hps_0.h header file out.
I built my system based on the GHRD, and added a timer(100ms) using the Altera IP.
Now I want to play with it,yet there are little information about a timer or an interrupt working on SOC.
The board I'm using is a DE10-standard board.
Could anyone show me where to start?
And it will be better if you can provide a document/example on how to play with the Altera IP on C.
Thank you for your help.
Link Copied
- « Previous
-
- 1
- 2
- Next »
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Alex
What do you mean the KML?
Could you explain more what error you got or what you are trying to achive?
Regards
Jingyang, Teh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
My bad,
I mean I'm trying to use <linux/interrupt.h> but it seems can't call in user space code. I supposed to be done in Linux Kernel module.
So I want to use the kernel source code to compile my kernel module.
What I need for the compile is the kernel source code supposed located on /usr/src/$(uname -r).
Yet it is empty, so I download the Kernel source code and make it as zImage as my embedded system did.
What I want to know is that is there an easier way to compile the KML(I mean kernel module)?
Or can <linux/interrupt.h> can be used on user space code?
reguards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
And what I really confused is that I wrote my own IP device on FPGA, in order to use it in kernel module(basicly it only sends out the interrupt signal to irq_0 every 50 us), what should I do?
Do I need to update the Device Tree and refresh the u-boot?
Do I need to write my own driver for my timer IP?
What should I treat this IP, is it a device_platform?
How to communicate with my user space code. make a char device? Use /proc? Or is there a easy way that can achieve the goal: To tell the userspace it is the time to go.
Sorry for so many questions.
reguards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Alex
Sorry for the confusion.
We could not register a call back directly from hardware.
You would need to create your own kernel driver to send a signal your user application.
In the user application you would wait for the signal from the kernel to handle.
Below are some useful links regarding this :
https://man7.org/linux/man-pages/man7/signal.7.html
Regards
Jingyang, Teh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Alex
Any update on this case?
Regards
Jingyang, Teh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Yes, I wrote a kernel module to create an interrupt request.(which should be irq 73)
But I can't insmod the module for stack overflow.
Then I checked the other GIC turtour and it turns to be 72+personal_irq_num-32 = 41.
And when I checked the /proc/interrupt, there is an irq already. I assume it's duel to the DTB setting.
Now I wonder is that means I have to update the DTB file for my linux?
Thank you for all your help by the way.
Having a nice day
Reguards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
HI Alex
Could you try the GIC number 75?
From your design in previous case. Your interrupt is connected to f2h_iirq0 number 3.
From the GIC table, it should be 75.
Regards
Jingyang, Teh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
when I use 75 as the number in my kernel module,
the insmod failed
insmod: ERROR: could not insert module p3.ko: Invalid parameters
duel to request_irq()
Reguards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The return Error is -22
Which indicate handler is NULL(checked) or IRQ can't be used.
And when I checked the /proc/interrupts , the result is as followed:
But as the DTB on my board shows,there should be at least 3 FPGA interrupts.
When I use linux module to install the irq, it is not relay on DTB right?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Could you try adding the timer into the linux device tree?
I am not quite familiar with linux device tree, but could you try the following:
timer4@FF200000 {
compatible = "snps,dw-apb-timer";
interrupts = <0x0 0x6B 0x4>;
reg = <0xFF200000 0x1F>;
clocks = <0x38>;
};
Regards
Jingyang, Teh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Alex
Did you manage to test out the suggested changes?
Regards
Jingyang, Teh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm a little busy on other things right now,
please give me a couple of days.
Reguards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Alex
Did you managed to test out the device tree?
Regards
Jingyang, Teh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Alex
Do you still need some extra time for this case?
Regards
Jingyang, Teh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Since there are no feedback for this thread, I shall set this thread to close pending. Please login to ‘https://supporttickets.intel.com’, view details of the desire request, and post a feed/response within the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support. The community users will be able to help you on your follow-up questions.
If you happened to close this thread you might receive a survey. If you think you would rank your support experience less than 10 out of 10, please allow me to correct it before closing or if the problem can’t be corrected, please let me know the cause so that I may improve your future service experience.
Regards
Jingyang, Teh
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »