No fighting from me. C has its place and certainly compilers are better, but to assume that a compiler can outwit a human who does this sort of work for a living is a bit foolish. I have spent more time than most people here in these forums have been alive disassembling compiled code to re-create it in full assembly to reduce size and increase speed, so I am well aware of the progress compilers have made.
@ESP_Sprite, you might recall the project I discussed with you. I need to reduce the interrupt latency by at least 25ns in order to meet the fastest timing window that a new sensor is requiring. As it stands now, from the time the GPIO pin (mapped to the MCPWM module) changes states until the highInt5 interrupt handler is entered is ~225ns. I need that sub 200ns, preferably 150ns max. I would love to be able to replace whatever mechanism is in place for handling interrupts so I can eliminate even checking of other interrupts. I don't think this is an issue of traversing a list because the latency is the same for NMI as highInt5. I just can't see how it takes 60 instruction cycles to get to the ISR. Our system works great, and we have proved this with thousands of sample units in the field beta test program. We just got thrown this curve ball with a new timing requirement and I am trying to work through it before we go to full scale production (to make sure it can be done). If you happen to know some magical way to reduce this latency, please let me know!
This is just the high level routines, not the ROM routines. We don't get to see the ROM routines because they are included as part of the "core" package.
ok-home wrote:
Each vector goes at a predetermined location according to the Xtensa
hardware configuration, which is ensured by its placement in a special
section known to the Xtensa linker support package (LSP). It performs
the minimum necessary before jumping to the handler in the .text section.
https://github.com/espressif/esp-idf/bl ... m.ld#L1406
Yeah, so this is the mystery. This seems to indicate what I was told - the interrupt vector table and entries are built by the compiler and are hard coded during the compile. That "minimum necessary" is the source of my problem. Every CPU I have ever worked with has the ability to map the vector table, typically RAM based, so it can easily be changed and can use fast memory. Those that do have hard coded vectors in code space offer information on how to set that at assemble time.