threadx icon indicating copy to clipboard operation
threadx copied to clipboard

The interrupt vector table offset register should not be set.

Open SeeDeer opened this issue 1 year ago • 4 comments

/* Setup Vector Table Offset Register. */ MOV r0, #0xE000E000 // Build address of NVIC registers LDR r1, =_vectors // Pickup address of vector table STR r1, [r0, #0xD08] // Set vector table address

/* Set system stack pointer from vector value. */ LDR r0, =_tx_thread_system_stack_ptr // Build address of system stack pointer LDR r1, =_vectors // Pickup address of vector table LDR r1, [r1] // Pickup reset stack pointer STR r1, [r0] // Save system stack pointer

in ports/cortex_m7/gnu/example_build/tx_initialize_low_level.S file, the interrupt vector table offset register is set, which will cause trouble for users. The interrupt vector table is generally set before RTOS starts, such as in the startup.s file, or when performing an upgrade jump.

If the above code operation is intended to set the following variable '_tx_thread_system_stack_ptr'. It is recommended to let '_tx_thread_system_stack_ptr' be set by the user.

Also the variable '_tx_thread_system_stack_ptr' is not used to reset the interrupt stack.

SeeDeer avatar Mar 08 '24 08:03 SeeDeer

My apologies for the long delay. I will flag this issue for discussion with the group of committers.

fdesbiens avatar Feb 27 '25 16:02 fdesbiens

@eclipse-threadx/iot-threadx-committers and @eclipse-threadx/iot-threadx-contributors: please have a look.

fdesbiens avatar Apr 01 '25 16:04 fdesbiens

not sure if this is a bug, feature, or preference my experience is VTOR set here is not a problem

cypherbridge avatar Apr 01 '25 22:04 cypherbridge

We discussed this issue and agree the change should be made.

We will include it in our planning.

fdesbiens avatar Apr 08 '25 16:04 fdesbiens