Skip to content

Commit 510e5d7

Browse files
lpereiraAnas Nashif
authored andcommitted
arch: xtensa: Use the alternate _Level4Vector routine on ESP32
For some reason, the ESP32 HAL defines XCHAL_EXCM_LEVEL to 3. This enables a version of _Level4Vector that doesn't work on this hardware. Without complete visibility if the version that should work be axed, keep both in the tree, but build the working other version instead if building for ESP32. Jira: ZEP-2556 Signed-off-by: Leandro Pereira <[email protected]>
1 parent 8dc8806 commit 510e5d7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

arch/xtensa/core/xtensa_vectors.S

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,12 @@ _xt_medint3_exit:
11611161

11621162
#endif /* Level 3 */
11631163

1164-
#if XCHAL_EXCM_LEVEL >= 4
1164+
/* FIXME: For some reason, the HAL provided by the ESP32 port of FreeRTOS,
1165+
* that Zephyr uses, defines XCHAL_EXCM_LEVEL to 3. That essentially
1166+
* enables the other _Level4Vector routine, that doesn't work on ESP32.
1167+
* This is tracked by: https://jira.zephyrproject.org/browse/ZEP-2570
1168+
*/
1169+
#if defined(CONFIG_SOC_ESP32) || (XCHAL_EXCM_LEVEL >= 4)
11651170

11661171
.begin literal_prefix .Level4InterruptVector
11671172
.section .Level4InterruptVector.text, "ax"
@@ -1488,7 +1493,7 @@ _xt_highint3:
14881493

14891494
#endif /* Level 3 */
14901495

1491-
#if XCHAL_NUM_INTLEVELS >=4 && XCHAL_EXCM_LEVEL <4 && XCHAL_DEBUGLEVEL !=4
1496+
#if !defined(CONFIG_SOC_ESP32) && XCHAL_NUM_INTLEVELS >=4 && XCHAL_EXCM_LEVEL <4 && XCHAL_DEBUGLEVEL !=4
14921497

14931498
.begin literal_prefix .Level4InterruptVector
14941499
.section .Level4InterruptVector.text, "ax"

0 commit comments

Comments
 (0)