R. Steve McKown [Fri, 2 Jan 2015 21:06:50 +0000 (14:06 -0700)]
stm25p: fix seek error
Ensure correct computation of m_log_info[ id ].read_addr when client code
requests seek() to a cookie whose value is below the current virtual
address range by a distance, in address value, greater than 255 sectors.
The sector component of a virtual address is 16 bits, given
STM25P_SECTOR_SIZE_LOG2 is 16 and sizeof(storage_cookie_t) is 32.
However, in ClientResource.granted[]() in the S_SEEK case, the client's
read_addr value can have its upper bits silently discarded because
sector value are handled in uint8_t variables.
The symptom of upper bit discards is that client code receives the
contents of a full log many times until the client read_addr value
finally increments to the point that allows satisfaction of the end of
log condition,
The resulting address handling in ClientResource.granted[]() in the
S_SEEK request case, around Stm25pLogP.nc:229:
readSector = 0xa7; // from incoming cookie value, should be 0x2a7
writeSector = 0xa7; // should be 0x5a7
if (writeSector - readSector > numSectors): FALSE, should be TRUE
Had the if expression above been TRUE, the read address would
still be computed incorrectly due to 8-bit match in the if's
'then' clause.
m_log_state[ id ].read_addr = 0x2a7000; // should be 0x59f000
R. Steve McKown [Mon, 29 Dec 2014 23:02:27 +0000 (16:02 -0700)]
msp430 usci: fix DMA TX byte overwrite
The DMA transmit operation for USCI was a little naive, in that it was
not accounting for the possibility that UCxxTXBUF already has a byte to
be transmitted. Wait for this byte to be transmitted before starting
the DMA operation.
Also note in the code that the DMA transfer operations, trigered by
UCxxTXIFG, are edge sensitive.
R. Steve McKown [Tue, 23 Dec 2014 19:50:45 +0000 (12:50 -0700)]
msp430 usci: TX operations via DMA
USCI UART A0 and A1 support DMA transmit via Msp430UartDmaA0C and
Msp430UartDmaA1C, respectively. Since both components are implemented
using DMA channel 0, they cannot be both utilized in the same program.
A future parameterized DMA interface could be used to allow
serialization of DMA operations between UARTs using a single DMA
channel.
R. Steve McKown [Tue, 19 Aug 2014 15:37:49 +0000 (09:37 -0600)]
Mass platform updates for GCC 4.6.3
* -mmcu option now uses different strings to reference specific msp430
parts. For example, where the string msp430x1611 was valid before,
the new equivalent string is msp430f1611.
* The option -mdisable-hwmul has been changed to -mmpy=none
R. Steve McKown [Wed, 3 Apr 2013 14:50:54 +0000 (08:50 -0600)]
Fix TMI copyright attributions
TMI copyright attributions, originally derived from another attribution
in TinyOS source code, failed to replace all instances of the entity
name in the original attribution. This problem was found because that
original entity name contains characters that breaks nesdoc (aka make
<platform> docs).
R. Steve McKown [Fri, 15 Mar 2013 15:04:38 +0000 (09:04 -0600)]
Update tos-bsl for win32 python
tos-bsl uses the cp210xrt module, whose source is provided herein. This
is a simple extension for Python that allows access to the
CP210x_WriteLatch function in the CP210xRuntime.dll. The compiled
Python extension module is included, as well as the runtime dll and its
associated .lib and .h files. The module was compiled using Visual
Studio C++ Express 2008, which is apparently the same version of the
MSVC used to compile ActivePython 2.7.1 from ActiveState, on which the
module was tested.
This uses the latest CP210xRuntime.dll and requires a 6.x version of the
SiLabs VCP to be installed. Tested with VCP_Windows v6.6.1.
The code changes should not change behavior on non-win32 platforms.
R. Steve McKown [Sun, 9 Dec 2012 17:35:34 +0000 (10:35 -0700)]
Search for Makelocal in TOSMAKE_PATH
User code may provide its own Makelocal via TOSMAKE_PATH.
This only works correct if TOS_MAKE_PATH is added to the end of
TOSMAKE_PATH so local paths take precedence.
R. Steve McKown [Sat, 27 Oct 2012 03:55:30 +0000 (21:55 -0600)]
tmimsp: clean up open drain for sht1x DATA
Rename Msp430OpenDrainC to Msp430ODPUC and fix it up. This is an
open-drain component that also provides an internal pull-up so an
external one is not required. It only works on MSP430 pins offering
internal pull up/down feature.
The OpenDrainC component provides an open-drain emulation, does not
provide an internal pull-up, and should work for any microcontroller
having a GeneralIO implementation for its GPIO pins.
R. Steve McKown [Tue, 23 Oct 2012 23:45:35 +0000 (17:45 -0600)]
tmimsp: support 4 KB sectors on AT25DF041A
The tmimsp platform family by default uses an Atmel AT25DF041A serial
FLASH part which supports 4 KB erase blocks. Since the part's
communications protocol is a super-set of that supported by the STM25P
family, a private Stm25PSpiP that issues 0x20 4 KB erase block instead
of the default 0xd8 64 KB erase block command, and a companion Stm25p.h
that properly defines the sector size (aka erase block size) allows the
part to be treated as an array of 4 KB sectors. This is a huge win for
most application uses of FLASH.
R. Steve McKown [Thu, 4 Oct 2012 23:22:18 +0000 (17:22 -0600)]
tmimsp family: flash is now working
The AT25DF family, on power up or reset (not reset of the board, but the
AT25DF part itself) has by default write protection active for its
sectors. This code change in MotePlatformC for both parts in the family
globally unprotects all sectors. At this point, the AT25DF family are
functionally equivalent to the ST/Numonyx/whomever M25P family, so the
latter's driver works for the former.
jan.hauer [Wed, 9 Mar 2011 15:26:12 +0000 (15:26 +0000)]
Added a temporary workaround that allows to compile msp430 ADC code with mspgcc version >= 4. The workaround is re-defining the ADC bitfield structs, see also https://www.millennium.berkeley.edu/pipermail/tinyos-devel/2011-March/004804.html
R. Steve McKown [Thu, 3 Nov 2011 23:45:36 +0000 (17:45 -0600)]
Updates for GCC 4.5.3
* Include correct GCC headers depending upon version
* GCC does not stop the watchdog, so do it in PlatformP.nc
* Stopping watchdog in MotePlatformC no longer needed (olimexp16,
tmicore, tmirws)
* tmicore writes TxIV in MoteClockP so needs MSP430REG_NORACE()
R. Steve McKown [Wed, 21 Mar 2012 14:50:47 +0000 (08:50 -0600)]
Allow custom platform families
ncc can find a custom platform if its PLATFORMDIR is included into
PFLAGS as an include: -I$(PLATFORMDIR) or equivalent. Teach ncc to
identify when such a platform is a family member and in such cases
process the corresponding .family file.
R. Steve McKown [Wed, 27 Oct 2010 23:54:17 +0000 (17:54 -0600)]
USCI I2C support.
Current limitations and features:
* Master mode only.
* No multi-master bus configurations.
* Will automatically reset a hung bus, if for example the master reset in the
middle of a transaction and a slave currently is driving SDA low.
* Repeated starts are supported and can be very time efficient.
* An I2C transactions may be processed with multiple I2CPacket.read() or
I2CPacket.write() commands, as appropriate. The first must include I2C_START
and the last must include I2C_STOP.
* Conditions exist during read where the hardware may clock out an extra byte
from the slave before stop. This byte is not passed to the user.
R. Steve McKown [Fri, 24 Sep 2010 22:32:11 +0000 (16:32 -0600)]
Race condition clearing bit vectors that are already clear in Init.init.
There's no point to clear the bit vectors in SharedArbiterP.Init.init,
because the compiler guarantees they are already clear, see BitVectorC.nc.
However, manually clearing them can create a situation where someone requesting
a shared resource has their requesting bit erased, depending upon the order of
calls to Init.init providers during boot.
R. Steve McKown [Fri, 7 May 2010 20:42:29 +0000 (14:42 -0600)]
Merge TinyOS 2.1.1 into master.
How this merge was done:
* Rebase patchset/2.1.0-4.2 onto tinyos/2.1.1 as topic/patchup211
* cp topic/patchup211 tree to tmp dir
* Checkout master, rm all files, cp in from tmp dir, git add .
Future work on TinyOS 2.1.0 w/TMI enhancements via release/2.1.0.
R. Steve McKown [Fri, 23 Apr 2010 22:39:53 +0000 (16:39 -0600)]
Don't hard-code for ncc in mig and ncg scripts.
The rationalization for this change is that nesc shouldn't really know where
tinyos-tools is installed, since they are separate packages. The pragmatic
reason for this change is that it allows using ncc from tinyos-tools before
installation to allow a single debian tinyos source package to build both
tinyos-tools and tinyos-source-VERSION packages.
R. Steve McKown [Fri, 23 Apr 2010 16:25:39 +0000 (10:25 -0600)]
Improved tinyos.sh
* Automatically installs tinyos.sh into user shell rc files when sourced.
* Adds an uninstall option if a user no longer wants to do TinyOS dev.
* Smarter handling of CLASSPATH.
* tinyos.jar is added to CLASSPATH instead of support/sdk/java. The latter is
a TOS 1.x idiom.
* Better error and help messages.
R. Steve McKown [Fri, 13 Nov 2009 23:47:49 +0000 (16:47 -0700)]
Upstream commits to tos/chips/cc2420, Aug 7 2008 thru Jul 16 2009, except one.
commit df004818be0944a5459b2d23dd4b49c55b716448
kusy <kusy> Thu Aug 7 00:06:53 2008 +0000
Previously reported timestamping bug was only fixed partially: *timesync...
NOT COMMITTED f8120ec47efebf578a6edf99882d009ea6dedcd1
kusy <kusy> Wed Aug 13 07:37:05 2008 +0000
Fixing T32khz to TMilli conversion - coeficient 32 needs to be...
commit 42b450d2e6d5eda17245d38f4d2bceb6b60e5400
rincon <rincon> Mon Aug 18 22:04:15 2008 +0000
Added a length check to make sure we don't try to send a packet that is...
commit 72c8a4f1a2b4f331aeedc6bfd5262253ce8d6d04
janhauer <janhauer> Wed Nov 26 10:13:31 2008 +0000
Added an interface for accessing the RXFIFO in a non-split phase...
R. Steve McKown [Mon, 19 Apr 2010 22:13:15 +0000 (16:13 -0600)]
Fix startup in SoftwareInit.init overwriting changes to StateC's.
If a component wires its Init.init() via SoftwareInit and ncc calls
StateImplP.Init.init() after the component's Init.init(), any change to its
StateC, such as call State.forceState(), is undone. The easy fix is to remove
the extra initiation of state[] in StateImplP.Init.init(), since state[] is a
static and is guaranteed to have members with value zero (S_IDLE).
R. Steve McKown [Thu, 8 Apr 2010 01:16:46 +0000 (19:16 -0600)]
USCI fixes.
* Watch out for sendData() clobbering TXBUF.
* May solve a loss of UART TX chars.
* USCI UartStream.send() gains nothing by immediately sending the 1st byte.
* m_sobuf cannot be null in Interrupts.tx, so remove the check.
R. Steve McKown [Thu, 8 Apr 2010 00:02:56 +0000 (18:02 -0600)]
Improve interrupt handling for USCI.
Because some interrupts share an interrupt vector, we use the relevant interrupt
enable bit to decide if any user is interested in the interrupt. If not, that
interrupt is skipped so that another interrupt in the if/then/elseif chain can
be taken. We also defensively try to prevent I2C interrupts from being a
problem if not used, although no I2C code using these interrupts has yet been
written.
R. Steve McKown [Thu, 8 Apr 2010 19:50:41 +0000 (13:50 -0600)]
Teach tos-storage-stm25p to derive NUM_SECTORS and SECTOR_SIZE.
The stm25p driver is suitable for different sizes of flash parts, such as the
commonly used 8Mb M25P80 and the less commonly used 1Mb M25P10A. The driver
defines the flash configuration in Stm25p.h. By having tos-storage-stm25p walk
the @includes for the platform, as found in the .platform file, each platform
can ensure that a Stm25p.h with correct content for its flash part is found
for use by the driver and this script.
R. Steve McKown [Wed, 2 Dec 2009 23:37:00 +0000 (16:37 -0700)]
Remove sensors code from tmirws platform.
The sensors code is not stable enough for inclusion into core tinyos, nor is
there yet a clean separation between platform code and application code. The
sensors code removed here was imported with its history into the RWS
application repository.
smckown [Mon, 9 Nov 2009 19:30:58 +0000 (19:30 +0000)]
Redo Average interface.
There is no point in having the averagers pre-know their number of samples.
The user should know this information. Therefore we have a more flexible
solution and avoid a signal to return the averate to the user when that user is
very likely to want to call a command instead.