eclipse-threadx / threadx

Eclipse ThreadX is an advanced real-time operating system (RTOS) designed specifically for deeply embedded applications.
https://github.com/eclipse-threadx/rtos-docs/blob/main/rtos-docs/threadx/index.md
MIT License
2.8k stars 767 forks source link

The interrupt vector table offset register should not be set. #370

Open SeeDeer opened 3 months ago

SeeDeer commented 3 months ago

/ 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.