Hi:
I have a project that uses the IEP timer in the PRU. The project works correctly with these parameters:
Debian version: 10.13
Kernel: Linux beaglebone 4.19.94-ti-r73 #1buster SMP PREEMPT Fri Apr 15 21:38:30 UTC 2022 armv7l GNU/Linux
This is my file that contains the resource table (resource_table.h):
#ifndef RSC_TABLE_PRU_H
#define RSC_TABLE_PRU_H
#include <stddef.h>
#include <rsc_types.h>
#define PRU_RPMSG_VQ0_SIZE 2
#define PRU_RPMSG_VQ1_SIZE 2
/* flip up bits whose indices represent features we support */
#define RPMSG_PRU_C0_FEATURES 1
/* Definition for unused interrupts */
#define HOST_UNUSED 255
/* Mapping sysevts to a channel. Each pair contains a sysevt, channel */
struct ch_map pru_intc_map = { {7, 1 } };
struct my_resource_table {
struct resource_table base;
uint32_t offset[1]; /* Should match 'num' in actual definition */
/* intc definition */
struct fw_rsc_custom pru_ints;
};
#pragma DATA_SECTION(am335x_pru_remoteproc_ResourceTable, “.resource_table”)
#pragma RETAIN(am335x_pru_remoteproc_ResourceTable)
struct my_resource_table am335x_pru_remoteproc_ResourceTable = {
1, /* we’re the first version that implements this /
1, / number of entries in the table /
0, 0, / reserved, must be zero /
/ offsets to entries */
{
offsetof(struct my_resource_table, pru_ints),
},
{
TYPE_POSTLOAD_VENDOR, PRU_INTS_VER0 | TYPE_PRU_INTS,
sizeof(struct fw_rsc_custom_ints),
{
0x0000,
/* Channel-to-host mapping, 255 for unused */
HOST_UNUSED, 1, HOST_UNUSED, HOST_UNUSED, HOST_UNUSED, HOST_UNUSED, HOST_UNUSED, HOST_UNUSED, HOST_UNUSED, HOST_UNUSED,
/* Number of evts being mapped to channels */
(sizeof(pru_intc_map) / sizeof(struct ch_map)),
/* Pointer to the structure containing mapped events */
pru_intc_map,
},
},
};
#endif /* RSC_TABLE_PRU_H */
When launching the firmware on the PRU, I can see this message in the kernel log:
The process runs correctly, the timer works well, making the corresponding interrupts.
When updating the image with these parameters:
debian version: 11.10
kernel: Linux BeagleBone 5.10.168-ti-r79 #1bullseye SMP PREEMPT Mon Jul 22 17:49:20 UTC 2024 armv7l GNU/Linux
It did not compile correctly because the definition of the ch_map structure was missing. I added it to the pru_types.h file exactly as it was in the version used in 10.13:
struct ch_map {
uint8_t evt;
uint8_t ch;
};
This way, I managed to get the project to compile.
However, when launching the firmware on the PRU, I see this in the kernel log:
although the PRU is running the firmware, the timer does not generate interrupts.
I think the problem is the timer interrupt is not being correctly configured in the resource table.
What is the resource 5 that is unsupported?
How I modify my resource_table.h file?
Is there a tutorial for configuring the resource table file?