Hi, i have a strange problem with STR7: everytime it crashes for unknown reason. Now i will explain better: my microcontroller has watchdog enabled and it has a voltage supervisor. I use EMI: bank 0 an external flash(15 waitstate), bank 1 a cpld(3 waitstate), bank 2 an external adc converter(3 waitstate)
I use 3 serial port at 230400 and 1 at 115200;
number of tasks (17) and number of timer (4) correctly declared; heap size 0x100; supervisor mode 0x20 interrupt mode 0x40 system mode 0x50
Sometimes some os_tmr start; only one os_tmr every 1 minute is recalled with os_tmr_create (now i will try to delete this timer).
It seems that no voltage supervisor reset micro (saw it with oscilloscope) It seems that no watchdog reset micro (saw it into CFR resgister) It seems a micro crash but i don't know why. It seems also that if i have done a micro reset by watchdog and after micro reset for my unknown crash, into CFR register i read a watchdog reset; how is possible (CFR resgister is not update)???
Using 4 serial ports at this speed some problem with:
void __swi(8) os_lock (void); void __SWI_8 (void) { /* This function must be executed from supervisor mode protected from */ /* interrupts. STR71x interrupts are disabled with a delay because EIC */ /* pheripheral may run with a slower clock than CPU. */ OS_LOCK(); /* Wait for 'OS_LOCK' to become active. */ __nop(); __nop(); __nop(); }
In the previous versions of mdk you must increase __nop to work properly interrupt but problem must be solved.
Any idea??? Please help me!!
PS: I use the last mdk_arm and last version of library and no overflow occurs!!
to disable IRQ you have 2 ways : - using EIC ( it's STR71x dependant - using CPSR wich is ARM specific...
the first may cause problem : the EIC is a peripherial on a bus so there is some delay before the IRQ is really disabled ( that's why you insert nop()...).
disabling irq by the CPSR is better because it's done directly on the core... the only problem is that in user mode you cann't modify the CPSR
A/ the final change to usr is done in the str71x.s near the call of __main. you could for example deactivate the switch in this mode.
see armlib help for this intrinsec functions...
B/ for fhis you can create a swi function tha modify the CPSR ( swi are privileged so they can modify the CPSR.
CG