Page 1 of 2

ver 3.2.3 library for iCC430 and 5xx series

PostPosted: Wed Mar 18, 2009 2:33 am
by doniol
There seems to be a bug with the 5xx series cpu where the program counter increments by 4 instead of 2 after a disable interrupt "dint" instruction. A work-around is to add a "nop" after a "dint" so that the next instruction is not screwed up.

OK fine, no problem for my code, but when I try to use the slicc430-y Salvo Tiny library, the OSSched() call (and probably others) have instructions where a "dint" is not followed by a "nop" and my program resets. Is there any way to to get a new library build with this provision?


Re: ver 3.2.3 library for iCC430 and 5xx series

PostPosted: Wed Mar 18, 2009 2:45 am
by aek
We'll have to get an update for icc430 and regenerate libraries -- it will be a while ...

------------------


Re: ver 3.2.3 library for iCC430 and 5xx series

PostPosted: Thu Mar 19, 2009 10:05 am
by aek
Hmmm .. it occurred to me that we can pretty easily issue a set of patched libraries that have all instances of dint() followed by a nop() ... using our existing version of iccavr, etc.

I hope to have something for you tomorrow (Fri).

------------------


Re: ver 3.2.3 library for iCC430 and 5xx series

PostPosted: Thu Mar 19, 2009 10:52 am
by doniol
That is great news.

I had just spent a considerable amount of time designing a new board to use the new features of the 5xx for my thesis. I hope to not have to redesign it again, nor try to change my program to work without salvo. I really appreciate anything you can do!


Re: ver 3.2.3 library for iCC430 and 5xx series

PostPosted: Fri Mar 20, 2009 12:14 am
by aek
OK, all msp430 distros (lite, tiny, SE, LE & Pro) have been updated with the 3.2.4-d patch, which includes porticc430.h and the libraries for ICC430 (and porticc430.s in Pro distros).

These libraries were all built with dint() followed by a nop().

These have _not_ been tested. Please give that a shot -- I would suggest stepping through a Salvo service (e.g. OSCreateXyz) and a Salvo context switch at the assembly level to see that a NOP follows the DINT used in those code blocks.

------------------


Re: ver 3.2.3 library for iCC430 and 5xx series

PostPosted: Fri Mar 20, 2009 2:46 am
by doniol
The 3.2.4d patch does not compile in Imagecraft, with error message "__NOP not defined..."

I possibly found a temporary workaround while the patch gets resolved: A NOP is not necessary after a DINT if interrupts are already disabled. So immediately before calling OSSched(), issuing a DINT, followed by a NOP allows OSSched() to successfully run the beginning code without the NOP. I don't know if there are other segments in OSSched() where interrupts are re-enabled / disabled

BECAUSE:


TI decided to change the address of the the Watchdog timer in the 5xx. The code in OSSched() that usually modifies the watchdog timer at 0x0120 now modifies the Power Management Control Register (PMMCTL0). The 5xx enhanced watchdog timer_A address is 0x15C. The PMMCTL0 register has a password and writing to it without the upper byte as A5 results in a reset! :O

Since I'm using a library, I cannot change the configuration
#define OSCLEAR_WATCHDOG_TIMER()
in salvocfg.h.

[This message has been edited by doniol (edited March 23, 2009).]


Re: ver 3.2.3 library for iCC430 and 5xx series

PostPosted: Thu Mar 26, 2009 12:20 am
by doniol
It turns out the 5xx bug (EEM6 on errata SLAZ046B) has to do with a wrong PC only when using the JTAG interface and breakpoints with 20bit addresses. There is a workaround to manually change the PC at the breakpoint, and the bug does not happen during normal operation.

So, no extra NOPs needed afterall.

BUT, the change of watchdog timer WDTCTL register address issue still remains for 5xx...


Re: ver 3.2.3 library for iCC430 and 5xx series

PostPosted: Thu Mar 26, 2009 12:36 am
by aek
OK, so if we rebuild the libraries with no writes to the WDT, and you / the user handles that yourself, then that should work OK for now?

------------------


Re: ver 3.2.3 library for iCC430 and 5xx series

PostPosted: Thu Mar 26, 2009 3:56 am
by doniol
quote:
Originally posted by aek:
OK, so if we rebuild the libraries with no writes to the WDT, and you / the user handles that yourself, then that should work OK for now?


Correct, that should solve my issues.


Re: ver 3.2.3 library for iCC430 and 5xx series

PostPosted: Mon Mar 30, 2009 5:26 am
by doniol
quote:
Originally posted by aek:
Ok, they're all online (-3.2.4-d.zip).


Everything is working now as it should. Thanks aek!