2003-12-09 01:40 AM
ST269 resets due to _divu32 call in ISR
2003-12-03 07:46 AM
We have some very old test software that we’ve used for years. I’m experiencing problems with our recent micro change from the ST 168 to the ST269. When using the intrinsic divide routines, like _divu32, inside interrupts, the micro resets. In the interrupt, I use the capture compare values to compute an incoming frequency. The problem is repeatable although not every execution of the divide causes a reset. Often several hundred interrupts are required before a reset.
The code used an old v5.1 r0 version of the tasking compiler. The same software image used on the ST168 does not have reset problems. Any suggestions on what I should try next? We have not yet upgraded our In-Circuit Emulator to support the ST269. I suppose there could be a divide by zero or a stack overflow but why would there be a difference between the 168 and 269? Besides, I check for a zero in the denominator before attempting the divide.2003-12-09 01:40 AM
Hello,
It seems you are using the Altium/Tasking toolchain. There was some modifications in the handling of the multiply and divide operations in the toolchain. In previous versions, these instructions were always made uninterruptible by the toolchain while it is no longer the case. So if you are using them in the Interrupt routine that interrupts such an instruction you might have troubles. Check the options: either to make the mul/div instructions uniterruptible either to save the mul/div context in the interrupt routines where you use such instructions. Regards, Kenshin