Dear @jachen,
Thanks for your reply. I followed your recommendations.
- I started with the original code, as released by Nvidia, with the minimal changes to get it working on my HW. See this attached file to see the diff custom_board.diff (1.8 KB)
- Then I modified the example to have a square pulse, toggling every 200ms. Here is the patch: toggle_200ms.patch (662 Bytes)
- And finally, I set the GTE FIFO occupancy to 3: gte_fifo_occupancy_3.patch (428 Bytes)
Please let me know if you see any issue with the submitted patches. Below are all the logs I gathered, including for a case with the issue present.
Also, in case you wonder, all binaries are generated with the toolchain recommended by Nvidia for SPE development.
Looking forward to your feedback.
Logs for the initial state
Console output
gpio_app_task - Setting GPIO_APP_OUT to 1 - IRQ should trigger
can_gpio_irq_handler - gpio irq triggered - setting GPIO_APP_OUT to 0
Slice Id: 2, Event Id: 14 (Other), Edge = rising, Raw Time stamp = 0 Time Stamp in nanosec 5369c725
gpio_app_task - Setting GPIO_APP_OUT to 1 - IRQ should trigger
can_gpio_irq_handler - gpio irq triggered - setting GPIO_APP_OUT to 0
Slice Id: 2, Event Id: 14 (Other), Edge = falling, Raw Time stamp = 0 Time Stamp in nanosec 5e9ee838
gpio_app_task - Setting GPIO_APP_OUT to 1 - IRQ should trigger
can_gpio_irq_handler - gpio irq triggered - setting GPIO_APP_OUT to 0
Slice Id: 2, Event Id: 14 (Other), Edge = rising, Raw Time stamp = 0 Time Stamp in nanosec 69d40949
gpio_app_task - Setting GPIO_APP_OUT to 1 - IRQ should trigger
can_gpio_irq_handler - gpio irq triggered - setting GPIO_APP_OUT to 0
Slice Id: 2, Event Id: 14 (Other), Edge = falling, Raw Time stamp = 0 Time Stamp in nanosec 75092a5b
gpio_app_task - Setting GPIO_APP_OUT to 1 - IRQ should trigger
can_gpio_irq_handler - gpio irq triggered - setting GPIO_APP_OUT to 0
Slice Id: 2, Event Id: 14 (Other), Edge = rising, Raw Time stamp = 0 Time Stamp in nanosec 803e4b6c
gpio_app_task - Setting GPIO_APP_OUT to 1 - IRQ should trigger
can_gpio_irq_handler - gpio irq triggered - setting GPIO_APP_OUT to 0
Summary
Raw value (hex) |
Ticks (hex2dec) |
Delta |
Interval in seconds (* 32/1e9) |
5369c725 |
1399441189 |
- |
- |
5e9ee838 |
1587472440 |
188031251 |
6.017000032 |
69d40949 |
1775503689 |
188031249 |
6.016999968 |
75092a5b |
1963534939 |
188031250 |
6.017 |
803e4b6c |
2151566188 |
188031249 |
6.016999968 |
The line is set to toggle every 3s (checked with the scope), the GTE stamps on the rising edge (i believe the ISR print provided in the example is not correct - the rising/falling edge report is incorrect, and the unit is ticks and not nanoseconds).
I do observe consistently a 6s interval report, this is matching my expectations.
Logs for the requested test case (toggle every 200ms)
Console output
gpio_app_task - Setting GPIO_APP_OUT to 1 - IRQ should trigger
can_gpio_irq_handler - gpio irq triggered - setting GPIO_APP_OUT to 0
Slice Id: 2, Event Id: 14 (Other), Edge = rising, Raw Time stamp = 0 Time Stamp in nanosec 3a340c9a
gpio_app_task - Setting GPIO_APP_OUT to 1 - IRQ should trigger
can_gpio_irq_handler - gpio irq triggered - setting GPIO_APP_OUT to 0
Slice Id: 2, Event Id: 14 (Other), Edge = falling, Raw Time stamp = 0 Time Stamp in nanosec 3afae3ed
gpio_app_task - Setting GPIO_APP_OUT to 1 - IRQ should trigger
can_gpio_irq_handler - gpio irq triggered - setting GPIO_APP_OUT to 0
Slice Id: 2, Event Id: 14 (Other), Edge = rising, Raw Time stamp = 0 Time Stamp in nanosec 3bc1bb3e
gpio_app_task - Setting GPIO_APP_OUT to 1 - IRQ should trigger
can_gpio_irq_handler - gpio irq triggered - setting GPIO_APP_OUT to 0
Slice Id: 2, Event Id: 14 (Other), Edge = falling, Raw Time stamp = 0 Time Stamp in nanosec 3c889290
gpio_app_task - Setting GPIO_APP_OUT to 1 - IRQ should trigger
can_gpio_irq_handler - gpio irq triggered - setting GPIO_APP_OUT to 0
Slice Id: 2, Event Id: 14 (Other), Edge = rising, Raw Time stamp = 0 Time Stamp in nanosec 3d4f69e2
gpio_app_task - Setting GPIO_APP_OUT to 1 - IRQ should trigger
can_gpio_irq_handler - gpio irq triggered - setting GPIO_APP_OUT to 0
Slice Id: 2, Event Id: 14 (Other), Edge = falling, Raw Time stamp = 0 Time Stamp in nanosec 3e164132
gpio_app_task - Setting GPIO_APP_OUT to 1 - IRQ should trigger
can_gpio_irq_handler - gpio irq triggered - setting GPIO_APP_OUT to 0
Slice Id: 2, Event Id: 14 (Other), Edge = rising, Raw Time stamp = 0 Time Stamp in nanosec 3edd1886
Summary
Raw value (hex) |
Ticks (hex2dec) |
Delta |
Interval in seconds (* 32/1e9) |
3a340c9a |
976489626 |
- |
- |
3afae3ed |
989520877 |
13031251 |
0.417000032 |
3bc1bb3e |
1002552126 |
13031249 |
0.416999968 |
3c889290 |
1015583376 |
13031250 |
0.417 |
3d4f69e2 |
1028614626 |
13031250 |
0.417 |
3e164132 |
1041645874 |
13031248 |
0.416999936 |
3edd1886 |
1054677126 |
13031252 |
0.417000064 |
I do observe consistently a 0.4s interval report, this is matching my expectations. I also checked the line on the scope to make sure the pulse is generated as expected.
Logs for the toggle every 200ms - with GTE FIFO occupancy set to 3
Console output
can_gpio_irq_handler - gpio irq triggered - setting GPIO_APP_OUT to 0
gpio_app_task - Setting GPIO_APP_OUT to 1 - IRQ should trigger
can_gpio_irq_handler - gpio irq triggered - setting GPIO_APP_OUT to 0
gpio_app_task - Setting GPIO_APP_OUT to 1 - IRQ should trigger
can_gpio_irq_handler - gpio irq triggered - setting GPIO_APP_OUT to 0
gpio_app_task - Setting GPIO_APP_OUT to 1 - IRQ should trigger
Slice Id: 2, Event Id: 14 (Other), Edge = rising, Raw Time stamp = 0 Time Stamp in nanosec c42524b1
Slice Id: 2, Event Id: 14 (Other), Edge = falling, Raw Time stamp = 0 Time Stamp in nanosec c4e82b73
Slice Id: 2, Event Id: 14 (Other), Edge = rising, Raw Time stamp = 0 Time Stamp in nanosec c4ab3234
can_gpio_irq_handler - gpio irq triggered - setting GPIO_APP_OUT to 0
gpio_app_task - Setting GPIO_APP_OUT to 1 - IRQ should trigger
can_gpio_irq_handler - gpio irq triggered - setting GPIO_APP_OUT to 0
gpio_app_task - Setting GPIO_APP_OUT to 1 - IRQ should trigger
can_gpio_irq_handler - gpio irq triggered - setting GPIO_APP_OUT to 0
gpio_app_task - Setting GPIO_APP_OUT to 1 - IRQ should trigger
Slice Id: 2, Event Id: 14 (Other), Edge = falling, Raw Time stamp = 0 Time Stamp in nanosec c77a9ecb
Slice Id: 2, Event Id: 14 (Other), Edge = rising, Raw Time stamp = 0 Time Stamp in nanosec c73da58d
Slice Id: 2, Event Id: 14 (Other), Edge = falling, Raw Time stamp = 0 Time Stamp in nanosec c700ac4e
can_gpio_irq_handler - gpio irq triggered - setting GPIO_APP_OUT to 0
gpio_app_task - Setting GPIO_APP_OUT to 1 - IRQ should trigger
can_gpio_irq_handler - gpio irq triggered - setting GPIO_APP_OUT to 0
gpio_app_task - Setting GPIO_APP_OUT to 1 - IRQ should trigger
can_gpio_irq_handler - gpio irq triggered - setting GPIO_APP_OUT to 0
gpio_app_task - Setting GPIO_APP_OUT to 1 - IRQ should trigger
Slice Id: 2, Event Id: 14 (Other), Edge = rising, Raw Time stamp = 0 Time Stamp in nanosec c8d018e5
Slice Id: 2, Event Id: 14 (Other), Edge = falling, Raw Time stamp = 0 Time Stamp in nanosec c8931fa7
Slice Id: 2, Event Id: 14 (Other), Edge = rising, Raw Time stamp = 0 Time Stamp in nanosec c9562668
The settings seems to be effective since now the GTE output is present only 1 time out of 3, and 3 GTE timestamps are reported.
Summary
Raw value (hex) |
Ticks (hex2dec) |
Delta |
Interval in seconds (* 32/1e9) |
c42524b1 |
3290768561 |
- |
- |
c4e82b73 |
3303549811 |
12781250 |
0.409 |
c4ab3234 |
3299553844 |
-3995967 |
-0.127870944 |
c77a9ecb |
3346702027 |
47148183 |
1.508741856 |
c73da58d |
3342706061 |
-3995966 |
-0.127870912 |
c700ac4e |
3338710094 |
-3995967 |
-0.127870944 |
c8d018e5 |
3369081061 |
30370967 |
0.971870944 |
c8931fa7 |
3365085095 |
-3995966 |
-0.127870912 |
c9562668 |
3377866344 |
12781249 |
0.408999968 |
Now the interval is sometimes correct, sometimes not, or negative jumps appear.