Hi all ,
Using Uvision4 & LPC1768 & RTX RTOS , I want to jump to 0x10000 of the flash. Before running RTX , there is no problem but after using os_sys_init(APP_TaskStart) , when trying to jump , there is a hardfault . How could I jump while RTX is running ?
By the way , Is there a way to disable RTX ?
Certainly is. Don't enable it.
and why, having chosen to use an OS (RTX), you then want to disable it?
Describe your goal(s): www.catb.org/.../smart-questions.html
Thanks for your attention ,
It’s a bootloader + application program
As I said without enabling RTOS it’s working fine so I thought maybe before jumping to the application I must disable it . I tried to disable SystemTick Timer so as to stop OS and it was useless . I disabled all interrupts (Global Flag) but it was useless too .
About reinitializing stack I haven’t done anything but both bootloader and application programs have got startup.s where stack is set there.
Lost by nature and Lost by name.
Check that system setting is the same for bootloader and application. If not you may need to reinitialise system setting at the begining of the application.
Yes , both are the same
The document says : “A hard fault is an exception that occurs because of an error during exception processing, or because an exception cannot be managed by any other exception mechanism “
This is my code :
__disable_irq(); SCB->VTOR = 0x10000; user_code_entry = (void (*)(void))(0x00010000 | 0x00000001); user_code_entry();
Exactly at the "SCB->VTOR = 0x10000" line the hard fault occurs . Probably this means an exception has occurred while SCB->VTOR has changed . Probably this exception is The SystemTick exception . SO if I disable SystemTick exception the problem is solved . Isn’t this true ? But the problem is __disable_irq() doesn’t have any effect on SystemTick apparently.
How could I handle this problem ?
Are your boot loader _really_ so advanced that it needs to run an RTOS?
If you do have very complicated code in the boot loader that you want to use RTOS, why not then have the boot loader decide if it should just boot an application (do that without use of RTX) or decide that the boot loader needs to do advanced communiaction.
You could then always perform download of a new application and when everything is completed you can force a watchdog reset, and then have the boot loader directly start the application.
But in reality, a boot loader using RTX sounds like a violation of the KISS principle.
RTOS has its place, but I have seen more cases of a RTOS used where it should not be, than cases where a RTOS was not used but should be.
also a very complicated bootloader is more likely to suffer from the one unexcusable bootloader fault: "If power fails at point x, the system is hung".
ANY bootloader that can not be restarted if interrupted by ANYTHING such as noise, power failure or whatever is a piece of crap. The criticl place, of course, is the transition from boot to app.
Erik
Are your boot loader _really_ so advanced that it needs to run an RTOS? I can solve this problem by resetting the system but I need to jump from the application to the bootloader for reprogramming command again and the application program is in RTX OS too . So I need to jump again . Apart from that the jump problem through RTX must be solved for my future projects .
View all questions in Keil forum